| 31 | } |
| 32 | |
| 33 | std::optional<std::filesystem::path> find_first_existing( |
| 34 | const std::filesystem::path & root, |
| 35 | const std::vector<std::string> & relative_candidates) { |
| 36 | for (const auto & candidate : relative_candidates) { |
| 37 | const auto path = root / candidate; |
| 38 | if (is_existing_file(path) || is_existing_directory(path)) { |
| 39 | return std::filesystem::weakly_canonical(path); |
| 40 | } |
| 41 | } |
| 42 | return std::nullopt; |
| 43 | } |
| 44 | |
| 45 | std::vector<std::filesystem::path> collect_existing( |
| 46 | const std::filesystem::path & root, |
nothing calls this directly
no test coverage detected