Classes | Functions | Variables

i18n Namespace Reference

Classes

struct  locale_t
 simple struct for managing a locale specification More...
class  Manager

Functions

static void loadTable (two_character_map_t &table, char base, const char *name)
static void loadTables (void) throw ()
void getLocaleFromString (const char *localeString, locale_t &locale)
bool isValidCountryCode (const char *code)
bool isValidLanguageCode (const char *code)
bool isValidEncoding (const char *encoding)
const char * getString (const Manager *mgr, const char *id)
const char * getHostLocale (void)
 attempt to determine the local host locale. Can return NULL!
void getLocaleFromString (IN const char *localeString, OUT locale_t &locale)
 given a locale string, of the form "xx_yy.zzzz", returns a locale_t

  • xx: 2 character language code (ISO 639-1)
  • yy: 2 character country code (ISO 3166)
  • zzzz: encoding (arbitrary length, only "UTF-8" is supported right now)

bool isValidCountryCode (IN const char *country_code)
 is this a valid country code? Based on ISO 3166
bool isValidLanguageCode (IN const char *language_code)
 is this a valid language code? Only supports ISO 639-1 (2-character codes) for now.
bool isValidEncoding (IN const char *encoding)
 is this a valid encoding? "valid" means "supported by this library", which for right now is just "UTF-8"
const char * getString (IN const Manager *mgr, IN const char *id)
 returns the string from the given Manager.

Variables

static two_character_map_t s_countryCodes
static two_character_map_t s_languageCodes
static const char * s_resourceNamespace = "i18n"

Function Documentation

static void i18n::loadTable ( two_character_map_t &  table,
char  base,
const char *  name 
) [static]

Definition at line 117 of file i18n.cpp.

static void i18n::loadTables ( void   )  throw () [static]

Definition at line 154 of file i18n.cpp.

void i18n::getLocaleFromString ( const char *  localeString,
locale_t &  locale 
)

Definition at line 524 of file i18n.cpp.

bool i18n::isValidCountryCode ( const char *  code  ) 

Definition at line 545 of file i18n.cpp.

bool i18n::isValidLanguageCode ( const char *  code  ) 

Definition at line 560 of file i18n.cpp.

bool i18n::isValidEncoding ( const char *  encoding  ) 

Definition at line 575 of file i18n.cpp.

const char* i18n::getString ( const Manager *  mgr,
const char *  id 
)

Definition at line 589 of file i18n.cpp.


Variable Documentation

two_character_map_t i18n::s_countryCodes [static]

Definition at line 103 of file i18n.cpp.

two_character_map_t i18n::s_languageCodes [static]

Definition at line 104 of file i18n.cpp.

const char* i18n::s_resourceNamespace = "i18n" [static]

Definition at line 106 of file i18n.cpp.