| 275 | } |
| 276 | |
| 277 | std::vector<ModuleResource> Module::FindResources(const std::string& path, const std::string& filePattern, |
| 278 | bool recurse) const |
| 279 | { |
| 280 | std::vector<ModuleResource> result; |
| 281 | if (!d->resourceContainer.IsValid()) |
| 282 | { |
| 283 | return result; |
| 284 | } |
| 285 | |
| 286 | std::string normalizedPath = path; |
| 287 | // add a leading and trailing slash |
| 288 | if (normalizedPath.empty()) normalizedPath.push_back('/'); |
| 289 | if (*normalizedPath.begin() != '/') normalizedPath = '/' + normalizedPath; |
| 290 | if (*normalizedPath.rbegin() != '/') normalizedPath.push_back('/'); |
| 291 | d->resourceContainer.FindNodes(d->info.name + normalizedPath, |
| 292 | filePattern.empty() ? "*" : filePattern, |
| 293 | recurse, result); |
| 294 | return result; |
| 295 | } |
| 296 | |
| 297 | } |
| 298 | |