268 const char * country = 0,
269 const char * variant = 0,
270 const char * keywordsAndValues = 0);
328 #ifndef U_HIDE_SYSTEM_API
388 inline const char * getLanguage( )
const;
397 inline const char * getScript( )
const;
404 inline const char * getCountry( )
const;
411 inline const char * getVariant( )
const;
421 inline const char * getName()
const;
663 UBool isBogus(
void)
const;
710 #ifndef U_HIDE_INTERNAL_API
726 Locale& init(
const char* cLocaleID,
UBool canonicalize);
741 static Locale *getLocaleCache(
void);
746 int32_t variantBegin;
755 static const Locale &getLocale(
int locid);
796 return &baseName[variantBegin];
A Locale object represents a specific geographical, political, or cultural region.
const char * getScript() const
Returns the locale's ISO-15924 abbreviation script code.
static const Locale & getGerman(void)
Useful constant for this language.
static const Locale & getChina(void)
Useful constant for this country/region.
virtual UClassID getDynamicClassID() const
ICU "poor man's RTTI", returns a UClassID for the actual class.
static const Locale & getPRC(void)
Useful constant for this country/region.
static const Locale & getItalian(void)
Useful constant for this language.
void setFromPOSIXID(const char *posixID)
Set this from a single POSIX style locale string.
static const Locale & getSimplifiedChinese(void)
Useful constant for this language.
static const Locale & getCanadaFrench(void)
Useful constant for this country/region.
static const Locale & getGermany(void)
Useful constant for this country/region.
friend void locale_available_init()
Locale & operator=(const Locale &other)
Replaces the entire contents of *this with the specified value.
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 const Locale & getJapanese(void)
Useful constant for this language.
static const Locale & getCanada(void)
Useful constant for this country/region.
UnicodeString & getDisplayCountry(UnicodeString &dispCountry) const
Fills in "dispCountry" with the name of this locale's country in a format suitable for user display i...
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.
Locale(const char *language, const char *country=0, const char *variant=0, const char *keywordsAndValues=0)
Construct a locale from language, country, variant.
UnicodeString & getDisplayVariant(UnicodeString &dispVar) const
Fills in "dispVar" with the name of this locale's variant code in a format suitable for user display ...
static const char *const * getISOCountries()
Gets a list of all available 2-letter country codes defined in ISO 3166.
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...
int32_t hashCode(void) const
Generates a hash code for the locale.
const char * getCountry() const
Returns the locale's ISO-3166 country code.
void setKeywordValue(const char *keywordName, const char *keywordValue, UErrorCode &status)
Sets or removes the value for a keyword.
void setToBogus()
Sets the locale to bogus A bogus locale represents a non-existing locale associated with services tha...
UnicodeString & getDisplayLanguage(UnicodeString &dispLang) const
Fills in "dispLang" with the name of this locale's language in a format suitable for user display in ...
static const char *const * getISOLanguages()
Gets a list of all available language codes defined in ISO 639.
Locale()
Construct a default locale object, a Locale for the default locale ID.
UBool operator!=(const Locale &other) const
Checks if two locale keys are not the same.
static const Locale & getTaiwan(void)
Useful constant for this country/region.
static const Locale & getEnglish(void)
Useful constant for this language.
virtual ~Locale()
Destructor.
const char * getVariant() const
Returns the locale's variant code.
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 Locale createCanonical(const char *name)
Creates a locale from the given string after canonicalizing the string by calling uloc_canonicalize()...
UBool isBogus(void) const
Gets the bogus state.
static const Locale & getItaly(void)
Useful constant for this country/region.
static void setDefault(const Locale &newLocale, UErrorCode &success)
Sets the default.
const char * getLanguage() const
Returns the locale's ISO-639 language code.
static Locale createFromName(const char *name)
Creates a locale which has had minimal canonicalization as per uloc_getName().
static const Locale & getRoot(void)
Useful constant for the Root locale.
static const Locale & getFrance(void)
Useful constant for this country/region.
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...
const char * getBaseName() const
Returns the programmatic name of the entire locale as getName() would return, but without keywords.
Locale * clone() const
Clone this object.
Locale(const Locale &other)
Initializes a Locale object from another Locale object.
static const Locale * getAvailableLocales(int32_t &count)
Returns a list of all installed locales.
static const Locale & getUK(void)
Useful constant for this country/region.
static const Locale & getDefault(void)
Common methods of getting the current default Locale.
UnicodeString & getDisplayScript(UnicodeString &dispScript) const
Fills in "dispScript" with the name of this locale's script in a format suitable for user display in ...
const char * getISO3Language() const
returns the locale's three-letter language code, as specified in ISO draft standard ISO-639-2.
static const Locale & getFrench(void)
Useful constant for this language.
static UClassID getStaticClassID()
ICU "poor man's RTTI", returns a UClassID for this class.
static const Locale & getKorean(void)
Useful constant for this language.
static const Locale & getKorea(void)
Useful constant for this country/region.
StringEnumeration * createKeywords(UErrorCode &status) const
Gets the list of keywords for the specified locale.
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 ...
uint32_t getLCID(void) const
Returns the Windows LCID value corresponding to this locale.
UBool operator==(const Locale &other) const
Checks if two locale keys are the same.
static const Locale & getJapan(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...
static const Locale & getUS(void)
Useful constant for this country/region.
static const Locale & getChinese(void)
Useful constant for this language.
int32_t getKeywordValue(const char *keywordName, char *buffer, int32_t bufferCapacity, UErrorCode &status) const
Gets the value for a keyword.
const char * getName() const
Returns the programmatic name of the entire locale, with the language, country and variant separated ...
UBool isRightToLeft() const
Returns whether this locale's script is written right-to-left.
static const Locale & getTraditionalChinese(void)
Useful constant for this language.
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_NAMESPACE_BEGIN void locale_available_init()
C API: Platform Utilities.
C++ API: String Enumeration.
UBool operator!=(const StringPiece &x, const StringPiece &y)
Global operator != for StringPiece.
#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.