cplusplus.com
C++ : Reference : Miscellaneous : locale : locale : locale
 
cplusplus.com
Information
Documentation
Reference
Articles
Forum
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::locale

public member function
         locale () throw();
         locale (const locale& other) throw();
explicit locale (const char* std_name);
         locale (const locale& other, const char* std_name, category cats);
template <class Facet>
         locale (const locale& other, Facet* f);
         locale (const locale& other, const locale& one, category cats);

Locale constructor

Constructs a locale object.

The default constructor constructs a copy of the current global locale, which is the locale set by a previous call to locale::global, or locale::classic if locale::global has not been called.

Constructors with other as parameter, construct a copy or a partial copy. With the additional parameters, if any, specifying facets not to be copied but redefined instead.

Those with std_name as parameter, take a C-locale name (such as "", "C" or "POSIX").

Parameters

other
Locale whose facets are used by default in the newly constructed locale.
std_name
C-string with a standard C locale name.
When it is the only parameter, the resulting locale implements all the semantics associated with that name.
When it is the second parameter, only the categories specified in cats are used in the resulting locale, taking the rest from parameter other's locale.
If this argument is not valid, runtime_error is thrown.
cats
Set of categories that are used from the locale specified as second parameter. The remaining categories are taken from the locale specified in the first parameter.
locale::category is a bitmask member type that can either be a combination of a set of constant values (see locale::category), or one of the constants defined in the setlocale function of the C-library.
f
Pointer to a facet object (an object derived from locale::facet).
The resulting locale has this specific facet, with the rest of facets being copies of those in parameter other.
The locale object takes over responsibility of deleting this facet object.
one
Locale object from which the facets specified in cats are used, with the remaining facets being taken from those in parameter other.