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

◆ resolve_write_path()

std::string MayaFlux::IO::resolve_write_path ( const std::string &  filepath,
std::string_view  default_directory = Config::OUT_DIR 
)
inline

Resolve a writable path against the configured output directory.

Absolute paths are returned unchanged. A bare filename uses the default directory. Relative paths with a parent directory use the project root.

Parameters
filepathPath as supplied by the caller.
default_directoryDestination for a bare filename.
Returns
Resolved path string.

Definition at line 35 of file FileWriter.hpp.

38{
39 namespace fs = std::filesystem;
40 auto normalized = std::string(filepath);
41 std::ranges::replace(normalized, '\\', '/');
42
43 if (fs::path(normalized).is_absolute())
44 return normalized;
45
46 if (!fs::path(normalized).has_parent_path())
47 return (fs::path(default_directory) / normalized).string();
48
49 return (fs::path(Config::project_root()) / normalized).string();
50}

References MayaFlux::Config::project_root().

Referenced by MayaFlux::IO::TextFileWriter::can_write(), MayaFlux::IO::SpatialCache::open(), MayaFlux::IO::DelimitedTextWriter::open(), MayaFlux::IO::FFmpegMuxContext::open(), MayaFlux::IO::TextFileWriter::open(), resolve_sequence_path(), MayaFlux::IO::VDBWriter::write(), MayaFlux::IO::AssimpModelWriter::write(), and MayaFlux::IO::JSONSerializer::write().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: