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

◆ acquire_from_path()

Acquired< LibraryLocation > MayaFlux::Platform::detail::acquire_from_path ( const LibraryFromPath & from)
inline

Definition at line 180 of file Acquisition.hpp.

181 {
182 auto absolute = resolve_absolute(from.path);
183 if (!absolute) {
184 return std::unexpected(absolute.error());
185 }
186 if (!path_exists(*absolute)) {
187 return std::unexpected(make_failure(AcquireFailure::Reason::Missing, from.path.string(), { *absolute }));
188 }
189 if (!path_is_regular_file(*absolute)) {
190 return std::unexpected(make_failure(AcquireFailure::Reason::NotRegularFile, from.path.string(), { *absolute }));
191 }
192 return LibraryLocation { .path = *absolute, .file_name = absolute->filename().string(), .resolved_by_system = false };
193 }
bool path_is_regular_file(const std::filesystem::path &path)
bool path_exists(const std::filesystem::path &path)
std::expected< std::filesystem::path, AcquireFailure > resolve_absolute(const std::filesystem::path &path)
AcquireFailure make_failure(AcquireFailure::Reason reason, std::string request, std::vector< std::filesystem::path > tried={})

References make_failure(), MayaFlux::Platform::AcquireFailure::Missing, MayaFlux::Platform::AcquireFailure::NotRegularFile, MayaFlux::Platform::LibraryFromPath::path, path_exists(), path_is_regular_file(), and resolve_absolute().

Referenced by MayaFlux::Platform::acquire_library().

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