MCPcopy Create free account
hub / github.com/NVIDIA-RTX/Donut / FindDirectoryWithFile

Method FindDirectoryWithFile

src/app/ApplicationBase.cpp:199–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197}
198
199std::filesystem::path donut::app::FindDirectoryWithFile(IFileSystem& fs, const std::filesystem::path& startPath, const std::filesystem::path& relativeFilePath, int maxDepth)
200{
201 std::filesystem::path searchPath = "";
202
203 for (int depth = 0; depth < maxDepth; depth++)
204 {
205 std::filesystem::path currentPath = startPath / searchPath / relativeFilePath;
206
207 if (fs.fileExists(currentPath))
208 {
209 return currentPath.parent_path().lexically_normal();
210 }
211
212 searchPath = ".." / searchPath;
213 }
214 return {};
215}
216
217std::filesystem::path donut::app::FindMediaFolder(const std::filesystem::path& name)
218 {

Callers

nothing calls this directly

Calls 1

fileExistsMethod · 0.45

Tested by

no test coverage detected