Provides methods that perform some operations on values of enum type. This is a static type with no instance services. You should never create instances of it by any means.
More...
|
static const System::TypeInfo & | GetUnderlyingType () |
| Returns the underlying type of the enumeration. More...
|
|
static bool | HasFlag (E value, E mask) |
| Determines if the specified bits are set in a bitary representation of the specified enum value. More...
|
|
static bool | IsDefined (E value) |
| Determines whether the specified value is a member of enumeration type E . More...
|
|
template<class T > |
static std::enable_if< std::is_convertible< T, UnderlyingType >::value, bool >::type | IsDefined (T value) |
| Determines whether the specified value is a member of enumeration type T . More...
|
|
static bool | IsDefined (const String &name) |
| Determines if the value with the specified name is among members of enum E . More...
|
|
template<class T > |
static std::enable_if< std::is_same< T, E >::value||std::is_convertible< T, UnderlyingType >::value, String >::type | GetName (T value) |
| Returns the name of the enumeration constant that has the specified value. More...
|
|
template<class T > |
static std::enable_if< std::is_same< T, E >::value||std::is_convertible< T, UnderlyingType >::value, String >::type | GetDescription (T value) |
| Returns the name of the enumeration constant that has the specified value. More...
|
|
static E | Parse (const String &str, bool ignoreCase=false) |
| Converts the specfied string into equivalent enum constant. More...
|
|
static bool | TryParse (const String &str, E &result) |
| Tries to convert the specified string into equivalent enum constant. More...
|
|
static bool | TryParse (const String &str, bool ignoreCase, E &result) |
| Tries to convert the specified string into equivalent enum constant. More...
|
|
static ArrayPtr< E > | GetValues () |
| Returns an array containing all members of enumeration E . More...
|
|
static ArrayPtr< String > | GetNames () |
| Returns an array containing names of all members of enumeration E . More...
|
|
template<typename T , typename _ = typename std::enable_if<std::is_arithmetic<T>::value || std::is_enum<T>::value>::type> |
static int | Compare (E a, T b) |
| Performs the arithmetic comparison of the values of the specified enumeration constants. More...
|
|
template<class E, class Guard = typename std::enable_if<std::is_enum<E>::value>::type>
struct System::Enum< E, Guard >
Provides methods that perform some operations on values of enum type. This is a static type with no instance services. You should never create instances of it by any means.
- Template Parameters
-
E | The type of enum on values of which the class handles |
Guard | Service type argument whose purpose is to ensure that E is enumerable type |
template<class E , class Guard = typename std::enable_if<std::is_enum<E>::value>::type>
template<typename T , typename _ = typename std::enable_if<std::is_arithmetic<T>::value || std::is_enum<T>::value>::type>
Performs the arithmetic comparison of the values of the specified enumeration constants.
- Parameters
-
a | The first comparand |
b | The second comparand |
- Returns
- -1 if
a
is less than b
; 0 if the values are equal; 1 if a
is greater than b