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

◆ add_include_root()

MAYAFLUX_HOST_API Result< std::filesystem::path > MayaFlux::Host::add_include_root ( const std::filesystem::path & directory,
std::string_view marker_file = {} )

Add a directory to the JIT include search path.

The directory is checked at call time and only that directory is looked at. Include paths cannot change a session that has started, so after start_session this is refused.

Parameters
directoryDirectory to add, absolute or relative to the working directory.
marker_filePlain file name that must exist inside directory, or empty for none.
Returns
The absolute directory, or the reason it was refused.

Definition at line 30 of file Dependencies.cpp.

33{
34 auto root = Platform::acquire_header_root(directory, marker_file);
35 if (!root) {
36 return std::unexpected(detail::to_failure(root.error()));
37 }
38
39 auto added = detail::apply_or_stage(detail::Stage::IncludePath, root->string());
40 if (!added) {
41 return std::unexpected(std::move(added.error()));
42 }
43 return *root;
44}
Failure to_failure(const Platform::AcquireFailure &failure)
Definition Session.cpp:165
Result< void > apply_or_stage(Stage stage, std::string value)
Apply an item to the running session, or stage it until start_session.
Definition Session.cpp:129
Acquired< std::filesystem::path > acquire_header_root(const std::filesystem::path &directory, std::string_view marker_file={})
Validate a header root: an existing directory, optionally containing a marker file.

References MayaFlux::Platform::acquire_header_root(), MayaFlux::Host::detail::apply_or_stage(), MayaFlux::Host::detail::IncludePath, and MayaFlux::Host::detail::to_failure().

Here is the call graph for this function: