AUI Framework
master
Cross-platform module-based framework for developing C++20 desktop applications
|
Enum trait to transform enum to name, name to enum, list all enums and vise versa. More...
Enum trait to transform enum to name, name to enum, list all enums and vise versa.
Classes | |
struct | Values |
Static Public Member Functions | |
template<enum_t value> | |
static AString | valueName () |
Maps compile-time specified enum value to name. More... | |
static const AMap< AString, enum_t > & | nameToValueMap () |
Get runtime name to enum value mapping. More... | |
static const AMap< enum_t, AString, enum_less > & | valueToNameMap () |
Map runtime enum value to name. | |
static enum_t | byName (const AString &name) |
Map runtime name to enum value. Transforms name to uppercase as a fallback. Throws an exception if no such value. | |
static const AString & | toName (enum_t value) |
Map runtime enum value to name. Throws an exception if no such value. | |
|
static |
Get runtime name to enum value mapping.
|
inlinestatic |
Maps compile-time specified enum value to name.
Use names()[enumValue] for mapping runtime values.
This function's behaviour can be reimplemented by aui::enumerate::ValueToName trait.
#include <AUI/Reflect/AEnumerate.h>