MayaFlux 0.2.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 41 of file Keys.cpp.

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

References from_char().

+ Here is the call graph for this function: