| 197 | } |
| 198 | |
| 199 | std::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 | |
| 217 | std::filesystem::path donut::app::FindMediaFolder(const std::filesystem::path& name) |
| 218 | { |
nothing calls this directly
no test coverage detected