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 (xtd::globalization::culture_info &&culture)=default | |
| Initializes a new instance of the xtd::globalization::culture_info class with specified culture. | |
| culture_info (const xtd::globalization::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 (xtd::size culture, bool use_user_override) | |
| Initializes a new instance of the xtd::globalization::culture_info class based on the culture specified by the culture identifier and on a value that specifies whether to use the user-selected culture settings from Windows. | |
| culture_info (const xtd::string &name) | |
| Initializes a new instance of the xtd::globalization::culture_info class based on the culture specified by name. | |
| culture_info (const xtd::string &name, bool use_user_override) | |
| Initializes a new instance of the xtd::globalization::culture_info class based on the culture specified by name and on a value that specifies whether to use the user-selected culture settings from Windows. | |
Public Properties | |
| auto | culture_types () const noexcept -> xtd::globalization::culture_types |
| Gets the culture types that pertain to the current xtd::globalization::culture_info object. | |
| auto | date_time_format () const -> const xtd::globalization::date_time_format_info & |
| Gets or sets a xtd::globalization::date_time_format_info that defines the culturally appropriate format of displaying dates and times. | |
| auto | date_time_format () -> xtd::globalization::date_time_format_info & |
| Gets or sets a xtd::globalization::date_time_format_info that defines the culturally appropriate format of displaying dates and times. | |
| auto | display_name () const noexcept -> const xtd::string & |
| Gets the full localized culture name. | |
| auto | english_name () const noexcept -> const xtd::string & |
| Gets the culture name in the format languagefull [country/regionfull] in English. | |
| auto | is_locale_available () const noexcept -> bool |
| Gets a value indicateing if the std::locale corresponding to this instance is available. | |
| auto | is_read_only () const noexcept -> bool |
| Gets a value indicating whether the current xtd::globalization::culture_info is read-only. | |
| auto | is_neutral_culture () const noexcept -> bool |
| Gets a value indicating whether the current xtd::globalization::culture_info represents a neutral culture. | |
| auto | keyboard_layout_id () const noexcept -> xtd::size |
| Gets the active input locale identifier. | |
| auto | lcid () const noexcept -> xtd::size |
| Gets the culture identifier for the current xtd::globalization::culture_info. | |
| auto | locale () const noexcept -> const std::locale & |
| Gets the std::locale associate for the current xtd::globalization::culture_info. | |
| auto | name () const noexcept -> const xtd::string & |
| Gets the culture name in the format languagecode2-country/regioncode2. | |
| auto | native_name () const noexcept -> const xtd::string & |
| Gets the culture name, consisting of the language, the country/region, and the optional script, that the culture is set to display. | |
| auto | number_format () const -> const xtd::globalization::number_format_info & |
| Gets a xtd::globalization::number_format_info that defines the culturally appropriate format of displaying numbers, currency, and percentage. | |
| auto | number_format () -> xtd::globalization::number_format_info & |
| Gets a xtd::globalization::number_format_info that defines the culturally appropriate format of displaying numbers, currency, and percentage. | |
| virtual auto | parent () const noexcept -> xtd::globalization::culture_info |
| Gets the xtd::globalization::culture_info that represents the parent culture of the current xtd::globalization::culture_info. | |
| auto | three_letter_iso_language_name () const noexcept -> const xtd::string & |
| Gets the ISO 639-2 three-letter code for the language of the current xtd::globalization::culture_info. | |
| auto | three_letter_windows_language_name () const noexcept -> const xtd::string & |
| Gets the three-letter code for the language as defined in the Windows API. | |
| auto | two_letter_iso_language_name () const noexcept -> const xtd::string & |
| Gets the ISO 639-1 two-letter or ISO 639-3 three-letter code for the language of the current xtd::globalization::culture_info. | |
| auto | use_user_override () const noexcept -> bool |
| Gets a value indicating whether the current xtd::globalization::culture_info object uses the user-selected culture settings. | |
Public Methods | |
| auto | clone () const noexcept -> xtd::globalization::culture_info |
| Creates a copy of the current xtd::globalization::culture_info. | |
| auto | equals (const xtd::object &obj) const noexcept -> bool override |
| Determines whether the specified object is equal to the current object. | |
| auto | equals (const xtd::globalization::culture_info &obj) const noexcept -> bool override |
| Indicates whether the current object is equal to another object of the same type. | |
| auto | get_hash_code () const noexcept -> xtd::size override |
| Returns the hash code for this basic_string. | |
| auto | to_string () const noexcept -> xtd::string override |
| Returns a xtd::string that represents the current object. | |
Public Operators | |
| operator const std::locale & () const noexcept | |
| The std::locale operator that convert this xtd::globalization::culture_info in std::locale associate. | |
Public Static Properties | |
| static auto | current_culture () noexcept -> xtd::globalization::culture_info |
| Gets the xtd::globalization::culture_info object that represents the culture used by the current application. | |
| static auto | current_culture (const xtd::globalization::culture_info &value) -> void |
| Sets the xtd::globalization::culture_info object that represents the culture used by the current application. | |
| static auto | invariant_culture () noexcept -> xtd::globalization::culture_info |
| Gets the xtd::globalization::culture_info object that is culture-independent (invariant). | |
Public Static Methods | |
| static auto | get_culture_info (const xtd::string &name) -> xtd::globalization::culture_info |
| Retrieves a cached, read-only instance of a culture using the specified culture name. | |
| static auto | get_culture_info (const xtd::string &name, bool predefined_only) -> xtd::globalization::culture_info |
| Retrieves a cached, read-only instance of a culture. | |
| static auto | get_culture_info (const xtd::string &name, const xtd::string &alt_name) -> xtd::globalization::culture_info |
| Retrieves a cached, read-only instance of a culture. Parameters specify a culture that is initialized with the TextInfo and CompareInfo objects specified by another culture. | |
| static auto | get_culture_info (xtd::size culture) -> xtd::globalization::culture_info |
| Retrieves a cached, read-only instance of a culture by using the specified culture identifier. | |
| static auto | get_cultures (xtd::globalization::culture_types types) -> xtd::array< xtd::globalization::culture_info > |
| Gets the list of supported cultures filtered by the specified xtd::globalization::culture_types parameter. | |
| static auto | get_system_locales () noexcept -> xtd::array< std::locale > |
| Gets the lists of system locales. | |
| static auto | initialize_all_cultures () noexcept -> void |
| Initializes all cultures available in xtd and prevents lazy-loading. | |
Additional Inherited Members | |
| object ()=default | |
| Create a new instance of the ultimate base class object. | |
| 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. |
| xtd::globalization::culture_info::culture_info | ( | xtd::size | culture, |
| bool | use_user_override ) |
Initializes a new instance of the xtd::globalization::culture_info class based on the culture specified by the culture identifier and on a value that specifies whether to use the user-selected culture settings from Windows.
| 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. |
| use_user_override | true to use the user-selected culture settings (Windows only); false to use the default culture settings. |
| xtd::globalization::culture_not_found_exception | culture is not a valid culture identifier. See the Notes to Callers section for more information. |
|
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. |
| xtd::globalization::culture_info::culture_info | ( | const xtd::string & | name, |
| bool | use_user_override ) |
Initializes a new instance of the xtd::globalization::culture_info class based on the culture specified by name and on a value that specifies whether to use the user-selected culture settings from Windows.
| 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. |
| use_user_override | true to use the user-selected culture settings (Windows only); false to use the default culture settings. |
|
noexcept |
Gets the culture types that pertain to the current xtd::globalization::culture_info object.
|
nodiscard |
Gets or sets a xtd::globalization::date_time_format_info that defines the culturally appropriate format of displaying dates and times.
|
nodiscard |
Gets or sets a xtd::globalization::date_time_format_info that defines the culturally appropriate format of displaying dates and times.
|
nodiscardnoexcept |
Gets the full localized culture name.
|
nodiscardnoexcept |
Gets the culture name in the format languagefull [country/regionfull] in English.
|
nodiscardnoexcept |
Gets a value indicateing if the std::locale corresponding to this instance is available.
|
nodiscardnoexcept |
Gets a value indicating whether the current xtd::globalization::culture_info is read-only.
|
nodiscardnoexcept |
Gets a value indicating whether the current xtd::globalization::culture_info represents a neutral culture.
|
nodiscardnoexcept |
Gets the active input locale identifier.
|
nodiscardnoexcept |
Gets the culture identifier for the current xtd::globalization::culture_info.
|
nodiscardnoexcept |
Gets the std::locale associate for the current xtd::globalization::culture_info.
|
nodiscardnoexcept |
Gets the culture name in the format languagecode2-country/regioncode2.
|
nodiscardnoexcept |
Gets the culture name, consisting of the language, the country/region, and the optional script, that the culture is set to display.
|
nodiscard |
Gets a xtd::globalization::number_format_info that defines the culturally appropriate format of displaying numbers, currency, and percentage.
|
nodiscard |
Gets a xtd::globalization::number_format_info that defines the culturally appropriate format of displaying numbers, currency, and percentage.
|
nodiscardvirtualnoexcept |
Gets the xtd::globalization::culture_info that represents the parent culture of the current xtd::globalization::culture_info.
|
nodiscardnoexcept |
Gets the ISO 639-2 three-letter code for the language of the current xtd::globalization::culture_info.
|
nodiscardnoexcept |
Gets the three-letter code for the language as defined in the Windows API.
|
nodiscardnoexcept |
Gets the ISO 639-1 two-letter or ISO 639-3 three-letter code for the language of the current xtd::globalization::culture_info.
|
nodiscardnoexcept |
Gets a value indicating whether the current xtd::globalization::culture_info object uses the user-selected culture settings.
|
staticnodiscardnoexcept |
Gets the xtd::globalization::culture_info object that represents the culture used by the current application.
|
static |
Sets the xtd::globalization::culture_info object that represents the culture used by the current application.
| value | The culture used by the current application. |
|
staticnodiscardnoexcept |
Gets the xtd::globalization::culture_info object that is culture-independent (invariant).
|
nodiscardnoexcept |
Creates a copy of the current xtd::globalization::culture_info.
|
overridevirtualnoexcept |
Determines whether the specified object is equal to the current object.
| obj | The object to compare with the current object. |
Reimplemented from xtd::object.
|
nodiscardoverridevirtualnoexcept |
Indicates whether the current object is equal to another object of the same type.
| obj | An object to compare with this object. |
Implements xtd::iequatable< xtd::globalization::culture_info >.
|
nodiscardoverridevirtualnoexcept |
|
nodiscardoverridevirtualnoexcept |
Returns a xtd::string that represents the current object.
Reimplemented from xtd::object.
|
staticnodiscard |
Retrieves a cached, read-only instance of a culture using the specified culture name.
| xtd::globalization::culture_not_found_exception | `name` specifies a culture that is not supported. See the Notes to Callers section for more information. |
|
staticnodiscard |
Retrieves a cached, read-only instance of a culture.
| name | The name of a culture. name is not case-sensitive. |
| predefined_only | true if requesting to create an instance of a culture that is known by the platform. false if it is ok to retreive a made-up culture even if the platform does not carry data for it. |
|
staticnodiscard |
Retrieves a cached, read-only instance of a culture. Parameters specify a culture that is initialized with the TextInfo and CompareInfo objects specified by another culture.
| name | The name of a culture. name is not case-sensitive. |
| alt_name | The name of a culture that supplies the xtd::globalization::text_info and xtd::globalization::compare_info objects used to initialize name. alt_name is not case-sensitive. |
| xtd::globalization::culture_not_found_exception | `name` or `alt_name` specifies a culture that is not supported. See the Notes to Callers section for more information. |
|
staticnodiscard |
Retrieves a cached, read-only instance of a culture by using the specified culture identifier.
| culture | A locale identifier (LCID). |
| xtd::globalization::culture_not_found_exception | `culture` specifies a culture that is not supported. See the Notes to Caller section for more information. |
|
staticnodiscard |
Gets the list of supported cultures filtered by the specified xtd::globalization::culture_types parameter.
| types | A bitwise combination of the enumeration values that filter the cultures to retrieve. |
| xtd::argument_out_of_rangeexception | types specifies an invalid combination of xtd::globalization::culture_types values. |
|
staticnodiscardnoexcept |
Gets the lists of system locales.
|
staticnoexcept |
Initializes all cultures available in xtd and prevents lazy-loading.
This method preloads all culture-related data (including xtd::globalization::date_time_format_info, xtd::globalization::number_format_info, and xtd::globalization::region_info) for all supported cultures. By calling this method, you avoid lazy-loading of cultures when they are first accessed, which can improve performance in scenarios where multiple cultures are accessed repeatedly, or when deterministic initialization order is required.
|
noexcept |
The std::locale operator that convert this xtd::globalization::culture_info in std::locale associate.