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 (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 | |
| xtd::globalization::culture_types | culture_types () const noexcept |
| Gets the culture types that pertain to the current xtd::globalization::culture_info object. | |
| const xtd::globalization::date_time_format_info & | date_time_format () const |
| Gets or sets a xtd::globalization::date_time_format_info that defines the culturally appropriate format of displaying dates and times. | |
| xtd::globalization::date_time_format_info & | date_time_format () |
| Gets or sets a xtd::globalization::date_time_format_info that defines the culturally appropriate format of displaying dates and times. | |
| const xtd::string & | display_name () const noexcept |
| Gets the full localized culture name. | |
| const xtd::string & | english_name () const noexcept |
| Gets the culture name in the format languagefull [country/regionfull] in English. | |
| bool | is_locale_available () const noexcept |
| Gets a value indicateing if the std::locale corresponding to this instance is available. | |
| bool | is_read_only () const noexcept |
| Gets a value indicating whether the current xtd::globalization::culture_info is read-only. | |
| bool | is_neutral_culture () const noexcept |
| Gets a value indicating whether the current xtd::globalization::culture_info represents a neutral culture. | |
| xtd::size | keyboard_layout_id () const noexcept |
| Gets the active input locale identifier. | |
| xtd::size | lcid () const noexcept |
| Gets the culture identifier for the current xtd::globalization::culture_info. | |
| const std::locale & | locale () const noexcept |
| Gets the std::locale associate for the current xtd::globalization::culture_info. | |
| const xtd::string & | name () const noexcept |
| Gets the culture name in the format languagecode2-country/regioncode2. | |
| const xtd::string & | native_name () const noexcept |
| Gets the culture name, consisting of the language, the country/region, and the optional script, that the culture is set to display. | |
| const xtd::globalization::number_format_info & | number_format () const |
| xtd::globalization::number_format_info & | number_format () |
| virtual xtd::globalization::culture_info | parent () const noexcept |
| Gets the xtd::globalization::culture_info that represents the parent culture of the current xtd::globalization::culture_info. | |
| const xtd::string & | three_letter_iso_language_name () const noexcept |
| Gets the ISO 639-2 three-letter code for the language of the current xtd::globalization::culture_info. | |
| const xtd::string & | three_letter_windows_language_name () const noexcept |
| Gets the three-letter code for the language as defined in the Windows API. | |
| const xtd::string & | two_letter_iso_language_name () const noexcept |
| Gets the ISO 639-1 two-letter or ISO 639-3 three-letter code for the language of the current xtd::globalization::culture_info. | |
| bool | use_user_override () const noexcept |
| Gets a value indicating whether the current xtd::globalization::culture_info object uses the user-selected culture settings. | |
Public Methods | |
| culture_info | clone () const noexcept |
| Creates a copy of the current xtd::globalization::culture_info. | |
| 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::size | get_hash_code () const noexcept override |
| Returns the hash code for this basic_string. | |
| xtd::string | to_string () const noexcept 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 culture_info | current_culture () noexcept |
| Gets the xtd::globalization::culture_info object that represents the culture used by the current application. | |
| static void | current_culture (const culture_info &value) |
| Sets the xtd::globalization::culture_info object that represents the culture used by the current application. | |
| static culture_info | invariant_culture () noexcept |
| Gets the xtd::globalization::culture_info object that is culture-independent (invariant). | |
Public Static Methods | |
| static culture_info | get_culture_info (const xtd::string &name) |
| Retrieves a cached, read-only instance of a culture using the specified culture name. | |
| static culture_info | get_culture_info (const xtd::string &name, bool predefined_only) |
| Retrieves a cached, read-only instance of a culture. | |
| static culture_info | get_culture_info (const xtd::string &name, const xtd::string &alt_name) |
| 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 culture_info | get_culture_info (xtd::size culture) |
| Retrieves a cached, read-only instance of a culture by using the specified culture identifier. | |
| static xtd::array< culture_info > | get_cultures (xtd::globalization::culture_types types) |
| Gets the list of supported cultures filtered by the specified xtd::globalization::culture_types parameter. | |
| static xtd::array< std::locale > | get_system_locales () noexcept |
| Gets the lists of system locales. | |
| static void | initialize_all_cultures () noexcept |
| 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. |
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. | 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. |
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). | 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. |
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.
| const xtd::globalization::date_time_format_info & xtd::globalization::culture_info::date_time_format | ( | ) | const |
Gets or sets a xtd::globalization::date_time_format_info that defines the culturally appropriate format of displaying dates and times.
| xtd::globalization::date_time_format_info & xtd::globalization::culture_info::date_time_format | ( | ) |
Gets or sets a xtd::globalization::date_time_format_info that defines the culturally appropriate format of displaying dates and times.
|
noexcept |
Gets the full localized culture name.
|
noexcept |
Gets the culture name in the format languagefull [country/regionfull] in English.
|
noexcept |
Gets a value indicateing if the std::locale corresponding to this instance is available.
true if the std::locale is available; otherwise false. true, the xtd::globalization::culture_info::locale property returns a valid std::locale with name corresponding to the current xtd::globalization::culture_info; otherwise a generic std::locale with name equal to "C".
|
noexcept |
Gets a value indicating whether the current xtd::globalization::culture_info is read-only.
true if the current xtd::globalization::culture_info is read-only; otherwise, false. The default is false.
|
noexcept |
Gets a value indicating whether the current xtd::globalization::culture_info represents a neutral culture.
true if the current xtd::globalization::culture_info represents a neutral culture; otherwise, false.
|
noexcept |
Gets the active input locale identifier.
|
noexcept |
Gets the culture identifier for the current xtd::globalization::culture_info.
|
noexcept |
Gets the std::locale associate for the current xtd::globalization::culture_info.
true, the xtd::globalization::culture_info::locale property returns a valid std::locale with name corresponding to this instance otherwise a generic std::locale with name equal to "C".
|
noexcept |
Gets the culture name in the format languagecode2-country/regioncode2.
|
noexcept |
Gets the culture name, consisting of the language, the country/region, and the optional script, that the culture is set to display.
|
virtualnoexcept |
Gets the xtd::globalization::culture_info that represents the parent culture of the current xtd::globalization::culture_info.
|
noexcept |
Gets the ISO 639-2 three-letter code for the language of the current xtd::globalization::culture_info.
|
noexcept |
Gets the three-letter code for the language as defined in the Windows API.
|
noexcept |
Gets the ISO 639-1 two-letter or ISO 639-3 three-letter code for the language of the current xtd::globalization::culture_info.
|
noexcept |
Gets a value indicating whether the current xtd::globalization::culture_info object uses the user-selected culture settings.
true if the current xtd::globalization::culture_info uses the user-selected culture settings; otherwise, false.
|
staticnoexcept |
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. |
|
staticnoexcept |
Gets the xtd::globalization::culture_info object that is culture-independent (invariant).
|
noexcept |
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. |
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 |
|
overridevirtualnoexcept |
Returns a xtd::string that represents the current object.
Reimplemented from xtd::object.
|
static |
Retrieves a cached, read-only instance of a culture using the specified culture name.
| name | The name of a culture. name is not case-sensitive. |
| xtd::globalization::culture_not_found_exception | `name` specifies a culture that is not supported. See the Notes to Callers section for more information. |
Language tag column in the list of language/region names supported by xtd. Culture names follow the standard defined by BCP 47. name is the name of the current culture, the returned xtd::globalization::culture_info object does not reflect any user overrides. This makes the method suitable for server applications or tools that do not have a real user account on the system and that need to load multiple cultures efficiently. name is xtd::string::empty_string, the method returns the invariant culture. This is equivalent to retrieving the value of the xtd::globalization::culture_info::invariant_culture property. name is not a valid culture name.
|
static |
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. |
predefined_only to true will ensure a culture is created only if the platform has real data for that culture.
|
static |
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. |
Language tag column in the list of language/region names supported by xtd. Culture names follow the standard defined by BCP 47. name or alt_name is the name of the current culture, the returned xtd::globalization::culture_info object does not reflect any user overrides. This makes the method suitable for server applications or tools that do not have a real user account on the system and that need to load multiple cultures efficiently. name is xtd::string::empty_string, the method returns the invariant culture. This is equivalent to retrieving the value of the xtd::globalization::culture_info::invariant_culture property. name or alt_name is not a valid culture name.
|
static |
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. |
culture is the locale identifier of the current culture, the returned xtd::globalization::culture_info object does not reflect any user overrides. culture is not a valid culture identifier.
|
static |
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. |
types parameter. The array of cultures is sorted. | xtd::argument_out_of_rangeexception | types specifies an invalid combination of xtd::globalization::culture_types values. |
|
staticnoexcept |
Gets the lists of system locales.
locale -a terminal command.
|
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.
true, the xtd::globalization::culture_info::locale property returns a valid std::locale with name corresponding to this instance otherwise a generic std::locale with name equal to "C".