CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
System::EnumValues< E, Guard > Class Template Reference

Provides meta information about enumeration constants of enum type E. More...

#include <enum.h>

Inherits System::EnumValuesBase.

Public Member Functions

 EnumValues ()
 Constructs an instance. More...
 
virtual ~EnumValues ()
 Destructor. More...
 
virtual ArrayPtr< int64_t > GetValues () const override
 Returns an array containing all values of enumeration E. More...
 
virtual ArrayPtr< StringGetNames () const override
 Returns an array containing all names of enumeration E. More...
 
virtual SharedPtr< ObjectGetValueOf (const String &str, bool ignoreCase) const override
 Returns boxed value of the enum constant with the specified name. More...
 
virtual SharedPtr< ObjectGetValueOf (long val) const override
 Returns boxed value of the enum constant with the specified value. More...
 
virtual const System::TypeInfoGetUnderlyingType () const override
 Returns the underlying type of the specified enumeration. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from System::EnumValuesBase
static ArrayPtr< int64_t > GetValues (const TypeInfo &type)
 Returns an array containing all values of the specified enumeration type. More...
 
static ArrayPtr< StringGetNames (const TypeInfo &type)
 Retrieves an array of the names of the constants in a specified enumeration. More...
 
static SharedPtr< ObjectParse (const TypeInfo &type, const String &str, bool ignoreCase)
 Returns an object that represents a value of enumeration constant of the specified enumeration type with the specified name. More...
 
static SharedPtr< ObjectToObject (const TypeInfo &type, uint64_t value)
 Converts the specified 64-bit unsigned integer value to an enumeration member. More...
 
static SharedPtr< ObjectToObject (const TypeInfo &type, const SharedPtr< Object > &value)
 Converts the specified object with an integer value to an enumeration member. More...
 
static const System::TypeInfoGetUnderlyingType (const TypeInfo &type)
 Returns the underlying type of the specified enumeration. More...
 
- Protected Member Functions inherited from System::EnumValuesBase
 EnumValuesBase (const TypeInfo &type)
 Constructs an instance that represents metainformation for enum of the specified type. More...
 
virtual ~EnumValuesBase ()
 Destructor. More...
 
virtual ArrayPtr< int64_t > GetValues () const =0
 Returns an array containing all values of enumeration E. More...
 
virtual ArrayPtr< StringGetNames () const =0
 Returns an array containing all names of enumeration E. More...
 
virtual SharedPtr< ObjectGetValueOf (const String &str, bool ignoreCase) const =0
 Returns boxed value of the enum constant with the specified name. More...
 
virtual SharedPtr< ObjectGetValueOf (long val) const =0
 Returns boxed value of the enum constant with the specified value. More...
 
virtual const System::TypeInfoGetUnderlyingType () const =0
 Returns the underlying type of the specified enumeration. More...
 

Detailed Description

template<typename E, class Guard = typename std::enable_if<std::is_enum<E>::value>::type>
class System::EnumValues< E, Guard >

Provides meta information about enumeration constants of enum type E.

Template Parameters
EThe type of enumeration

Constructor & Destructor Documentation

◆ EnumValues()

template<typename E , class Guard = typename std::enable_if<std::is_enum<E>::value>::type>
System::EnumValues< E, Guard >::EnumValues ( )
inline

Constructs an instance.

◆ ~EnumValues()

template<typename E , class Guard = typename std::enable_if<std::is_enum<E>::value>::type>
virtual System::EnumValues< E, Guard >::~EnumValues ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ GetNames()

template<typename E , class Guard = typename std::enable_if<std::is_enum<E>::value>::type>
virtual ArrayPtr< String > System::EnumValues< E, Guard >::GetNames ( ) const
inlineoverridevirtual

Returns an array containing all names of enumeration E.

Implements System::EnumValuesBase.

◆ GetUnderlyingType()

template<typename E , class Guard = typename std::enable_if<std::is_enum<E>::value>::type>
virtual const System::TypeInfo & System::EnumValues< E, Guard >::GetUnderlyingType ( ) const
inlineoverridevirtual

Returns the underlying type of the specified enumeration.

Implements System::EnumValuesBase.

◆ GetValueOf() [1/2]

template<typename E , class Guard = typename std::enable_if<std::is_enum<E>::value>::type>
virtual SharedPtr< Object > System::EnumValues< E, Guard >::GetValueOf ( const String str,
bool  ignoreCase 
) const
inlineoverridevirtual

Returns boxed value of the enum constant with the specified name.

Parameters
strThe name of the enum constant
ignoreCaseSpecifeis if the case should be ignored when interpreting the name of the enum constant
Returns
A boxed value of the enum constant whose name is specified in str.

Implements System::EnumValuesBase.

◆ GetValueOf() [2/2]

template<typename E , class Guard = typename std::enable_if<std::is_enum<E>::value>::type>
virtual SharedPtr< Object > System::EnumValues< E, Guard >::GetValueOf ( long  val) const
inlineoverridevirtual

Returns boxed value of the enum constant with the specified value.

Parameters
valThe value of the enum constant
Returns
A boxed value of the enum constant whose vakye is specified in str.

Implements System::EnumValuesBase.

◆ GetValues()

template<typename E , class Guard = typename std::enable_if<std::is_enum<E>::value>::type>
virtual ArrayPtr< int64_t > System::EnumValues< E, Guard >::GetValues ( ) const
inlineoverridevirtual

Returns an array containing all values of enumeration E.

Implements System::EnumValuesBase.