| 72 | } |
| 73 | |
| 74 | void DirectoryAssetSource::scanAll(String const& assetDirectory, StringList& output) const { |
| 75 | auto shouldIgnore = [this](String const& assetPath) { |
| 76 | for (auto const& pattern : m_ignorePatterns) { |
| 77 | if (assetPath.regexMatch(pattern, false, false)) |
| 78 | return true; |
| 79 | } |
| 80 | return false; |
| 81 | }; |
| 82 | |
| 83 | // path must be passed in including the trailing '/' |
| 84 | String fsDirectory = toFilesystem(assetDirectory); |
| 85 | for (auto entry : File::dirList(fsDirectory)) { |
| 86 | String assetPath = assetDirectory + entry.first; |
| 87 | if (entry.second) { |
| 88 | scanAll(assetPath + "/", output); |
| 89 | } else { |
| 90 | if (!shouldIgnore(assetPath)) |
| 91 | output.append(std::move(assetPath)); |
| 92 | } |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | } |
nothing calls this directly
no test coverage detected