|
|
static const dict_t & | getDict () |
| |
|
static const std::string & | str (const E &value) |
| | Convenience.
|
| |
| static bool | setValue (const std::string &key, E &value) |
| | Assign string values to an enumeration type.
|
| |
| static E | getValue (const E &value, bool lenient=true) |
| | Convenience for object.set(...) like commands.
|
| |
| static E | getValue (const std::string &key, bool lenient=true) |
| | Convenience for object.set(...) like commands.
|
| |
| static E | getValue (const char *key, bool lenient=true) |
| | Convenience for object.set(...) like commands.
|
| |
| static const std::string & | getKey (const std::string &s, bool lenient=true) |
| | Convenience for object.set(...) like commands.
|
| |
|
static const char * | getKey (const char *s, bool lenient=true) |
| |
|
static const std::string & | getKey (const E &value, bool lenient=true) |
| |
| static void | convert (const E &value, std::string &s) |
| | Experimental. Convenience for object.set(...) like commands.
|
| |
|
static void | convert (const std::string &s, E &value) |
| |
template<class E, class OWNER = E>
struct drain::Enum< E, OWNER >
A container for a static dictionary of enumeration values.
DrainCore
- Template Parameters
-
| E | - enumeration or integer type |
| OWNER | - identifier type (separate type, typically a class, can be used if several dictionaries needed for the same enumeration type) |
Template is needed to create a unique, shared (static) dict object for each template.
template<class E , class OWNER = E>
| static void convert |
( |
const E & |
value, |
|
|
std::string & |
s |
|
) |
| |
|
inlinestatic |
Experimental. Convenience for object.set(...) like commands.
\param lenient - when value not found, only return empty, do not throw exception.
\return enum value of the key
static inline const std::string & getKey(const std::string & value, bool lenient=true){ return value; }
template<class E , class OWNER = E>
| static const std::string & getKey |
( |
const std::string & |
s, |
|
|
bool |
lenient = true |
|
) |
| |
|
inlinestatic |
Convenience for object.set(...) like commands.
\return enum value of the key
Note: cannot return (const E &) as storage type is (long) int.
static inline E getKey(const E & value, bool lenient=true){ return value; } Experimental. Convenience for object.set(...) like commands.
- Parameters
-
| lenient | - when key not found, only return empty, do not throw exception. |
- Returns
- enum value of the key