Sourceforge.net - The VCF's Project Host
   The VCF Website Home   |   Online Discussion Forums   |   Sourceforge.net Project Page   

VCF::Locale Class Reference

A locale instance represents the cultural data used to convert data to string in manner appropriate to the language and country. More...

#include <vcf/FoundationKit/Locales.h>

Inheritance diagram for VCF::Locale:

VCF::Object List of all members.

Public Types

enum  CountryCodes {
  ccUndefined = 0, ccAfghanistan = 'AF', ccAlbania = 'AL', ccAlgeria = 'DZ',
  ccAmericanSamoa = 'AS', ccAndorra = 'AD', ccAngola = 'AO', ccAnguilla = 'AI',
  ccAntarctica = 'AQ', ccAntiguaAndBarbuda = 'AG', ccArgentina = 'AR', ccArmenia = 'AM',
  ccAruba = 'AW', ccAustralia = 'AU', ccAustria = 'AT', ccAzerbaijan = 'AZ',
  ccBahamas = 'BS', ccBahrain = 'BH', ccBangladesh = 'BD', ccBarbados = 'BB',
  ccBelarus = 'BY', ccBelgium = 'BE', ccBelize = 'BZ', ccBenin = 'BJ',
  ccBermuda = 'BM', ccBhutan = 'BT', ccBolivia = 'BO', ccBosniaAndHerzegovina = 'BA',
  ccBotswana = 'BW', ccBouvetIsland = 'BV', ccBrazil = 'BR', ccBritishIndianOceanTerritory = 'IO',
  ccBrunei = 'BN', ccBulgaria = 'BG', ccBurkinaFaso = 'BF', ccBurundi = 'BI',
  ccCambodia = 'KH', ccCameroon = 'CM', ccCanada = 'CA', ccCapeVerde = 'CV',
  ccCaymanIslands = 'KY', ccCentralAfricanRepublic = 'CF', ccChad = 'TD', ccChile = 'CL',
  ccChina = 'CN', ccChristmasIsland = 'CX', ccCocosIslands = 'CC', ccColombia = 'CO',
  ccComoros = 'KM', ccCongo = 'CG', ccDemocraticRepOfCongo = 'CD', ccCookIslands = 'CK',
  ccCostaRica = 'CR', ccCoteDIvoire = 'CI', ccCroatia = 'HR', ccCuba = 'CU',
  ccCyprus = 'CY', ccCzechRepublic = 'CZ', ccDenmark = 'DK', ccDjibouti = 'DJ',
  ccDominica = 'DM', ccDominicanRepublic = 'DO', ccEcuador = 'EC', ccEgypt = 'EG',
  ccElSalvador = 'SV', ccEquatorialGuinea = 'GQ', ccEritrea = 'ER', ccEstonia = 'EE',
  ccEthiopia = 'ET', ccFalklandIslands = 'FK', ccFaroIslands = 'FO', ccFiji = 'FJ',
  ccFinland = 'FI', ccFrance = 'FR', ccFrenchGuiana = 'GF', ccFrenchPolynesia = 'PF',
  ccFrenchSouthernTerritories = 'TF', ccGabon = 'GA', ccGambia = 'GM', ccGeorgia = 'GE',
  ccGermany = 'DE', ccGhana = 'GH', ccGibraltar = 'GI', ccGreece = 'GR',
  ccGreenland = 'GL', ccGrenada = 'GD', ccGuadeloupe = 'GP', ccGuam = 'GU',
  ccGuatemala = 'GT', ccGuinea = 'GN', ccGuineaBissau = 'GW', ccGuyana = 'GY',
  ccHaiti = 'HT', ccHeardIslandAndMcdonaldIslands = 'HM', ccVaticanCity = 'VA', ccHonduras = 'HN',
  ccHongKong = 'HK', ccHungary = 'HU', ccIceland = 'IS', ccIndia = 'IN',
  ccIndonesia = 'ID', ccIran = 'IR', ccIraq = 'IQ', ccIreland = 'IE',
  ccIsrael = 'IL', ccItaly = 'IT', ccJamaica = 'JM', ccJapan = 'JP',
  ccJordan = 'JO', ccKazakhstan = 'KZ', ccKenya = 'KE', ccKiribati = 'KI',
  ccNorthKorea = 'KP', ccSouthKorea = 'KR', ccKuwait = 'KW', ccKyrgyzstan = 'KG',
  ccPeoplesRepublicOfLao = 'LA', ccLatvia = 'LV', ccLebanon = 'LB', ccLesotho = 'LS',
  ccLiberia = 'LR', ccLibyanArabJamahiriya = 'LY', ccLiechtenstein = 'LI', ccLithuania = 'LT',
  ccLuxembourg = 'LU', ccMacao = 'MO', ccMacedonia = 'MK', ccMadagascar = 'MG',
  ccMalawi = 'MW', ccMalaysia = 'MY', ccMaldives = 'MV', ccMali = 'ML',
  ccMalta = 'MT', ccMarshallIslands = 'MH', ccMartinique = 'MQ', ccMauritania = 'MR',
  ccMauritius = 'MU', ccMayotte = 'YT', ccMexico = 'MX', ccMicronesia = 'FM',
  ccMoldova = 'MD', ccMonaco = 'MC', ccMongolia = 'MN', ccMontserrat = 'MS',
  ccMorocco = 'MA', ccMozambique = 'MZ', ccMyanmar = 'MM', ccNamibia = 'NA',
  ccNauru = 'NR', ccNepal = 'NP', ccNetherlands = 'NL', ccNetherlandsAntilles = 'AN',
  ccNewCaledonia = 'NC', ccNewZealand = 'NZ', ccNicaragua = 'NI', ccNiger = 'NE',
  ccNigeria = 'NG', ccNiue = 'NU', ccNorfolkIsland = 'NF', ccNorthernMarianaIslands = 'MP',
  ccNorway = 'NO', ccOman = 'OM', ccPakistan = 'PK', ccPalau = 'PW',
  ccPalestinianTerritory = 'PS', ccPanama = 'PA', ccPapuaNewGuinea = 'PG', ccParaguay = 'PY',
  ccPeru = 'PE', ccPhilippines = 'PH', ccPitcairn = 'PN', ccPoland = 'PL',
  ccPortugal = 'PT', ccPuertoRico = 'PR', ccQatar = 'QA', ccReunion = 'RE',
  ccRomania = 'RO', ccRussianFederation = 'RU', ccRwanda = 'RW', ccSaintHelena = 'SH',
  ccSaintKitts = 'KN', ccNevis = 'KN', ccSaintLucia = 'LC', ccSaintPierre = 'PM',
  ccMiquelon = 'PM', ccSaintVincent = 'VC', ccTheGrenadines = 'VC', ccSamoa = 'WS',
  ccSanMarino = 'SM', ccSaoTome = 'ST', ccPrincipe = 'ST', ccSaudiArabia = 'SA',
  ccSenegal = 'SN', ccSerbia = 'CS', ccMontenegro = 'CS', ccSeychelles = 'SC',
  ccSierraLeone = 'SL', ccSingapore = 'SG', ccSlovakia = 'SK', ccSlovenia = 'SI',
  ccSolomonIslands = 'SB', ccSomalia = 'SO', ccSouthAfrica = 'ZA', ccSouthGeorgia = 'GS',
  ccSouthSandwichIslands = 'GS', ccSpain = 'ES', ccSriLanka = 'LK', ccSudan = 'SD',
  ccSuriname = 'SR', ccSvalbard = 'SJ', ccJanMayen = 'SJ', ccSwaziland = 'SZ',
  ccSweden = 'SE', ccSwitzerland = 'CH', ccSyrianArabRepublic = 'SY', ccTaiwan = 'TW',
  ccTajikistan = 'TJ', ccTanzania = 'TZ', ccThailand = 'TH', ccTimorLeste = 'TL',
  ccTogo = 'TG', ccTokelau = 'TK', ccTonga = 'TO', ccTrinidad = 'TT',
  ccTobago = 'TT', ccTunisia = 'TN', ccTurkey = 'TR', ccTurkmenistan = 'TM',
  ccTurksAndCaicosIslands = 'TC', ccTuvalu = 'TV', ccUganda = 'UG', ccUkraine = 'UA',
  ccUnitedArabEmirates = 'AE', ccUnitedKingdom = 'GB', ccUnitedStates = 'US', ccUnitedStatesMinorOutlyingIslands = 'UM',
  ccUruguay = 'UY', ccUzbekistan = 'UZ', ccVanuatu = 'VU', ccVenezuela = 'VE',
  ccVietNam = 'VN', ccBritishVirginIslands = 'VG', ccUSVirginIslands = 'VI', ccWallisAndFutuna = 'WF',
  ccWesternSahara = 'EH', ccYemen = 'YE', ccZaire = ccDemocraticRepOfCongo, ccZambia = 'ZM',
  ccZimbabwe = 'ZW'
}
 This enumerates all the possible country codes. More...
enum  LanguageCodes {
  lcUndefined = 0, lcAfar = 'aa', lcAbkhazian = 'ab', lcAfrikaans = 'af',
  lcAkan = 'ak', lcAlbanian = 'sq', lcAmharic = 'am', lcArabic = 'ar',
  lcAragonese = 'an', lcArmenian = 'hy', lcAssamese = 'as', lcAvaric = 'av',
  lcAvestan = 'ae', lcAymara = 'ay', lcAzerbaijani = 'az', lcBashkir = 'ba',
  lcBambara = 'bm', lcBasque = 'eu', lcBelarusian = 'be', lcBengali = 'bn',
  lcBihari = 'bh', lcBislama = 'bi', lcTibetan = 'bo', lcBosnian = 'bs',
  lcBreton = 'br', lcBulgarian = 'bg', lcBurmese = 'my', lcCatalan = 'ca',
  lcValencian = 'ca', lcCzech = 'cs', lcChamorro = 'ch', lcChechen = 'ce',
  lcChinese = 'zh', lcChurchSlavic = 'cu', lcOldSlavonic = 'cu', lcChurchSlavonic = 'cu',
  lcOldBulgarian = 'cu', lcOldChurchSlavonic = 'cu', lcChuvash = 'cv', lcCornish = 'kw',
  lcCorsican = 'co', lcCree = 'cr', lcWelsh = 'cy', lcDanish = 'da',
  lcGerman = 'de', lcDivehi = 'dv', lcFlemish = 'nl', lcDutch = 'nl',
  lcDzongkha = 'dz', lcGreek = 'el', lcEnglish = 'en', lcEsperanto = 'eo',
  lcEstonian = 'et', lcEwe = 'ee', lcFaroese = 'fo', lcPersian = 'fa',
  lcFijian = 'fj', lcFinnish = 'fi', lcFrench = 'fr', lcFrisian = 'fy',
  lcFulah = 'ff', lcGeorgian = 'ka', lcGaelic = 'gd', lcScottishGaelic = 'gd',
  lcIrish = 'ga', lcGallegan = 'gl', lcManx = 'gv', lcGuarani = 'gn',
  lcGujarati = 'gu', lcHaitian = 'ht', lcHaitianCreole = 'ht', lcHausa = 'ha',
  lcHebrew = 'he', lcHerero = 'hz', lcHindi = 'hi', lcHiriMotu = 'ho',
  lcCroatian = 'hr', lcHungarian = 'hu', lcIgbo = 'ig', lcIcelandic = 'is',
  lcIdo = 'io', lcSichuanYi = 'ii', lcInuktitut = 'iu', lcInterlingue = 'ie',
  lcInterlingua = 'ia', lcIndonesian = 'id', lcInupiaq = 'ik', lcItalian = 'it',
  lcJavanese = 'jv', lcJapanese = 'ja', lcKalaallisut = 'kl', lcGreenlandic = 'kl',
  lcKannada = 'kn', lcKashmiri = 'ks', lcKanuri = 'kr', lcKazakh = 'kk',
  lcKhmer = 'km', lcKikuyu = 'ki', lcGikuyu = 'ki', lcKinyarwanda = 'rw',
  lcKirghiz = 'ky', lcKomi = 'kv', lcKongo = 'kg', lcKorean = 'ko',
  lcKuanyama = 'kj', lcKwanyama = 'kj', lcKurdish = 'ku', lcLao = 'lo',
  lcLatin = 'la', lcLatvian = 'lv', lcLimburgan = 'li', lcLimburger = 'li',
  lcLimburgish = 'li', lcLingala = 'ln', lcLithuanian = 'lt', lcLuxembourgish = 'lb',
  lcLetzeburgesch = 'lb', lcLubaKatanga = 'lu', lcGanda = 'lg', lcMacedonian = 'mk',
  lcMarshallese = 'mh', lcMalayalam = 'ml', lcMaori = 'mi', lcMarathi = 'mr',
  lcMalay = 'ms', lcMalagasy = 'mg', lcMaltese = 'mt', lcMoldavian = 'mo',
  lcMongolian = 'mn', lcNauru = 'na', lcNavajo = 'nv', lcNavaho = 'nv',
  lcSouthNdebele = 'nr', lcNorthNdebele = 'nd', lcNdonga = 'ng', lcNepali = 'ne',
  lcNorwegianNynorsk = 'nn', lcNorwegianBokmal = 'nb', lcNorwegian = 'no', lcChichewa = 'ny',
  lcChewa = 'ny', lcNyanja = 'ny', lcOccitan = 'oc', lcProvencal = 'oc',
  lcOjibwa = 'oj', lcOriya = 'or', lcOromo = 'om', lcOssetian = 'os',
  lcOssetic = 'os', lcPunjabi = 'pa', lcPali = 'pi', lcPolish = 'pl',
  lcPortuguese = 'pt', lcPushto = 'ps', lcQuechua = 'qu', lcRaetoRomance = 'rm',
  lcRomanian = 'ro', lcRundi = 'rn', lcRussian = 'ru', lcSango = 'sg',
  lcSanskrit = 'sa', lcSerbian = 'sr', lcSinhalese = 'si', lcSlovak = 'sk',
  lcSlovenian = 'sl', lcNorthernSami = 'se', lcSamoan = 'sm', lcShona = 'sn',
  lcSindhi = 'sd', lcSomali = 'so', lcSotho = 'st', lcSpanish = 'es',
  lcSardinian = 'sc', lcSwati = 'ss', lcSundanese = 'su', lcSwahili = 'sw',
  lcSwedish = 'sv', lcTahitian = 'ty', lcTamil = 'ta', lcTatar = 'tt',
  lcTelugu = 'te', lcTajik = 'tg', lcTagalog = 'tl', lcThai = 'th',
  lcTigrinya = 'ti', lcTonga = 'to', lcTswana = 'tn', lcTsonga = 'ts',
  lcTurkmen = 'tk', lcTurkish = 'tr', lcTwi = 'tw', lcUighur = 'ug',
  lcUkrainian = 'uk', lcUrdu = 'ur', lcUzbek = 'uz', lcVenda = 've',
  lcVietnamese = 'vi', lcVolapuk = 'vo', lcWalloon = 'wa', lcWolof = 'wo',
  lcXhosa = 'xh', lcYiddish = 'yi', lcYoruba = 'yo', lcZhuang = 'za',
  lcChuang = 'za', lcZulu = 'zu'
}
 This enumerates all the possible language codes. More...

