MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / find_first_existing

Function find_first_existing

src/framework/io/filesystem.cpp:33–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33std::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
45std::vector<std::filesystem::path> collect_existing(
46 const std::filesystem::path & root,

Callers

nothing calls this directly

Calls 2

is_existing_fileFunction · 0.85
is_existing_directoryFunction · 0.85

Tested by

no test coverage detected