CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
System::EnumValuesBase Class Referenceabstract

A base class for a class that represents meta information of enumeration type. More...

#include <enum.h>

Inherited by System::EnumValues< E, Guard >.

Static Public Member Functions

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

 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

A base class for a class that represents meta information of enumeration type.

Constructor & Destructor Documentation

◆ EnumValuesBase()

System::EnumValuesBase::EnumValuesBase ( const TypeInfo type)
protected

Constructs an instance that represents metainformation for enum of the specified type.

◆ ~EnumValuesBase()

virtual System::EnumValuesBase::~EnumValuesBase ( )
protectedvirtual

Destructor.

Member Function Documentation

◆ GetNames() [1/2]

virtual ArrayPtr< String > System::EnumValuesBase::GetNames ( ) const
protectedpure virtual

Returns an array containing all names of enumeration E.

Implemented in System::EnumValues< E, Guard >.

◆ GetNames() [2/2]

static ArrayPtr< String > System::EnumValuesBase::GetNames ( const TypeInfo type)
static

Retrieves an array of the names of the constants in a specified enumeration.

Parameters
typeAn enumeration type.
Returns
A string array of the names of the constants in enumType.

◆ GetUnderlyingType() [1/2]

virtual const System::TypeInfo & System::EnumValuesBase::GetUnderlyingType ( ) const
protectedpure virtual

Returns the underlying type of the specified enumeration.

Implemented in System::EnumValues< E, Guard >.

◆ GetUnderlyingType() [2/2]

static const System::TypeInfo & System::EnumValuesBase::GetUnderlyingType ( const TypeInfo type)
static

Returns the underlying type of the specified enumeration.

Parameters
typeThe enumeration whose underlying type will be retrieved.
Returns
The underlying type of enumType.

◆ GetValueOf() [1/2]

virtual SharedPtr< Object > System::EnumValuesBase::GetValueOf ( const String str,
bool  ignoreCase 
) const
protectedpure virtual

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.

Implemented in System::EnumValues< E, Guard >.

◆ GetValueOf() [2/2]

virtual SharedPtr< Object > System::EnumValuesBase::GetValueOf ( long  val) const
protectedpure virtual

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.

Implemented in System::EnumValues< E, Guard >.

◆ GetValues() [1/2]

virtual ArrayPtr< int64_t > System::EnumValuesBase::GetValues ( ) const
protectedpure virtual

Returns an array containing all values of enumeration E.

Implemented in System::EnumValues< E, Guard >.

◆ GetValues() [2/2]

static ArrayPtr< int64_t > System::EnumValuesBase::GetValues ( const TypeInfo type)
static

Returns an array containing all values of the specified enumeration type.

Parameters
typeThe TypeInfo object representing the type of the enumeration whose values to return
Returns
An array containing values of all enumeration constants of the enumeration type specified by type.

◆ Parse()

static SharedPtr< Object > System::EnumValuesBase::Parse ( const TypeInfo type,
const String str,
bool  ignoreCase 
)
static

Returns an object that represents a value of enumeration constant of the specified enumeration type with the specified name.

Parameters
typeThe TypeInfo object representing the type of the enumeration value to return
strThe name of the enum constant
ignoreCaseSpecifeis if the case should be ignored when interpreting the name of the enum constant
Returns
An object that represents the value of the enum constant whose name is specified in str.

◆ ToObject() [1/2]

static SharedPtr< Object > System::EnumValuesBase::ToObject ( const TypeInfo type,
const SharedPtr< Object > &  value 
)
static

Converts the specified object with an integer value to an enumeration member.

Parameters
typeThe enumeration type to return.
valueThe value convert to an enumeration member.
Returns
An enumeration object whose value is value.

◆ ToObject() [2/2]

static SharedPtr< Object > System::EnumValuesBase::ToObject ( const TypeInfo type,
uint64_t  value 
)
static

Converts the specified 64-bit unsigned integer value to an enumeration member.

Parameters
typeThe enumeration type to return.
valueThe value to convert to an enumeration member.
Returns
An instance of the enumeration set to value.