Retrieves an array of the xtd::enum_collection<enum_t> of the constants in a specified enumeration. /
/ /
/ / - Returns
- A xtd::string array of the values and names of the constants in enumType. template<class enum_t> static const xtd::enum_collection<enum_t>& get_entries() noexcept { return enum_object<enum_t>().entries(); }
/ Retrieves an array of the xtd::enum_collection<xtd::byte> of the constants in a specified enumeration. / - Returns
- A xtd::string array of the values and names of the constants in enumType. template<class enum_t> static xtd::enum_collection<xtd::byte> get_entries_as_byte() noexcept { xtd::enum_collection<xtd::byte> entries; std::for_each(enum_object<enum_t>().entries().begin(), enum_object<enum_t>().entries().end(), [&](auto entry) {entries.emplace_back(enum_object<enum_t>(entry.first).to_byte(), entry.second);}); return entries; }
/ Retrieves an array of the xtd::enum_collection<int16> of the constants in a specified enumeration. / - Returns
- A xtd::string array of the values and names of the constants in enumType. template<class enum_t> static xtd::enum_collection<int16> get_entries_as_int16() noexcept { xtd::enum_collection<int16> entries; std::for_each(enum_object<enum_t>().entries().begin(), enum_object<enum_t>().entries().end(), [&](auto entry) {entries.emplace_back(enum_object<enum_t>(entry.first).to_int16(), entry.second);}); return entries; }
/ Retrieves an array of the xtd::enum_collection<int32> of the constants in a specified enumeration. / - Returns
- A xtd::string array of the values and names of the constants in enumType. template<class enum_t> static xtd::enum_collection<int32> get_entries_as_int32() noexcept { xtd::enum_collection<int32> entries; std::for_each(enum_object<enum_t>().entries().begin(), enum_object<enum_t>().entries().end(), [&](auto entry) {entries.emplace_back(enum_object<enum_t>(entry.first).to_int32(), entry.second);}); return entries; }
/ Retrieves an array of the xtd::enum_collection<int64> of the constants in a specified enumeration. / - Returns
- A xtd::string array of the values and names of the constants in enumType. template<class enum_t> static xtd::enum_collection<int64> get_entries_as_int64() noexcept { xtd::enum_collection<int64> entries; std::for_each(enum_object<enum_t>().entries().begin(), enum_object<enum_t>().entries().end(), [&](auto entry) {entries.emplace_back(enum_object<enum_t>(entry.first).to_int64(), entry.second);}); return entries; }
/ Retrieves an array of the xtd::enum_collection<sbyte> of the constants in a specified enumeration. / - Returns
- A xtd::string array of the values and names of the constants in enumType. template<class enum_t> static xtd::enum_collection<sbyte> get_entries_as_sbyte() noexcept { xtd::enum_collection<sbyte> entries; std::for_each(enum_object<enum_t>().entries().begin(), enum_object<enum_t>().entries().end(), [&](auto entry) {entries.emplace_back(enum_object<enum_t>(entry.first).to_sbyte(), entry.second);}); return entries; }
/ Retrieves an array of the xtd::enum_collection<uint16> of the constants in a specified enumeration. / - Returns
- A xtd::string array of the values and names of the constants in enumType. template<class enum_t> static xtd::enum_collection<uint16> get_entries_as_uint16() noexcept { xtd::enum_collection<uint16> entries; std::for_each(enum_object<enum_t>().entries().begin(), enum_object<enum_t>().entries().end(), [&](auto entry) {entries.emplace_back(enum_object<enum_t>(entry.first).to_uint16(), entry.second);}); return entries; }
/ Retrieves an array of the xtd::enum_collection<uint32> of the constants in a specified enumeration. / - Returns
- A xtd::string array of the values and names of the constants in enumType. template<class enum_t> static xtd::enum_collection<uint32> get_entries_as_uint32() noexcept { xtd::enum_collection<uint32> entries; std::for_each(enum_object<enum_t>().entries().begin(), enum_object<enum_t>().entries().end(), [&](auto entry) {entries.emplace_back(enum_object<enum_t>(entry.first).to_uint32(), entry.second);}); return entries; }
/ Retrieves an array of the xtd::enum_collection<uint64> of the constants in a specified enumeration. / - Returns
- A xtd::string array of the values and names of the constants in enumType. template<class enum_t> static xtd::enum_collection<uint64> get_entries_as_uint64() noexcept { xtd::enum_collection<uint64> entries; std::for_each(enum_object<enum_t>().entries().begin(), enum_object<enum_t>().entries().end(), [&](auto entry) {entries.emplace_back(enum_object<enum_t>(entry.first).to_uint64(), entry.second);}); return entries; }
/ Retrieves the name of the constant in the specified enumeration that has the specified value. / - Parameters
-
value | The value of a particular enumerated constant in terms of its underlying type. / |
- Returns
- A xtd::string containing the name of the enumerated constant in enumType whose value is value; or the value int32 to xtd::string if no such constant is found. /
- Exceptions
-
xtd::argument_exception | The value is ! a value of enumType. template<class enum_t> static xtd::string get_name(enum_t value) noexcept {return enum_object<enum_t>(value).to_string();} / Retrieves the name of the constant in the specified enumeration that has the specified value. / |
- Parameters
-
value | The value of a particular enumerated constant in terms of its underlying type. / |
- Returns
- xtd::string A xtd::string containing the name of the enumerated constant in enumType whose value is value; or the value int32 to xtd::string if no such constant is found. /
- Exceptions
-
xtd::argument_exception | The value is ! a value of enumType. template<class enum_t> static xtd::string get_name(enum_object<enum_t> value) noexcept {return enum_object<enum_t>(value).to_string();} / Retrieves the name of the constant in the specified enumeration that has the specified value. / |
- Parameters
-
value | The value of a particular enumerated constant in terms of its underlying type. / |
- Returns
- xtd::string A xtd::string containing the name of the enumerated constant in enumType whose value is value; or the value int32 to xtd::string if no such constant is found. /
- Exceptions
-
xtd::argument_exception | The value is ! a value of enumType. template<class enum_t> static xtd::string get_name(int32 value) noexcept {return enum_object<enum_t>(value).to_string();} / Retrieves the name of the constant in the specified enumeration that has the specified value. / |
- Parameters
-
value | The value of a particular enumerated constant in terms of its underlying type. / |
- Returns
- A xtd::string containing the name of the enumerated constant in enumType whose value is value; or the value int32 to xtd::string if no such constant is found. /
- Exceptions
-
/ Retrieves an array of the names of the constants in a specified enumeration. / - Returns
- A xtd::string array of the names of the constants in enumType. /
- Exceptions
-
/ Retrieves an array of the values of the constants in a specified enumeration. / - Returns
- Array<enum_t> An array that contains the values of the constants in enumType. /
- Exceptions
-
/ Retrieves an array of the values of the constants in a specified enumeration. / - Returns
- Array<xtd::byte> An array that contains the values of the constants in enumType. /
- Exceptions
-
/ Retrieves an array of the values of the constants in a specified enumeration. / - Returns
- Array<int16> An array that contains the values of the constants in enumType. /
- Exceptions
-
/ Retrieves an array of the values of the constants in a specified enumeration. / - Returns
- Array<int32> An array that contains the values of the constants in enumType. /
- Exceptions
-
/ Retrieves an array of the values of the constants in a specified enumeration. / - Returns
- Array<int64> An array that contains the values of the constants in enumType. /
- Exceptions
-
/ Retrieves an array of the values of the constants in a specified enumeration. / - Returns
- Array<sbyte> An array that contains the values of the constants in enumType. /
- Exceptions
-
/ Retrieves an array of the values of the constants in a specified enumeration. / - Returns
- Array<uint16> An array that contains the values of the constants in enumType. /
- Exceptions
-
/ Retrieves an array of the values of the constants in a specified enumeration. / - Returns
- Array<uint32> An array that contains the values of the constants in enumType. /
- Exceptions
-
/ Retrieves an array of the values of the constants in a specified enumeration. / - Returns
- Array<uint64> An array that contains the values of the constants in enumType. /
- Exceptions
-
/ Returns an indication whether a constant with a specified value exists in a specified enumeration. / - Parameters
-
fromValue | An enumeration value. / |
- Returns
true if a constant in enumType has a value equal to value; otherwise, false . /
- Exceptions
-
- Parameters
-
fromValue | An enumeration value. / |
- Returns
true if a constant in enumType has a value equal to value; otherwise, false . /
- Exceptions
-
/ Converts the xtd::string representation of the name or numeric value of one or more enumerated constants to an equivalent enumerated object. / - Parameters
-
value | An A xtd::string containing the name or value to convert. / |
- Returns
- enum_object An enum whose value is represented by value. /
- Exceptions
-
- Parameters
-
str | An A xtd::string containing the name or value to convert. / |
ignore_case | true to Ignore case; false to regard case. / |
- Returns
- enum_object An enum whose value is represented by value. /
- Exceptions
-
xtd::argument_exception | The value is ! a value of enumType. template<class enum_t> static enum_t parse(const xtd::string& str, bool ignore_case) { return enum_object<enum_t>::parse(str, ignore_case); } |
/ Converts this instance to byte. / - Returns
- A new xtd::byte object converted from this instance. /
- Parameters
-
value | The value to convert. template<class enum_t> static xtd::byte to_byte(enum_t value) noexcept {return enum_object<enum_t>(value).to_byte();} |
/ Converts this instance to int16. / - Parameters
-
value | The value to convert. / |
- Returns
- A new to_int16 object converted from this instance. template<class enum_t> static int16 to_int16(enum_t value) noexcept {return enum_object<enum_t>(value).to_int16();}
/ Converts this instance to int32. / - Parameters
-
value | The value to convert. / |
- Returns
- A new to_int32 object converted from this instance. template<class enum_t> static int32 to_int32(enum_t value) noexcept {return enum_object<enum_t>(value).to_int32();}
/ Converts this instance to int64. / - Parameters
-
value | The value to convert. / |
- Returns
- A new to_int64 object converted from this instance. template<class enum_t> static int64 to_int64(enum_t value) noexcept {return enum_object<enum_t>(value).to_int64();}
/ Converts this instance to signed byte. / - Parameters
-
value | The value to convert. / |
- Returns
- A new sbyte object converted from this instance. template<class enum_t> static sbyte to_sbyte(enum_t value) noexcept {return enum_object<enum_t>(value).to_sbyte();}
/ Converts this instance to string. / - Parameters
-
value | The value to convert. / |
- Returns
- A new xtd::string converted from this instance. template<class enum_t> static xtd::string to_string(enum_t value) noexcept {return enum_object<enum_t>(value).to_string();}
/ Converts this instance to unsigned int16. / - Parameters
-
value | The value to convert. / |
- Returns
- A new to_uint16 object converted from this instance. template<class enum_t> static uint16 to_uint16(enum_t value) noexcept {return enum_object<enum_t>(value).to_uint16();}
/ Converts this instance to unsigned int32. / - Parameters
-
value | The value to convert. / |
- Returns
- A new to_uint32 object converted from this instance. template<class enum_t> static uint32 to_uint32(enum_t value) noexcept {return enum_object<enum_t>(value).to_uint32();}
/ Converts this instance to unsigned int64. / - Parameters
-
value | The value to convert. / |
- Returns
- A new to_uint64 object converted from this instance. template<class enum_t> static uint64 to_uint64(enum_t value) noexcept {return enum_object<enum_t>(value).to_uint64();}
/ Converts the xtd::string representation of the name or numeric value of one or more enumerated constants to an equivalent enumerated object. The return value indicates whether the conversion succeeded. / - Parameters
-
vaue | The xtd::string representation of the enumeration name or underlying value to convert. / |
reslt | When this method returns, result contains an object of type TEnum whose value is represented by value if the parse operation succeeds. If the parse operation fails, result contains the default value of the underlying type of TEnum. Note that this value need ! be a member of the TEnum enumeration. This parameter is passed uninitialized. / |
- Returns
true if the value parameter was converted successfully; otherwise, false . template<class enum_t> static bool try_parse(const xtd::string& value, enum_t& result) noexcept {return try_parse<enum_t>(value, false, result);}
/ Converts the xtd::string representation of the name or numeric value of one or more enumerated constants to an equivalent enumerated object. A parameter specifies whether the operation is case-sensitive. The return value indicates whether the conversion succeeded. / - Parameters
-
vaue | The xtd::string representation of the enumeration name or underlying value to convert. / |
ignore_case | true to Ignore case; false to regard case. / |
reslt | When this method returns, result contains an object of type TEnum whose value is represented by value if the parse operation succeeds. If the parse operation fails, result contains the default value of the underlying type of TEnum. Note that this value need ! be a member of the TEnum enumeration. This parameter is passed uninitialized. / |
- Returns
true if the value parameter was converted successfully; otherwise, false .
|