libcommonc++  0.7
Locale Class Reference

A class that encapsulates locale-specific information. More...

#include <Locale.h++>

Collaboration diagram for Locale:

Public Member Functions

 Locale (String language, String country=String::null, String variant=String::null)
 Construct a new Locale for the given language, and, optionally, country code and variant. More...
 
 ~Locale ()
 Destructor. More...
 
bool isValid () const
 Determine if this object represents a valid locale. More...
 
String getEncoding () const
 Get the default character encoding for this locale. More...
 
String getAMAffix () const
 Get the ante meridiem suffix for this locale, if any. More...
 
String getPMAffix () const
 Get the post meridiem suffix for this locale, if any. More...
 
String getWeekDayName (int day) const
 Get the full weekday name for the given weekday in this locale. More...
 
String getAbbreviatedWeekDayName (int day) const
 Get the abbreviated weekday name for the given weekday in this locale. More...
 
String getMonthName (int month) const
 Get the full month name for the given month in this locale. More...
 
String getAbbreviatedMonthName (int month) const
 Get the abbreviated month name for the given month in this locale. More...
 
String getRadixCharacter () const
 Get the radix character for this locale. More...
 
String getThousandsSeparator () const
 Get the thousands separator for this locale. More...
 
String getCurrencySymbol () const
 Get the currency symbol for this locale. More...
 
String getLanguage () const
 Get the language component of this locale. More...
 
String getCountry () const
 Get the country component of this locale. More...
 
String getVariant () const
 Get the variant component of this locale. More...
 
String toString () const
 Get a String representation of this locale. More...
 

Static Public Member Functions

static String getCurrentEncoding ()
 Get the current character encoding. More...
 
static const Locale getCurrent ()
 Get the current locale. More...
 
static bool setCurrent (const Locale &locale)
 Set the current locale. More...
 

Static Public Attributes

static const Locale CANADA
 The "en_CA" locale. More...
 
static const Locale CANADA_FRENCH
 The "fr_CA" locale. More...
 
static const Locale CHINA
 The "zh_CN" locale. More...
 
static const Locale CHINESE
 The "zh" locale. More...
 
static const Locale ENGLISH
 The "en" locale. More...
 
static const Locale FRANCE
 The "fr_FR" locale. More...
 
static const Locale FRENCH
 The "fr" locale. More...
 
static const Locale GERMANY
 The "de_DE" locale. More...
 
static const Locale GERMAN
 The "de" locale. More...
 
static const Locale ITALY
 The "it_IT" locale. More...
 
static const Locale ITALIAN
 The "it" locale. More...
 
static const Locale JAPAN
 The "ja" locale. More...
 
static const Locale JAPANESE
 The "ja" locale. More...
 
static const Locale KOREA
 The "ko" locale. More...
 
static const Locale KOREAN
 The "ko" locale. More...
 
static const Locale SPANISH
 The "es" locale. More...
 
static const Locale SIMPLIFIED_CHINESE
 The "zh_CN" locale. More...
 
static const Locale TRADITIONAL_CHINESE
 The "zh_TW" locale. More...
 
static const Locale TAIWAN
 The "zh_TW" locale. More...
 
static const Locale UNITED_KINGDOM
 The "en_GB" locale. More...
 
static const Locale UNITED_STATES
 The "en_US" locale. More...
 

Detailed Description

A class that encapsulates locale-specific information.

Author
Mark Lindner

Constructor & Destructor Documentation

◆ Locale()

Locale ( String  language,
String  country = String::null,
String  variant = String::null 
)

Construct a new Locale for the given language, and, optionally, country code and variant.

◆ ~Locale()

~Locale ( )

Destructor.

Member Function Documentation

◆ getAbbreviatedMonthName()

String getAbbreviatedMonthName ( int  month) const

Get the abbreviated month name for the given month in this locale.

Parameters
monthThe month number (1 - 12).

◆ getAbbreviatedWeekDayName()

String getAbbreviatedWeekDayName ( int  day) const

Get the abbreviated weekday name for the given weekday in this locale.

Parameters
dayThe weekday number (1 - 7; where 1 indicates Monday).

◆ getAMAffix()

String getAMAffix ( ) const

Get the ante meridiem suffix for this locale, if any.

◆ getCountry()

String getCountry ( ) const
inline

Get the country component of this locale.

◆ getCurrencySymbol()

String getCurrencySymbol ( ) const

Get the currency symbol for this locale.

◆ getCurrent()

const Locale getCurrent ( )
static

Get the current locale.

◆ getCurrentEncoding()

String getCurrentEncoding ( )
static

Get the current character encoding.

◆ getEncoding()

String getEncoding ( ) const

Get the default character encoding for this locale.

◆ getLanguage()

String getLanguage ( ) const
inline

Get the language component of this locale.

◆ getMonthName()

String getMonthName ( int  month) const

Get the full month name for the given month in this locale.

Parameters
monthThe month number (1 - 12).

◆ getPMAffix()

String getPMAffix ( ) const

Get the post meridiem suffix for this locale, if any.

◆ getRadixCharacter()

String getRadixCharacter ( ) const

Get the radix character for this locale.

◆ getThousandsSeparator()

String getThousandsSeparator ( ) const

Get the thousands separator for this locale.

◆ getVariant()

String getVariant ( ) const
inline

Get the variant component of this locale.

◆ getWeekDayName()

String getWeekDayName ( int  day) const

Get the full weekday name for the given weekday in this locale.

Parameters
dayThe weekday number (1 - 7; where 1 indicates Monday).

◆ isValid()

bool isValid ( ) const

Determine if this object represents a valid locale.

◆ setCurrent()

bool setCurrent ( const Locale locale)
static

Set the current locale.

◆ toString()

String toString ( ) const
inline

Get a String representation of this locale.

Member Data Documentation

◆ CANADA

const Locale CANADA
static

The "en_CA" locale.

◆ CANADA_FRENCH

const Locale CANADA_FRENCH
static

The "fr_CA" locale.

◆ CHINA

const Locale CHINA
static

The "zh_CN" locale.

◆ CHINESE

const Locale CHINESE
static

The "zh" locale.

◆ ENGLISH

const Locale ENGLISH
static

The "en" locale.

◆ FRANCE

const Locale FRANCE
static

The "fr_FR" locale.

◆ FRENCH

const Locale FRENCH
static

The "fr" locale.

◆ GERMAN

const Locale GERMAN
static

The "de" locale.

◆ GERMANY

const Locale GERMANY
static

The "de_DE" locale.

◆ ITALIAN

const Locale ITALIAN
static

The "it" locale.

◆ ITALY

const Locale ITALY
static

The "it_IT" locale.

◆ JAPAN

const Locale JAPAN
static

The "ja" locale.

◆ JAPANESE

const Locale JAPANESE
static

The "ja" locale.

◆ KOREA

const Locale KOREA
static

The "ko" locale.

◆ KOREAN

const Locale KOREAN
static

The "ko" locale.

◆ SIMPLIFIED_CHINESE

const Locale SIMPLIFIED_CHINESE
static

The "zh_CN" locale.

◆ SPANISH

const Locale SPANISH
static

The "es" locale.

◆ TAIWAN

const Locale TAIWAN
static

The "zh_TW" locale.

◆ TRADITIONAL_CHINESE

const Locale TRADITIONAL_CHINESE
static

The "zh_TW" locale.

◆ UNITED_KINGDOM

const Locale UNITED_KINGDOM
static

The "en_GB" locale.

◆ UNITED_STATES

const Locale UNITED_STATES
static

The "en_US" locale.


The documentation for this class was generated from the following files: