271 const char * country = 0,
331#ifndef U_HIDE_SYSTEM_API
391 inline const char * getLanguage( )
const;
400 inline const char * getScript( )
const;
407 inline const char * getCountry( )
const;
414 inline const char * getVariant( )
const;
424 inline const char * getName()
const;
666 UBool isBogus(
void)
const;
713#ifndef U_HIDE_INTERNAL_API
744 static Locale *getLocaleCache(
void);
749 int32_t variantBegin;
779Locale::getCountry()
const
785Locale::getLanguage()
const
791Locale::getScript()
const
797Locale::getVariant()
const
799 return &baseName[variantBegin];
803Locale::getName()
const
809Locale::isBogus(
void)
const {
"Smart pointer" base class; do not use directly: use LocalPointer etc.
A Locale object represents a specific geographical, political, or cultural region.
static const Locale & getGermany(void)
Useful constant for this country/region.
static const Locale & getTraditionalChinese(void)
Useful constant for this language.
virtual UClassID getDynamicClassID() const
ICU "poor man's RTTI", returns a UClassID for the actual class.
static const char *const * getISOLanguages()
Gets a list of all available language codes defined in ISO 639.
friend Locale * locale_set_default_internal(const char *, UErrorCode &status)
A friend to allow the default locale to be set by either the C or C++ API.
static Locale createFromName(const char *name)
Creates a locale which has had minimal canonicalization as per uloc_getName().
UnicodeString & getDisplayLanguage(const Locale &displayLocale, UnicodeString &dispLang) const
Fills in "dispLang" with the name of this locale's language in a format suitable for user display in ...
static const Locale & getCanadaFrench(void)
Useful constant for this country/region.
static const Locale & getJapanese(void)
Useful constant for this language.
friend void locale_available_init()
static Locale createCanonical(const char *name)
Creates a locale from the given string after canonicalizing the string by calling uloc_canonicalize()...
static const Locale & getUS(void)
Useful constant for this country/region.
static const Locale & getGerman(void)
Useful constant for this language.
static UClassID getStaticClassID()
ICU "poor man's RTTI", returns a UClassID for this class.
Locale()
Construct a default locale object, a Locale for the default locale ID.
static const Locale & getItaly(void)
Useful constant for this country/region.
static const Locale & getChinese(void)
Useful constant for this language.
void setKeywordValue(const char *keywordName, const char *keywordValue, UErrorCode &status)
Sets or removes the value for a keyword.
uint32_t getLCID(void) const
Returns the Windows LCID value corresponding to this locale.
const char * getBaseName() const
Returns the programmatic name of the entire locale as getName() would return, but without keywords.
Locale & operator=(const Locale &other)
Replaces the entire contents of *this with the specified value.
Locale(const char *language, const char *country=0, const char *variant=0, const char *keywordsAndValues=0)
Construct a locale from language, country, variant.
static const Locale & getTaiwan(void)
Useful constant for this country/region.
static const Locale & getKorea(void)
Useful constant for this country/region.
UnicodeString & getDisplayCountry(const Locale &displayLocale, UnicodeString &dispCountry) const
Fills in "dispCountry" with the name of this locale's country in a format suitable for user display i...
virtual ~Locale()
Destructor.
const char * getISO3Language() const
returns the locale's three-letter language code, as specified in ISO draft standard ISO-639-2.
static const Locale & getRoot(void)
Useful constant for the Root locale.
int32_t getKeywordValue(const char *keywordName, char *buffer, int32_t bufferCapacity, UErrorCode &status) const
Gets the value for a keyword.
static void setDefault(const Locale &newLocale, UErrorCode &success)
Sets the default.
static const Locale & getUK(void)
Useful constant for this country/region.
UnicodeString & getDisplayVariant(const Locale &displayLocale, UnicodeString &dispVar) const
Fills in "dispVar" with the name of this locale's variant code in a format suitable for user display ...
StringEnumeration * createKeywords(UErrorCode &status) const
Gets the list of keywords for the specified locale.
static const Locale & getItalian(void)
Useful constant for this language.
static const Locale & getCanada(void)
Useful constant for this country/region.
static const Locale * getAvailableLocales(int32_t &count)
Returns a list of all installed locales.
static const Locale & getPRC(void)
Useful constant for this country/region.
static const Locale & getKorean(void)
Useful constant for this language.
void setToBogus()
Sets the locale to bogus A bogus locale represents a non-existing locale associated with services tha...
UnicodeString & getDisplayVariant(UnicodeString &dispVar) const
Fills in "dispVar" with the name of this locale's variant code in a format suitable for user display ...
UBool operator==(const Locale &other) const
Checks if two locale keys are the same.
static const Locale & getFrance(void)
Useful constant for this country/region.
UnicodeString & getDisplayScript(const Locale &displayLocale, UnicodeString &dispScript) const
Fills in "dispScript" with the name of this locale's country in a format suitable for user display in...
const char * getISO3Country() const
Fills in "name" with the locale's three-letter ISO-3166 country code.
static const Locale & getFrench(void)
Useful constant for this language.
UnicodeString & getDisplayCountry(UnicodeString &dispCountry) const
Fills in "dispCountry" with the name of this locale's country in a format suitable for user display i...
static const Locale & getEnglish(void)
Useful constant for this language.
int32_t hashCode(void) const
Generates a hash code for the locale.
Locale(const Locale &other)
Initializes a Locale object from another Locale object.
static const Locale & getSimplifiedChinese(void)
Useful constant for this language.
static const char *const * getISOCountries()
Gets a list of all available 2-letter country codes defined in ISO 3166.
static const Locale & getChina(void)
Useful constant for this country/region.
UnicodeString & getDisplayScript(UnicodeString &dispScript) const
Fills in "dispScript" with the name of this locale's script in a format suitable for user display in ...
UBool isRightToLeft() const
Returns whether this locale's script is written right-to-left.
UnicodeString & getDisplayLanguage(UnicodeString &dispLang) const
Fills in "dispLang" with the name of this locale's language in a format suitable for user display in ...
void setFromPOSIXID(const char *posixID)
Set this from a single POSIX style locale string.
static const Locale & getJapan(void)
Useful constant for this country/region.
static const Locale & getDefault(void)
Common methods of getting the current default Locale.
UnicodeString & getDisplayName(UnicodeString &name) const
Fills in "name" with the name of this locale in a format suitable for user display in the default loc...
Locale * clone() const
Clone this object.
UnicodeString & getDisplayName(const Locale &displayLocale, UnicodeString &name) const
Fills in "name" with the name of this locale in a format suitable for user display in the locale spec...
Base class for 'pure' C++ implementations of uenum api.
UObject is the common ICU "boilerplate" class.
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
U_EXPORT UBool operator==(const StringPiece &x, const StringPiece &y)
Global operator == for StringPiece.
void locale_available_init()
UBool operator!=(const StringPiece &x, const StringPiece &y)
Global operator != for StringPiece.
C API: Platform Utilities.
#define ULOC_SCRIPT_CAPACITY
Useful constant for the maximum size of the script part of a locale ID (including the terminating NUL...
#define ULOC_COUNTRY_CAPACITY
Useful constant for the maximum size of the country part of a locale ID (including the terminating NU...
#define ULOC_LANG_CAPACITY
Useful constant for the maximum size of the language part of a locale ID.
#define ULOC_FULLNAME_CAPACITY
Useful constant for the maximum size of the whole locale ID (including the terminating NULL and all k...
int8_t UBool
The ICU boolean type.
C++ API: Common ICU base class UObject.
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers,...
#define U_COMMON_API
Set to export library symbols from inside the common library, and to import them from outside.
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.