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

◆ from_string()

MAYAFLUX_API std::optional< Keys > MayaFlux::IO::from_string ( std::string_view  str)
noexcept

Converts a string to the corresponding Keys enum value.

Parameters
strThe string to convert.
Returns
An optional Keys value if the string matches a key, std::nullopt otherwise.

Definition at line 42 of file Keys.cpp.

43{
44 if (str.empty()) {
45 return std::nullopt;
46 }
47
48 if (str.length() == 1) {
49 return from_char(str[0]);
50 }
51
52 return Reflect::string_to_enum_case_insensitive<Keys>(str);
53}

References from_char().

+ Here is the call graph for this function: