xtd 0.2.0
Loading...
Searching...
No Matches
culture_info_culture_types.cpp

Shows how to use xtd::globalization::culture_info class.

#include <xtd/xtd>
using namespace xtd::globalization;
auto main() -> int {
// Get and enumerate all cultures.
for (auto ci : all_cultures) {
// Display the name of each culture.
console::write("{} ({}): ", ci.english_name(), ci.name());
// Indicate the culture type.
console::write(" neutral_culture");
console::write(" spsecific_culture");
}
}
// This code produces the following output :
//
// Invariant Language (Invariant Country) (): spsecific_culture
// Afrikaans (af): neutral_culture
// Afrikaans (Namibia) (af-NA): spsecific_culture
// ...
// Chinese, Traditional (Taiwan) (zh-Hant-TW): spsecific_culture
// Zulu (zu): neutral_culture
// Zulu (South Africa) (zu-ZA): spsecific_culture
static void write(arg_t &&value)
Writes the text representation of the specified value to the standard output stream.
Definition console.hpp:462
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
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 param...
@ specific_cultures
Cultures that are specific to a country/region.
Definition culture_types.hpp:25
@ all_cultures
All cultures that are recognized by xtd, including neutral and specific cultures and custom cultures ...
Definition culture_types.hpp:30
@ neutral_cultures
Cultures that are associated with a language but are not specific to a country/region.
Definition culture_types.hpp:23
Contains classes that define culture-related information, including language, country/region,...
Definition culture_info.hpp:20
Provides the base class for enumerations.
Definition enum_object.hpp:48
bool has_flag(enum_type flag) const noexcept
Retrieves an array of the values of the constants in a specified enumeration.
Definition enum_object.hpp:90