Mirror reflection library 0.5.13
|
A monostate utility class that allows to get enumerated value by its name. More...
#include <mirror/utils/enum_val_by_name.hpp>
Static Public Member Functions | |
static bool | has (const std::string &name) |
Checks if the enumeration has a value with the given name. | |
static Enum | get (const std::string &name) |
Gets the enumerated value by name. | |
static std::pair< bool, Enum > | get_opt (const std::string &name) |
Gets a pair of bool and Enum value by name. |
A monostate utility class that allows to get enumerated value by its name.
static Enum mirror::enum_value_by_name< Enum >::get | ( | const std::string & | name | ) | [inline, static] |
Gets the enumerated value by name.
The name must be a valid name of one of the values, otherwise this function will assert. To check if the name exists use the has() member function
static std::pair<bool, Enum> mirror::enum_value_by_name< Enum >::get_opt | ( | const std::string & | name | ) | [inline, static] |