Public Member Functions

 Locale (const UnicodeString &languageCode, const UnicodeString &countryCode)
 Construct a new locale instance from a language code string, and a country code string.
 Locale (const LanguageCodes &languageCode, const CountryCodes &countryCode)
virtual ~Locale ()
LanguageCodes getLanguageCode ()
CountryCodes getCountryCode ()
UnicodeString getLanguageCodeString ()
 Returns the locale's ISO-639-1 language code.
UnicodeString getLanguageName ()
 Returns the english full language name as specified by ISO-639-2.
UnicodeString getCountryCodeString ()
 Get the ISO-3166 country code.
UnicodeString getName ()
 returns a string that is a combination of the language code, an "_", and the country code.
int collate (const UnicodeString &s1, const UnicodeString &s2)
 Collates, or compares, taking case into consideration, two strings.
int collateCaseInsensitive (const UnicodeString &s1, const UnicodeString &s2)
 Collates, or compares, two strings, ignoring their case.
UnicodeString toString (const int &val)
 converts the integer val into a UnicodeString.
UnicodeString toString (const unsigned int &val)
UnicodeString toString (const long &val)
UnicodeString toString (const unsigned long &val)
UnicodeString toString (const double &val)
UnicodeString toString (const float &val)
UnicodeString toStringFromCurrency (const double &val)
 Converts a double currency value into a string.
