Subclause | Header | ||
Locales | <locale> | ||
Standard locale categories | |||
C library locales | <clocale> |
using category = int;
Category | Includes facets | |
collate | collate<char>, collate<wchar_t> | |
ctype | ctype<char>, ctype<wchar_t> | |
codecvt<char, char, mbstate_t> | ||
codecvt<char16_t, char8_t, mbstate_t> | ||
codecvt<char32_t, char8_t, mbstate_t> | ||
codecvt<wchar_t, char, mbstate_t> | ||
monetary | moneypunct<char>, moneypunct<wchar_t> | |
moneypunct<char, true>, moneypunct<wchar_t, true> | ||
money_get<char>, money_get<wchar_t> | ||
money_put<char>, money_put<wchar_t> | ||
numeric | numpunct<char>, numpunct<wchar_t> | |
num_get<char>, num_get<wchar_t> | ||
num_put<char>, num_put<wchar_t> | ||
time | time_get<char>, time_get<wchar_t> | |
time_put<char>, time_put<wchar_t> | ||
messages | messages<char>, messages<wchar_t> |
Category | Includes facets | |
collate | collate_byname<char>, collate_byname<wchar_t> | |
ctype | ctype_byname<char>, ctype_byname<wchar_t> | |
codecvt_byname<char, char, mbstate_t> | ||
codecvt_byname<char16_t, char8_t, mbstate_t> | ||
codecvt_byname<char32_t, char8_t, mbstate_t> | ||
codecvt_byname<wchar_t, char, mbstate_t> | ||
monetary | moneypunct_byname<char, International> | |
moneypunct_byname<wchar_t, International> | ||
money_get<C, InputIterator> | ||
money_put<C, OutputIterator> | ||
numeric | numpunct_byname<char>, numpunct_byname<wchar_t> | |
num_get<C, InputIterator>, num_put<C, OutputIterator> | ||
time | time_get<char, InputIterator> | |
time_get_byname<char, InputIterator> | ||
time_get<wchar_t, InputIterator> | ||
time_get_byname<wchar_t, InputIterator> | ||
time_put<char, OutputIterator> | ||
time_put_byname<char, OutputIterator> | ||
time_put<wchar_t, OutputIterator> | ||
time_put_byname<wchar_t, OutputIterator> | ||
messages | messages_byname<char>, messages_byname<wchar_t> |
locale() noexcept;
explicit locale(const char* std_name);
explicit locale(const string& std_name);
locale(const locale& other, const char* std_name, category cats);
locale(const locale& other, const string& std_name, category cats);
template<class Facet> locale(const locale& other, Facet* f);
locale(const locale& other, const locale& one, category cats);
const locale& operator=(const locale& other) noexcept;
template<class Facet> locale combine(const locale& other) const;
string name() const;
bool operator==(const locale& other) const;
template<class charT, class traits, class Allocator>
bool operator()(const basic_string<charT, traits, Allocator>& s1,
const basic_string<charT, traits, Allocator>& s2) const;
static locale global(const locale& loc);
static const locale& classic();
template<class Facet> const Facet& use_facet(const locale& loc);
template<class Facet> bool has_facet(const locale& loc) noexcept;
template<class charT> bool isspace (charT c, const locale& loc);
template<class charT> bool isprint (charT c, const locale& loc);
template<class charT> bool iscntrl (charT c, const locale& loc);
template<class charT> bool isupper (charT c, const locale& loc);
template<class charT> bool islower (charT c, const locale& loc);
template<class charT> bool isalpha (charT c, const locale& loc);
template<class charT> bool isdigit (charT c, const locale& loc);
template<class charT> bool ispunct (charT c, const locale& loc);
template<class charT> bool isxdigit(charT c, const locale& loc);
template<class charT> bool isalnum (charT c, const locale& loc);
template<class charT> bool isgraph (charT c, const locale& loc);
template<class charT> bool isblank (charT c, const locale& loc);
bool is(mask m, charT c) const;
const charT* is(const charT* low, const charT* high, mask* vec) const;
const charT* scan_is(mask m, const charT* low, const charT* high) const;
const charT* scan_not(mask m, const charT* low, const charT* high) const;
charT toupper(charT) const;
const charT* toupper(charT* low, const charT* high) const;
charT tolower(charT c) const;
const charT* tolower(charT* low, const charT* high) const;
charT widen(char c) const;
const char* widen(const char* low, const char* high, charT* to) const;
char narrow(charT c, char dfault) const;
const charT* narrow(const charT* low, const charT* high, char dfault, char* to) const;
bool do_is(mask m, charT c) const;
const charT* do_is(const charT* low, const charT* high, mask* vec) const;
const charT* do_scan_is(mask m, const charT* low, const charT* high) const;
const charT* do_scan_not(mask m, const charT* low, const charT* high) const;
charT do_toupper(charT c) const;
const charT* do_toupper(charT* low, const charT* high) const;
charT do_tolower(charT c) const;
const charT* do_tolower(charT* low, const charT* high) const;
charT do_widen(char c) const;
const char* do_widen(const char* low, const char* high, charT* dest) const;
char do_narrow(charT c, char dfault) const;
const charT* do_narrow(const charT* low, const charT* high, char dfault, char* dest) const;
~ctype();
explicit ctype(const mask* tbl = nullptr, bool del = false, size_t refs = 0);
bool is(mask m, char c) const;
const char* is(const char* low, const char* high, mask* vec) const;
const char* scan_is(mask m, const char* low, const char* high) const;
const char* scan_not(mask m, const char* low, const char* high) const;
char toupper(char c) const;
const char* toupper(char* low, const char* high) const;
char tolower(char c) const;
const char* tolower(char* low, const char* high) const;
char widen(char c) const;
const char* widen(const char* low, const char* high, char* to) const;
char narrow(char c, char dfault) const;
const char* narrow(const char* low, const char* high, char dfault, char* to) const;
const mask* table() const noexcept;
static const mask* classic_table() noexcept;
result out(
stateT& state,
const internT* from, const internT* from_end, const internT*& from_next,
externT* to, externT* to_end, externT*& to_next) const;
result unshift(stateT& state, externT* to, externT* to_end, externT*& to_next) const;
result in(
stateT& state,
const externT* from, const externT* from_end, const externT*& from_next,
internT* to, internT* to_end, internT*& to_next) const;
int encoding() const noexcept;
bool always_noconv() const noexcept;
int length(stateT& state, const externT* from, const externT* from_end, size_t max) const;
int max_length() const noexcept;
result do_out(
stateT& state,
const internT* from, const internT* from_end, const internT*& from_next,
externT* to, externT* to_end, externT*& to_next) const;
result do_in(
stateT& state,
const externT* from, const externT* from_end, const externT*& from_next,
internT* to, internT* to_end, internT*& to_next) const;
Value | Meaning | |
ok | completed the conversion | |
partial | not all source characters converted | |
error | encountered a character in [from, from_end)
that cannot be converted | |
noconv | internT and externT are the same type, and input
sequence is identical to converted sequence |
result do_unshift(stateT& state, externT* to, externT* to_end, externT*& to_next) const;
Value | Meaning | |
ok | completed the sequence | |
partial | space for more than to_end - to destination elements was needed
to terminate a sequence given the value of state | |
error | an unspecified error has occurred | |
noconv | no termination is needed for this state_type |
int do_encoding() const noexcept;
bool do_always_noconv() const noexcept;
int do_length(stateT& state, const externT* from, const externT* from_end, size_t max) const;
int do_max_length() const noexcept;
iter_type get(iter_type in, iter_type end, ios_base& str,
ios_base::iostate& err, bool& val) const;
iter_type get(iter_type in, iter_type end, ios_base& str,
ios_base::iostate& err, long& val) const;
iter_type get(iter_type in, iter_type end, ios_base& str,
ios_base::iostate& err, long long& val) const;
iter_type get(iter_type in, iter_type end, ios_base& str,
ios_base::iostate& err, unsigned short& val) const;
iter_type get(iter_type in, iter_type end, ios_base& str,
ios_base::iostate& err, unsigned int& val) const;
iter_type get(iter_type in, iter_type end, ios_base& str,
ios_base::iostate& err, unsigned long& val) const;
iter_type get(iter_type in, iter_type end, ios_base& str,
ios_base::iostate& err, unsigned long long& val) const;
iter_type get(iter_type in, iter_type end, ios_base& str,
ios_base::iostate& err, float& val) const;
iter_type get(iter_type in, iter_type end, ios_base& str,
ios_base::iostate& err, double& val) const;
iter_type get(iter_type in, iter_type end, ios_base& str,
ios_base::iostate& err, long double& val) const;
iter_type get(iter_type in, iter_type end, ios_base& str,
ios_base::iostate& err, void*& val) const;
iter_type do_get(iter_type in, iter_type end, ios_base& str,
ios_base::iostate& err, long& val) const;
iter_type do_get(iter_type in, iter_type end, ios_base& str,
ios_base::iostate& err, long long& val) const;
iter_type do_get(iter_type in, iter_type end, ios_base& str,
ios_base::iostate& err, unsigned short& val) const;
iter_type do_get(iter_type in, iter_type end, ios_base& str,
ios_base::iostate& err, unsigned int& val) const;
iter_type do_get(iter_type in, iter_type end, ios_base& str,
ios_base::iostate& err, unsigned long& val) const;
iter_type do_get(iter_type in, iter_type end, ios_base& str,
ios_base::iostate& err, unsigned long long& val) const;
iter_type do_get(iter_type in, iter_type end, ios_base& str,
ios_base::iostate& err, float& val) const;
iter_type do_get(iter_type in, iter_type end, ios_base& str,
ios_base::iostate& err, double& val) const;
iter_type do_get(iter_type in, iter_type end, ios_base& str,
ios_base::iostate& err, long double& val) const;
iter_type do_get(iter_type in, iter_type end, ios_base& str,
ios_base::iostate& err, void*& val) const;
iter_type do_get(iter_type in, iter_type end, ios_base& str,
ios_base::iostate& err, bool& val) const;
iter_type put(iter_type out, ios_base& str, char_type fill, bool val) const;
iter_type put(iter_type out, ios_base& str, char_type fill, long val) const;
iter_type put(iter_type out, ios_base& str, char_type fill, long long val) const;
iter_type put(iter_type out, ios_base& str, char_type fill, unsigned long val) const;
iter_type put(iter_type out, ios_base& str, char_type fill, unsigned long long val) const;
iter_type put(iter_type out, ios_base& str, char_type fill, double val) const;
iter_type put(iter_type out, ios_base& str, char_type fill, long double val) const;
iter_type put(iter_type out, ios_base& str, char_type fill, const void* val) const;
iter_type do_put(iter_type out, ios_base& str, char_type fill, long val) const;
iter_type do_put(iter_type out, ios_base& str, char_type fill, long long val) const;
iter_type do_put(iter_type out, ios_base& str, char_type fill, unsigned long val) const;
iter_type do_put(iter_type out, ios_base& str, char_type fill, unsigned long long val) const;
iter_type do_put(iter_type out, ios_base& str, char_type fill, double val) const;
iter_type do_put(iter_type out, ios_base& str, char_type fill, long double val) const;
iter_type do_put(iter_type out, ios_base& str, char_type fill, const void* val) const;
State | stdio equivalent | |
floatfield == ios_base::fixed | %f | |
floatfield == ios_base::scientific && !uppercase | %e | |
floatfield == ios_base::scientific | %E | |
floatfield == (ios_base::fixed | ios_base::scientific) && !uppercase | %a | |
floatfield == (ios_base::fixed | ios_base::scientific) | %A | |
!uppercase | %g | |
otherwise | %G |
State | Location | |
adjustfield == ios_base::left | pad after | |
adjustfield == ios_base::right | pad before | |
adjustfield == internal and a sign occurs in the representation | pad after the sign | |
adjustfield == internal and representation after stage 1
began with 0x or 0X | pad after x or X | |
otherwise | pad before |
iter_type do_put(iter_type out, ios_base& str, char_type fill, bool val) const;
char_type decimal_point() const;
char_type thousands_sep() const;
string grouping() const;
string_type truename() const;
string_type falsename() const;
char_type do_decimal_point() const;
char_type do_thousands_sep() const;
string do_grouping() const;
string_type do_truename() const;
string_type do_falsename() const;
int compare(const charT* low1, const charT* high1,
const charT* low2, const charT* high2) const;
string_type transform(const charT* low, const charT* high) const;
long hash(const charT* low, const charT* high) const;
int do_compare(const charT* low1, const charT* high1,
const charT* low2, const charT* high2) const;
string_type do_transform(const charT* low, const charT* high) const;
long do_hash(const charT* low, const charT* high) const;
dateorder date_order() const;
iter_type get_time(iter_type s, iter_type end, ios_base& str,
ios_base::iostate& err, tm* t) const;
iter_type get_date(iter_type s, iter_type end, ios_base& str,
ios_base::iostate& err, tm* t) const;
iter_type get_weekday(iter_type s, iter_type end, ios_base& str,
ios_base::iostate& err, tm* t) const;
iter_type get_monthname(iter_type s, iter_type end, ios_base& str,
ios_base::iostate& err, tm* t) const;
iter_type get_year(iter_type s, iter_type end, ios_base& str,
ios_base::iostate& err, tm* t) const;
iter_type get(iter_type s, iter_type end, ios_base& f, ios_base::iostate& err,
tm* t, char format, char modifier = 0) const;
iter_type get(iter_type s, iter_type end, ios_base& f, ios_base::iostate& err,
tm* t, const char_type* fmt, const char_type* fmtend) const;
dateorder do_date_order() const;
iter_type do_get_time(iter_type s, iter_type end, ios_base& str,
ios_base::iostate& err, tm* t) const;
iter_type do_get_date(iter_type s, iter_type end, ios_base& str,
ios_base::iostate& err, tm* t) const;
iter_type do_get_weekday(iter_type s, iter_type end, ios_base& str,
ios_base::iostate& err, tm* t) const;
iter_type do_get_monthname(iter_type s, iter_type end, ios_base& str,
ios_base::iostate& err, tm* t) const;
iter_type do_get_year(iter_type s, iter_type end, ios_base& str,
ios_base::iostate& err, tm* t) const;
iter_type do_get(iter_type s, iter_type end, ios_base& f,
ios_base::iostate& err, tm* t, char format, char modifier) const;
iter_type put(iter_type s, ios_base& str, char_type fill, const tm* t,
const charT* pattern, const charT* pat_end) const;
iter_type put(iter_type s, ios_base& str, char_type fill, const tm* t,
char format, char modifier = 0) const;
iter_type do_put(iter_type s, ios_base&, char_type fill, const tm* t,
char format, char modifier) const;
iter_type get(iter_type s, iter_type end, bool intl, ios_base& f,
ios_base::iostate& err, long double& quant) const;
iter_type get(iter_type s, iter_type end, bool intl, ios_base& f,
ios_base::iostate& err, string_type& quant) const;
iter_type do_get(iter_type s, iter_type end, bool intl, ios_base& str,
ios_base::iostate& err, long double& units) const;
iter_type do_get(iter_type s, iter_type end, bool intl, ios_base& str,
ios_base::iostate& err, string_type& digits) const;
iter_type put(iter_type s, bool intl, ios_base& f, char_type fill, long double quant) const;
iter_type put(iter_type s, bool intl, ios_base& f, char_type fill, const string_type& quant) const;
iter_type do_put(iter_type s, bool intl, ios_base& str,
char_type fill, long double units) const;
iter_type do_put(iter_type s, bool intl, ios_base& str,
char_type fill, const string_type& digits) const;
charT do_decimal_point() const;
charT do_thousands_sep() const;
string do_grouping() const;
string_type do_curr_symbol() const;
string_type do_positive_sign() const;
string_type do_negative_sign() const;
int do_frac_digits() const;
pattern do_pos_format() const;
pattern do_neg_format() const;
catalog open(const string& name, const locale& loc) const;
string_type get(catalog cat, int set, int msgid, const string_type& dfault) const;
void close(catalog cat) const;
catalog do_open(const string& name, const locale& loc) const;
string_type do_get(catalog cat, int set, int msgid, const string_type& dfault) const;
void do_close(catalog cat) const;
fprintf | isprint | iswdigit | localeconv | tolower | |
fscanf | ispunct | iswgraph | mblen | toupper | |
isalnum | isspace | iswlower | mbstowcs | towlower | |
isalpha | isupper | iswprint | mbtowc | towupper | |
isblank | iswalnum | iswpunct | setlocale | wcscoll | |
iscntrl | iswalpha | iswspace | strcoll | wcstod | |
isdigit | iswblank | iswupper | strerror | wcstombs | |
isgraph | iswcntrl | iswxdigit | strtod | wcsxfrm | |
islower | iswctype | isxdigit | strxfrm | wctomb |