| 438 | } |
| 439 | |
| 440 | U32 Fs::iterateAllNativeFiles(const BString& path, bool recursive, bool includeDirs, std::function<U32(BString, bool isDir)> f) { |
| 441 | std::vector<Platform::ListNodeResult> results; |
| 442 | Platform::listNodes(path, results); |
| 443 | for (auto& n : results) { |
| 444 | if (recursive && n.isDirectory) { |
| 445 | U32 result = iterateAllNativeFiles(path.stringByApppendingPath(n.name), true, includeDirs, f); |
| 446 | if (result) { |
| 447 | return result; |
| 448 | } |
| 449 | } |
| 450 | if (!includeDirs && n.isDirectory) { |
| 451 | continue; |
| 452 | } |
| 453 | U32 result = f(path.stringByApppendingPath(n.name), n.isDirectory); |
| 454 | if (result) { |
| 455 | return result; |
| 456 | } |
| 457 | } |
| 458 | return 0; |
| 459 | } |
| 460 | |
| 461 | std::vector<BString> Fs::getFilesInNativeDirectoryWhereFileMatches(const BString& dirPath, const BString& startsWith, const BString& endsWith, bool ignoreCase) { |
| 462 | std::vector<BString> results; |
nothing calls this directly
no test coverage detected