UnicodeString toStringFromDate (const DateTime &val, const UnicodeString &format="")
 converts a date/time instance into a string representing the date portion of the DateTime instance.
UnicodeString toStringFromTime (const DateTime &val, const UnicodeString &format="")
 converts a date/time instance into a string representing the time portion of the DateTime instance.
int toInt (const UnicodeString &str)
 Converts a string to a integer.
unsigned int toUInt (const UnicodeString &str)
double toDouble (const UnicodeString &str)
float toFloat (const UnicodeString &str)
double toDoubleAsCurrency (const UnicodeString &str)
DateTime toDateTime (const UnicodeString &str)
UnicodeString toLowerCase (const UnicodeString &s)
 Transforms all alpha numeric characters in a string to lower case.
UnicodeString toUpperCase (const UnicodeString &s)
 Transforms all alpha numeric characters in a string to upper case.
UnicodeString getNumberThousandsSeparator ()
UnicodeString getNumberDecimalPoint ()
UnicodeString getNumberGrouping ()
UnicodeString getCurrencyDecimalPoint ()
UnicodeString getCurrencyThousandsSeparator ()
UnicodeString getCurrencySymbol ()
int getCurrencyFractionalDigits ()
UnicodeString getCurrencyPositiveSign ()
UnicodeString getCurrencyNegativeSign ()
bool isCharA (const int32 &charTypeMask, const VCFChar &c)
UnicodeString translate (const UnicodeString &id)
LocalePeergetPeer ()
UnicodeString::LanguageEncoding getEncoding () const
void setEncoding (UnicodeString::LanguageEncoding val)

Static Public Member Functions

static UnicodeString languageCodeToString (LanguageCodes code)
static UnicodeString countryCodeToString (CountryCodes code)
static LanguageCodes stringToLanguageCode (const UnicodeString &code)
static CountryCodes stringToCountryCode (const UnicodeString &code)

Protected Attributes

LocalePeerpeer_
UnicodeString::LanguageEncoding encoding_

Detailed Description

A locale instance represents the cultural data used to convert data to string in manner appropriate to the language and country.

Each locale is identified by a language and a country code, where the language code is one of the possible values as listed by ISO-639-1, and the country code is one of the possible values as listed in ISO-3166. The complete locale is referred to as a combination of both these values, for example, the french locale is referred to as "fr_FR", and the United States locale is referred to as "en_US".

A locale offers a variety of methods to translate data into a string, based on the rules of the locale. For example, monetary units are represented by the dollar symbol ("$") in the "en_US" locale, but the United Kindom ("en_GB") are represented by the pound ("£"). Other functions include the ability to sort 2 strings based on the locale's sorting rules (also referred to as "collation"), transforming numerical data (ints, longs, doubles, etc) to a string. For example:

Locale loc("en_US"); //United States
String numString = loc.toString( 123456 ); //numString = "123,456"

Locale loc("it_IT"); //Italy
String numString = loc.toString( 123456 ); //numString = "123.456"
You can also convert currency data (as a double) to a string.

There are date and time functions for transforming a DateTime instance into a string that is representative of the time in hours, minutes, and seconds, and into a string that represents the date.

There are case transformation functions, to convert a string into all upper case or into all lowercase.


Member Enumeration Documentation

enum VCF::Locale::CountryCodes
 

This enumerates all the possible country codes.

The value of each code is exactly that as specified in ISO-3166.

Enumerator:
ccUndefined 
ccAfghanistan 
ccAlbania 
ccAlgeria 
ccAmericanSamoa 
ccAndorra 
ccAngola 
ccAnguilla 
ccAntarctica 
ccAntiguaAndBarbuda 
ccArgentina 
ccArmenia 
ccAruba 
ccAustralia 
ccAustria 
ccAzerbaijan 
ccBahamas 
ccBahrain 
ccBangladesh 
ccBarbados 
ccBelarus 
ccBelgium 
ccBelize 
ccBenin 
ccBermuda 
ccBhutan 
ccBolivia 
ccBosniaAndHerzegovina 
ccBotswana 
ccBouvetIsland 
ccBrazil 
ccBritishIndianOceanTerritory 
ccBrunei 
ccBulgaria 
ccBurkinaFaso 
ccBurundi 
ccCambodia 
ccCameroon 
ccCanada 
ccCapeVerde 
ccCaymanIslands 
ccCentralAfricanRepublic 
ccChad 
ccChile 
ccChina 
ccChristmasIsland 
ccCocosIslands 
ccColombia 
ccComoros 
ccCongo 
ccDemocraticRepOfCongo 
ccCookIslands 
ccCostaRica 
ccCoteDIvoire 
ccCroatia 
ccCuba 
ccCyprus 
ccCzechRepublic 
ccDenmark 
ccDjibouti 
ccDominica 
ccDominicanRepublic 
ccEcuador 
ccEgypt 
ccElSalvador 
ccEquatorialGuinea 
ccEritrea 
ccEstonia 
ccEthiopia 
ccFalklandIslands 
ccFaroIslands 
ccFiji 
ccFinland 
ccFrance 
ccFrenchGuiana 
ccFrenchPolynesia 
ccFrenchSouthernTerritories 
ccGabon 
ccGambia 
ccGeorgia 
ccGermany 
ccGhana 
ccGibraltar 
ccGreece 
ccGreenland 
ccGrenada 
ccGuadeloupe 
ccGuam 
ccGuatemala 
ccGuinea 
ccGuineaBissau 
ccGuyana 
ccHaiti 
ccHeardIslandAndMcdonaldIslands 
ccVaticanCity 
ccHonduras 
ccHongKong 
ccHungary 
ccIceland 
ccIndia 
ccIndonesia 
ccIran 
ccIraq 
ccIreland 
ccIsrael 
ccItaly 
ccJamaica 
ccJapan 
ccJordan 
ccKazakhstan 
ccKenya 
ccKiribati 
ccNorthKorea 
ccSouthKorea 
ccKuwait 
ccKyrgyzstan 
ccPeoplesRepublicOfLao 
ccLatvia 
ccLebanon 
ccLesotho 
ccLiberia 
ccLibyanArabJamahiriya 
ccLiechtenstein 
ccLithuania 
ccLuxembourg 
ccMacao 
ccMacedonia 
ccMadagascar 
ccMalawi 
ccMalaysia 
ccMaldives 
ccMali 
ccMalta 
ccMarshallIslands 
ccMartinique 
ccMauritania 
ccMauritius 
ccMayotte 
ccMexico 
ccMicronesia 
ccMoldova 
ccMonaco 
ccMongolia 
ccMontserrat 
ccMorocco 
ccMozambique 
ccMyanmar 
ccNamibia 
ccNauru 
ccNepal 
ccNetherlands 
ccNetherlandsAntilles 
ccNewCaledonia 
ccNewZealand 
ccNicaragua 
ccNiger 
ccNigeria 
ccNiue 
ccNorfolkIsland 
ccNorthernMarianaIslands 
ccNorway 
ccOman 
ccPakistan 
ccPalau 
ccPalestinianTerritory 
ccPanama 
ccPapuaNewGuinea 
ccParaguay 
ccPeru 
ccPhilippines 
ccPitcairn 
ccPoland 
ccPortugal 
ccPuertoRico 
ccQatar 
ccReunion 
ccRomania 
ccRussianFederation 
ccRwanda 
ccSaintHelena 
ccSaintKitts 
ccNevis 
ccSaintLucia 
ccSaintPierre 
ccMiquelon 
ccSaintVincent 
ccTheGrenadines 
ccSamoa 
ccSanMarino 
ccSaoTome 
ccPrincipe 
ccSaudiArabia 
ccSenegal 
ccSerbia 
ccMontenegro 
ccSeychelles 
ccSierraLeone 
ccSingapore 
ccSlovakia 
ccSlovenia 
ccSolomonIslands 
ccSomalia 
ccSouthAfrica 
ccSouthGeorgia 
ccSouthSandwichIslands 
ccSpain 
ccSriLanka 
ccSudan 
ccSuriname 
ccSvalbard 
ccJanMayen 
ccSwaziland 
ccSweden 
ccSwitzerland 
ccSyrianArabRepublic 
ccTaiwan 
ccTajikistan 
ccTanzania 
ccThailand 
ccTimorLeste 
ccTogo 
ccTokelau 
ccTonga 
ccTrinidad 
ccTobago 
ccTunisia 
ccTurkey 
ccTurkmenistan 
ccTurksAndCaicosIslands 
ccTuvalu 
ccUganda 
ccUkraine 
ccUnitedArabEmirates 
ccUnitedKingdom 
ccUnitedStates 
ccUnitedStatesMinorOutlyingIslands 
ccUruguay 
ccUzbekistan 
ccVanuatu 
ccVenezuela 
ccVietNam 
ccBritishVirginIslands 
ccUSVirginIslands 
ccWallisAndFutuna 
ccWesternSahara 
ccYemen 
ccZaire 
ccZambia 
ccZimbabwe 

enum VCF::Locale::LanguageCodes
 

This enumerates all the possible language codes.

The value of each code is exactly that as specified in ISO-639-1.

Enumerator:
lcUndefined 
lcAfar 
lcAbkhazian 
lcAfrikaans 
lcAkan 
lcAlbanian 
lcAmharic 
lcArabic 
lcAragonese 
lcArmenian 
lcAssamese 
lcAvaric 
lcAvestan 
lcAymara 
lcAzerbaijani 
lcBashkir 
lcBambara 
lcBasque 
lcBelarusian 
lcBengali 
lcBihari 
lcBislama 
lcTibetan 
lcBosnian 
lcBreton 
lcBulgarian 
lcBurmese 
lcCatalan 
lcValencian 
lcCzech 
lcChamorro 
lcChechen 
lcChinese 
lcChurchSlavic 
lcOldSlavonic 
lcChurchSlavonic 
lcOldBulgarian 
lcOldChurchSlavonic 
lcChuvash 
lcCornish 
lcCorsican 
lcCree 
lcWelsh 
lcDanish 
lcGerman 
lcDivehi 
lcFlemish 
lcDutch 
lcDzongkha 
lcGreek 
lcEnglish 
lcEsperanto 
lcEstonian 
lcEwe 
lcFaroese 
lcPersian 
lcFijian 
lcFinnish 
lcFrench 
lcFrisian 
lcFulah 
lcGeorgian 
lcGaelic 
lcScottishGaelic 
lcIrish 
lcGallegan 
lcManx 
lcGuarani 
lcGujarati 
lcHaitian 
lcHaitianCreole 
lcHausa 
lcHebrew 
lcHerero 
lcHindi 
lcHiriMotu 
lcCroatian 
lcHungarian 
lcIgbo 
lcIcelandic 
lcIdo 
lcSichuanYi 
lcInuktitut 
lcInterlingue 
lcInterlingua 
lcIndonesian 
lcInupiaq 
lcItalian 
lcJavanese 
lcJapanese 
lcKalaallisut 
lcGreenlandic 
lcKannada 
lcKashmiri 
lcKanuri 
lcKazakh 
lcKhmer 
lcKikuyu 
lcGikuyu 
lcKinyarwanda 
lcKirghiz 
lcKomi 
lcKongo 
lcKorean 
lcKuanyama 
lcKwanyama 
lcKurdish 
lcLao 
lcLatin 
lcLatvian 
lcLimburgan 
lcLimburger 
lcLimburgish 
lcLingala 
lcLithuanian 
lcLuxembourgish 
lcLetzeburgesch 
lcLubaKatanga 
lcGanda 
lcMacedonian 
lcMarshallese 
lcMalayalam 
lcMaori 
lcMarathi 
lcMalay 
lcMalagasy 
lcMaltese 
lcMoldavian 
lcMongolian 
lcNauru 
lcNavajo 
lcNavaho 
lcSouthNdebele 
lcNorthNdebele 
lcNdonga 
lcNepali 
lcNorwegianNynorsk 
lcNorwegianBokmal 
lcNorwegian 
lcChichewa 
lcChewa 
lcNyanja 
lcOccitan 
lcProvencal 
lcOjibwa 
lcOriya 
lcOromo 
lcOssetian 
lcOssetic 
lcPunjabi 
lcPali 
lcPolish 
lcPortuguese 
lcPushto 
lcQuechua 
lcRaetoRomance 
lcRomanian 
lcRundi 
lcRussian 
lcSango 
lcSanskrit 
lcSerbian 
lcSinhalese 
lcSlovak 
lcSlovenian 
lcNorthernSami 
lcSamoan 
lcShona 
lcSindhi 
lcSomali 
lcSotho 
lcSpanish 
lcSardinian 
lcSwati 
lcSundanese 
lcSwahili 
lcSwedish 
lcTahitian 
lcTamil 
lcTatar 
lcTelugu 
lcTajik 
lcTagalog 
lcThai 
lcTigrinya 
lcTonga 
lcTswana 
lcTsonga 
lcTurkmen 
lcTurkish 
lcTwi 
lcUighur 
lcUkrainian 
lcUrdu 
lcUzbek 
lcVenda 
lcVietnamese 
lcVolapuk 
lcWalloon 
lcWolof 
lcXhosa 
lcYiddish 
lcYoruba 
lcZhuang 
lcChuang 
lcZulu 


Constructor & Destructor Documentation

VCF::Locale::Locale const UnicodeString languageCode,
const UnicodeString countryCode
 

Construct a new locale instance from a language code string, and a country code string.

VCF::Locale::Locale const LanguageCodes languageCode,
const CountryCodes countryCode
 

virtual VCF::Locale::~Locale  )  [virtual]
 


Member Function Documentation

int VCF::Locale::collate const UnicodeString s1,
const UnicodeString s2
 

Collates, or compares, taking case into consideration, two strings.

Returns either -1, 0, 1, indicating s1 is less than, equal to, or greater than s2.

Parameters:
UnicodeString the first string
the second string
Returns:
The values are either -1, 0, or 1, as follows:
  • returns -1 if s1 < s2
  • returns 0 if s1 == s2
  • returns 1 if s1 > s2

int VCF::Locale::collateCaseInsensitive const UnicodeString s1,
const UnicodeString s2
 

Collates, or compares, two strings, ignoring their case.

Returns either -1, 0, 1, indicating s1 is less than, equal to, or greater than s2.

Parameters:
UnicodeString the first string
the second string
Returns:
The values are either -1, 0, or 1, as follows:
  • returns -1 if s1 < s2
  • returns 0 if s1 == s2
  • returns 1 if s1 > s2

static UnicodeString VCF::Locale::countryCodeToString CountryCodes  code  )  [static]
 

CountryCodes VCF::Locale::getCountryCode  ) 
 

UnicodeString VCF::Locale::getCountryCodeString  )  [inline]
 

Get the ISO-3166 country code.

This can be see here: http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html Each code is 2 characters long, and are always upper case.

UnicodeString VCF::Locale::getCurrencyDecimalPoint  ) 
 

int VCF::Locale::getCurrencyFractionalDigits  ) 
 

UnicodeString VCF::Locale::getCurrencyNegativeSign  ) 
 

UnicodeString VCF::Locale::getCurrencyPositiveSign  ) 
 

UnicodeString VCF::Locale::getCurrencySymbol  ) 
 

UnicodeString VCF::Locale::getCurrencyThousandsSeparator  ) 
 

UnicodeString::LanguageEncoding VCF::Locale::getEncoding  )  const [inline]
 

LanguageCodes VCF::Locale::getLanguageCode  ) 
 

UnicodeString VCF::Locale::getLanguageCodeString  )  [inline]
 

Returns the locale's ISO-639-1 language code.

The language codes can be seen here: http://www.loc.gov/standards/iso639-2/langcodes.html. Each code is 2 characters long, and are always lower case.

UnicodeString VCF::Locale::getLanguageName  ) 
 

Returns the english full language name as specified by ISO-639-2.

For example, the language code "zh" has a language name value of "Chinese".

UnicodeString VCF::Locale::getName  ) 
 

returns a string that is a combination of the language code, an "_", and the country code.

UnicodeString VCF::Locale::getNumberDecimalPoint  ) 
 

UnicodeString VCF::Locale::getNumberGrouping  ) 
 

UnicodeString VCF::Locale::getNumberThousandsSeparator  ) 
 

LocalePeer* VCF::Locale::getPeer  )  [inline]
 

bool VCF::Locale::isCharA const int32 charTypeMask,
const VCFChar c
 

static UnicodeString VCF::Locale::languageCodeToString LanguageCodes  code  )  [static]
 

void VCF::Locale::setEncoding UnicodeString::LanguageEncoding  val  )  [inline]
 

static CountryCodes VCF::Locale::stringToCountryCode const UnicodeString code  )  [static]
 

static LanguageCodes VCF::Locale::stringToLanguageCode const UnicodeString code  )  [static]
 

DateTime VCF::Locale::toDateTime const UnicodeString str  ) 
 

double VCF::Locale::toDouble const UnicodeString str  ) 
 

double VCF::Locale::toDoubleAsCurrency const UnicodeString str  ) 
 

float VCF::Locale::toFloat const UnicodeString str  ) 
 

int VCF::Locale::toInt const UnicodeString str  ) 
 

Converts a string to a integer.

UnicodeString VCF::Locale::toLowerCase const UnicodeString s  ) 
 

Transforms all alpha numeric characters in a string to lower case.

    Locale loc("en","US");
    UnicodeString lowerCaseStr = loc.toLowerCase("ABC Defg 123 HIJKLM");
    //lowerCaseStr equals "abc defg 123 hijklm"
Returns:
UnicodeString the new string with all lower case characters

UnicodeString VCF::Locale::toString const float &  val  ) 
 

UnicodeString VCF::Locale::toString const double &  val  ) 
 

UnicodeString VCF::Locale::toString const unsigned long &  val  ) 
 

UnicodeString VCF::Locale::toString const long &  val  ) 
 

UnicodeString VCF::Locale::toString const unsigned int &  val  ) 
 

UnicodeString VCF::Locale::toString const int &  val  ) 
 

converts the integer val into a UnicodeString.

For example:

    Locale loc("it", "IT" );

    UnicodeString numStr = loc.toString( 12345678 );
    //numStr will equal "12.345.678" since italy uses the "." as a decimal separator.
Parameters:
int the value to convert
Returns:
UnicodeString the value as a string, taking into consideration any formatting rules of the locale.
See also:
getNumberDecimalPoint()

UnicodeString VCF::Locale::toStringFromCurrency const double &  val  ) 
 

Converts a double currency value into a string.

UnicodeString VCF::Locale::toStringFromDate const DateTime val,
const UnicodeString format = ""
 

converts a date/time instance into a string representing the date portion of the DateTime instance.

For example:

    Locale loc("it", "IT" );

    DateTime aDate(11,12,1969);

    UnicodeString datStr = loc.toStringFromDate( aDate );

You can also format the string that is output by using the following codes. Note that the case of the codes must be preserved, i.e. "dd", not "DD".
ValueMeaning
dThe day of the month (1-31) with no leading zero.
ddThe day of the month (01-31) with leading zero.
dddThe day of the week as an abbreviated string ("Mon", "Tue", etc).
ddddThe day of the week as a string, fully spelled out ("Monday", "Tuesday", etc).
MThe month as a number (1-12) with no leading zero.
MMThe month as a number (01-12) <string>with leading zero.
MMMThe month as an abbreviated string ("Jul", "Aug", etc).
MMMMThe month as string, fully spelled out ("July", "August", etc).
yThe last 2 digits of the year with no leading zero if the value is less than 10.
yyThe last 2 digits of the year with a leading zero.
yyyyThe year with all 4 (or more) digits.
An example of this:

    Locale loc("en", "US" );

    DateTime aDate(12,11,1969);

    UnicodeString datStr = loc.toStringFromDate( aDate, "dddd, MMM d yyyy" );
    //datStr will equal "Saturday, Nov 12 1969"
Returns:
UnicodeString the new string instance of a date

UnicodeString VCF::Locale::toStringFromTime const DateTime val,
const UnicodeString format = ""
 

converts a date/time instance into a string representing the time portion of the DateTime instance.

For example:

    Locale loc("it", "IT" );

    DateTime aDate(11,12,1969,14,34,45);

    UnicodeString datStr = loc.toStringFromTime( aDate );
    //datStr = "14.34.45"

You can also format the string that is output by using the following codes. Note that the case of the codes must be preserved, i.e. "dd", not "DD".
ValueMeaning
hThe hour as a number (0-12) with no leading zero, and a 12 hour clock.
hhThe hour as a number (00-12) with leading zero, and a 12 hour clock.
HThe hour as a number (0-23) with no leading zero, and a 24 hour clock
HHThe hour as a number (00-23) with leading zero, and a 24 hour clock.
mThe minute as a number (0-59) with no leading zero.
mmThe minute as a number (00-59) with leading zero.
sThe second as a number (0-59) with no leading zero.
ssThe second as a number (00-59) with leading zero.

An example of this:

    Locale loc("en", "US" );

    DateTime aDate(11,12,1969,14,34,45);

    UnicodeString timeStr = loc.toStringFromDate( aDate, "h:mm:ss" );
    //timeStr will equal "2:34:45"
Returns:
UnicodeString the new string instance of a date

unsigned int VCF::Locale::toUInt const UnicodeString str  ) 
 

UnicodeString VCF::Locale::toUpperCase const UnicodeString s  ) 
 

Transforms all alpha numeric characters in a string to upper case.

    Locale loc("en","US");
    UnicodeString lowerCaseStr = loc.toUpperCase("ABC Defg 123 HIJKLM");
    //lowerCaseStr equals "ABC DEFG 123 HIJKLM"

Returns:
UnicodeString the new string with all upper case characters

UnicodeString VCF::Locale::translate const UnicodeString id  ) 
 


Member Data Documentation

UnicodeString::LanguageEncoding VCF::Locale::encoding_ [protected]
 

LocalePeer* VCF::Locale::peer_ [protected]
 


The documentation for this class was generated from the following file:
   Comments or Suggestions?    License Information