Aegis  4.25.D505
Functions
/home/archives/aegis/branch.4/branch.25/delta28933.505/libaegis/locale_name.h File Reference
#include <common/nstring.h>

Go to the source code of this file.

Functions

bool is_a_locale_name (const nstring &text)
bool is_a_language_name (const nstring &text)
bool is_a_territory_name (const nstring &text)

Function Documentation

bool is_a_language_name ( const nstring text)

The is_a_language_name is used to test whether or not a string (usually part of a filename) looks like a valid localisation language name.

Lanugae names are defined by iso-639-3 as 2-letter or 3-letter codes, but in practice can be uglier, and sometimes even contain a variety of punctuation characters.

Parameters:
textThe text string to be validated.
Returns:
true if it looks like a valid language name, false if not.
bool is_a_locale_name ( const nstring text)

The is_a_locale_name is used to test whether or not a string (usually a filename component directory) looks like a valid localisation locale name.

Local names have the format

"{language} [ _ {territory} ][ . {charset} ][ '@' {qualifier} ]"

In theory {language} is a 2-letter or 3-letter language code from isoNNNN, but in practice can be uglier, and sometimes even contain "_.@" characters.

In theory {territory} is a 2-letter or 3-letter country code from isoNNNN, but in practice can be uglier, and sometimes even contain "_.@" characters.

Parameters:
textThe text string to be validated.
Returns:
true if it looks like a valid locale name, false if not.
bool is_a_territory_name ( const nstring text)

The is_a_territory_name is used to test whether or not a string (usually part of a filename) looks like a valid localisation territory name.

Territory names are defined by iso-3166-2 as 2-letter or 3-letter codes, but in practice can be uglier, and sometimes even contain a variety of punctuation characters.

Parameters:
textThe text string to be validated.
Returns:
true if it looks like a valid territory name, false if not.