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

◆ check_file_name()

std::optional< AcquireFailure > MayaFlux::Platform::detail::check_file_name ( std::string_view name)
inline

Definition at line 121 of file Acquisition.hpp.

122 {
123 if (name.empty()) {
125 }
126 const bool unsafe = name == "." || name == ".." || !is_single_component(name)
127 || has_control_character(name)
128#if defined(MAYAFLUX_PLATFORM_WINDOWS)
129 || name.find(':') != std::string_view::npos
130#endif
131 ;
132 if (unsafe) {
133 return make_failure(AcquireFailure::Reason::InvalidName, std::string(name));
134 }
135 return std::nullopt;
136 }
bool is_single_component(std::string_view name)
AcquireFailure make_failure(AcquireFailure::Reason reason, std::string request, std::vector< std::filesystem::path > tried={})
bool has_control_character(std::string_view name)

References MayaFlux::Platform::AcquireFailure::EmptyRequest, has_control_character(), MayaFlux::Platform::AcquireFailure::InvalidName, is_single_component(), and make_failure().

Referenced by acquire_from_directories(), acquire_from_prefix(), acquire_from_system(), and resolve_socket_path().

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