MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / globFilesInDirectory

Function globFilesInDirectory

Source/Falcor/Core/Platform/OS.cpp:129–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129std::vector<std::filesystem::path> globFilesInDirectory(
130 const std::filesystem::path& path,
131 const std::regex& regexPattern,
132 bool firstMatchOnly
133)
134{
135 std::vector<std::filesystem::path> result;
136 if (!std::filesystem::exists(path))
137 return result;
138 for (const auto& entry : std::filesystem::directory_iterator(path))
139 {
140 if (!entry.is_regular_file())
141 continue;
142 std::string filename = entry.path().filename().string();
143 if (std::regex_match(filename, regexPattern))
144 {
145 result.push_back(entry.path());
146 if (firstMatchOnly)
147 return result;
148 }
149 }
150
151 return result;
152}
153
154std::vector<std::filesystem::path> globFilesInDirectories(
155 const std::filesystem::path& path,

Callers 3

loadUdimTextureMethod · 0.85
resolvePathPatternMethod · 0.85
globFilesInDirectoriesFunction · 0.85

Calls 4

filenameMethod · 0.80
pathMethod · 0.80
stringMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected