MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ resolve_path()

static std::string MayaFlux::IO::JSONSerializer::resolve_path ( const std::string &  filepath)
inlinestaticprivate

Definition at line 138 of file JSONSerializer.hpp.

139 {
140 namespace fs = std::filesystem;
141 auto normalized = std::string(filepath);
142 std::ranges::replace(normalized, '\\', '/');
143 if (fs::path(normalized).is_absolute())
144 return normalized;
145 if (fs::exists(normalized))
146 return normalized;
147 auto from_cwd = fs::current_path() / normalized;
148 if (fs::exists(from_cwd))
149 return from_cwd.string();
150 auto from_root = fs::path(Config::project_root()) / normalized;
151 if (fs::exists(from_root))
152 return from_root.string();
153 return normalized;
154 }
std::string project_root()