MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / visitDir

Method visitDir

Source/Basic/Content.cpp:892–907  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

890}
891
892bool Content::visitDir(String path, const std::function<bool(String, String)>& func) {
893 std::function<bool(String)> visit;
894 visit = [&visit, &func, this](String path) {
895 auto files = getFiles(path);
896 for (const auto& file : files) {
897 if (func(file, path)) return true;
898 }
899 auto dirs = getDirs(path);
900 auto parent = fs::path(path.begin(), path.end());
901 for (const auto& dir : dirs) {
902 if (visit((parent / dir).string())) return true;
903 }
904 return false;
905 };
906 return visit(path);
907}
908
909static std::tuple<std::string, std::string> splitDirectoryAndFilename(const std::string& filePath) {
910 std::string file = filePath;

Callers 1

initMethod · 0.80

Calls 5

pathClass · 0.50
visitFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
stringMethod · 0.45

Tested by

no test coverage detected