Reference
C Library
IOstream Library
Strings library
STL Containers
STL Algorithms
Miscellaneous
Miscellaneous
complex
exception
functional
iterator
limits
locale
memory
new
numeric
stdexcept
typeinfo
utility
valarray
locale
has_facet
isalnum
isalpha
iscntrl
isdigit
isgraph
islower
isprint
ispunct
isspace
isupper
isxdigit
locale
tolower
toupper
use_facet
standard facets:
codecvt
codecvt_base
codecvt_byname
collate
collate_byname
ctype
ctype_base
ctype_byname
messages
messages_base
messages_byname
moneypunct
moneypunct_byname
money_base
money_get
money_put
numpunct
numpunct_byname
num_get
num_put
time_base
time_get
time_get_byname
time_put
time_put_byname
locale
locale::locale
locale::~locale
member functions:
locale::classic
locale::combine
locale::global
locale::name
locale::operator!=
locale::operator()
locale::operator=
locale::operator==
member types:
locale::category
locale::facet
locale::id


locale

class
<locale>
class locale;

Locale class

A locale object encompasses a set of features that are culture-specific, which can be used by programs to enhance international portability (see localization library for more info).

The localization engine, on construction of a locale object, initializes all the facets associated with it (if necessary) and makes them available to the program.

locale objects are generally constructed form a name (the same as the one that would be used with clocale function setlocale), or from another locale object. They can also mix facets from more than one locale object.

Every program has a single locale object which is its global locale. On start, this is the classic locale, but this can be changed using locale::global. This global locale is copied to any locale object constructed with its default constructor.

The global locale also affects the C locale (see clocale function setlocale): When a new named global locale is set with locale::global, the C locale is also modified.

locale objects can be used to access their associated facets in order to use their formatting features. They can also be imbued individually to specific stream objects (such as cin, cout or a file stream) by calling the stream's imbue member function.

See localization library for more information on locales and facets.

Member functions



Member types