MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / iterateAllNativeFiles

Method iterateAllNativeFiles

source/io/fs.cpp:440–459  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

438}
439
440U32 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
461std::vector<BString> Fs::getFilesInNativeDirectoryWhereFileMatches(const BString& dirPath, const BString& startsWith, const BString& endsWith, bool ignoreCase) {
462 std::vector<BString> results;

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected