Provides information about a specific culture (called a locale for unmanaged code development). The information includes the names for the culture, the writing system, the calendar used, the sort order of strings, and formatting for dates and numbers.
Public Constructors | |
culture_info () | |
Initializes a new instance of the xtd::globalization::culture_info class. | |
culture_info (culture_info &&culture)=default | |
Initializes a new instance of the xtd::globalization::culture_info class with specified culture. | |
culture_info (const culture_info &culture)=default | |
Initializes a new instance of the xtd::globalization::culture_info class with specified culture. | |
culture_info (const std::locale &locale) | |
Initializes a new instance of the xtd::globalization::culture_info class with specified locale. | |
culture_info (xtd::size culture) | |
Initializes a new instance of the xtd::globalization::culture_info class based on the culture specified by the culture identifier. | |
culture_info (const xtd::string &name) | |
Initializes a new instance of the xtd::globalization::culture_info class based on the culture specified by name. | |
Public Properties | |
xtd::globalization::culture_types | culture_types () const noexcept |
Gets the culture types that pertain to the current xtd::globalization::culture_info object. | |
const xtd::string & | display_name () const noexcept |
const xtd::string & | english_name () const noexcept |
bool | is_locale_available () const noexcept |
xtd::size | keyboard_layout_id () const noexcept |
xtd::size | lcid () const noexcept |
const std::locale & | locale () const noexcept |
const xtd::string & | name () const noexcept |
const xtd::string & | native_name () const noexcept |
Public Methods | |
bool | equals (const object &obj) const noexcept override |
Determines whether the specified object is equal to the current object. | |
bool | equals (const culture_info &obj) const noexcept override |
Indicates whether the current object is equal to another object of the same type. | |
xtd::string | to_string () const noexcept override |
Returns a xtd::string that represents the current object. | |
Public Operators | |
culture_info & | operator= (culture_info &&culture)=default |
culture_info & | operator= (const culture_info &culture)=default |
culture_info & | operator= (std::locale &&locale) |
culture_info & | operator= (const std::locale &locale) |
operator const std::locale & () const noexcept | |
Public Static Properties | |
static culture_info | current_culture () noexcept |
static void | current_culture (const culture_info &value) |
static culture_info | invariant_culture () noexcept |
Public Static Methods | |
static xtd::array< culture_info > | get_cultures (xtd::globalization::culture_types types) noexcept |
Additional Inherited Members | |
object ()=default | |
Create a new instance of the ultimate base class object. | |
virtual xtd::size | get_hash_code () const noexcept |
Serves as a hash function for a particular type. | |
virtual type_object | get_type () const noexcept |
Gets the type of the current instance. | |
template<class object_t> | |
xtd::unique_ptr_object< object_t > | memberwise_clone () const |
Creates a shallow copy of the current object. | |
template<class object_a_t, class object_b_t> | |
static bool | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
Determines whether the specified object instances are considered equal. | |
template<class object_a_t, class object_b_t> | |
static bool | reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
Determines whether the specified object instances are the same instance. | |
xtd::globalization::culture_info::culture_info | ( | ) |
Initializes a new instance of the xtd::globalization::culture_info class.
|
default |
Initializes a new instance of the xtd::globalization::culture_info class with specified culture.
culture | The xtd::globalization::culture_info to inititalise this instance. |
|
default |
Initializes a new instance of the xtd::globalization::culture_info class with specified culture.
culture | The xtd::globalization::culture_info to inititalise this instance. |
xtd::globalization::culture_info::culture_info | ( | const std::locale & | locale | ) |
Initializes a new instance of the xtd::globalization::culture_info class with specified locale.
locale | The std::locale to inititalise this instance. |
|
explicit |
Initializes a new instance of the xtd::globalization::culture_info class based on the culture specified by the culture identifier.
culture | A predefined xtd::globalization::culture_info identifier, xtd::globalization::culture_info::lcid property of an existing xtd::globalization::culture_info object, or Windows-only culture identifier. |
xtd::globalization::culture_not_found_exception | culture is not a valid culture identifier. See the Notes to Callers section for more information. |
culture
parameter is mapped to the corresponding National Language Support (NLS) locale identifier. The value of the culture
parameter becomes the value of the xtd::globalization::culture_info::lcid property of the new xtd::globalization::culture_info. culture_info {0x0401}
(culture name ar-SA), xtd::globalization::culture_info::calendar is set to xtd::globalization::gregorian_calendar (which is the user setting).culture_info {0x041E}
(culture name th-TH), xtd::globalization::culture_info::calendar is set to xtd::globalization::thai_buddhist_calendar (which is the default calendar for th-TH). 0x0004
or 0x7c04
will have a xtd::globalization::culture_info::name property of zh-CHS
or zh-CHT
, respectively. You should instead prefer to construct the culture using the current standard culture names of zh-Hans
or zh-Hant
, unless you have a reason for using the older names.
|
explicit |
Initializes a new instance of the xtd::globalization::culture_info class based on the culture specified by name.
name | A predefined xtd::globalization::culture_info name, xtd::globalization::culture_info::name of an existing xtd::globalization::culture_info, or Windows-only culture name. name is not case-sensitive. |
name
is xtd::string::empty_string, the constructor creates an instance of the invariant culture; this is equivalent to retrieving the value of the xtd::globalization::culture_info::invariant_culture property. culture_info {0x0401}
(culture name ar-SA), xtd::globalization::culture_info::calendar is set to xtd::globalization::gregorian_calendar (which is the user setting).culture_info {0x041E}
(culture name th-TH), xtd::globalization::culture_info::calendar is set to xtd::globalization::thai_buddhist_calendar (which is the default calendar for th-TH).
|
noexcept |
Gets the culture types that pertain to the current xtd::globalization::culture_info object.
|
overridevirtualnoexcept |
Determines whether the specified object is equal to the current object.
obj | The object to compare with the current object. |
true
if the specified object is equal to the current object. otherwise, false
. Reimplemented from xtd::object.
|
overridevirtualnoexcept |
Indicates whether the current object is equal to another object of the same type.
obj | An object to compare with this object. |
true
if the current object is equal to the other parameter; otherwise, false
. Implements xtd::iequatable< xtd::globalization::culture_info >.
|
overridevirtualnoexcept |
Returns a xtd::string that represents the current object.
Reimplemented from xtd::object.