This header is part of thetext processing library.
Classes | ||
set of polymorphic facets that encapsulate cultural differences (class)[edit] | ||
String and stream conversions | ||
(C++11)(deprecated in C++17)(removed in C++26) | performs conversions between a wide string and a byte string (class template)[edit] | |
(C++11)(deprecated in C++17)(removed in C++26) | performs conversion between a byte stream buffer and a wide stream buffer (class template)[edit] | |
Facet category base classes | ||
defines character classification categories (class)[edit] | ||
defines character conversion errors (class)[edit] | ||
defines messages catalog type (class)[edit] | ||
defines date format constants (class)[edit] | ||
defines monetary formatting patterns (class)[edit] | ||
Facet categories | ||
defines character classification tables (class template)[edit] | ||
specialization ofstd::ctype for typechar (class template specialization)[edit] | ||
converts between character encodings, including UTF-8, UTF-16, UTF-32 (class template)[edit] | ||
defines lexicographical comparison and hashing of strings (class template)[edit] | ||
implements retrieval of strings from message catalogs (class template)[edit] | ||
parses time/date values from an input character sequence intostd::tm (class template)[edit] | ||
formats contents ofstd::tm for output as character sequence (class template)[edit] | ||
parses numeric values from an input character sequence (class template)[edit] | ||
formats numeric values for output as character sequence (class template)[edit] | ||
defines numeric punctuation rules (class template)[edit] | ||
parses and constructs a monetary value from an input character sequence (class template)[edit] | ||
formats a monetary value for output as a character sequence (class template)[edit] | ||
defines monetary formatting parameters used bystd::money_get andstd::money_put (class template)[edit] | ||
Locale-specific facet categories | ||
represents the system-suppliedstd::ctype for the named locale (class template)[edit] | ||
represents the system-suppliedstd::codecvt for the named locale (class template)[edit] | ||
represents the system-suppliedstd::messages for the named locale (class template)[edit] | ||
represents the system-suppliedstd::collate for the named locale (class template)[edit] | ||
represents the system-suppliedstd::time_get for the named locale (class template)[edit] | ||
represents the system-suppliedstd::time_put for the named locale (class template)[edit] | ||
represents the system-suppliedstd::numpunct for the named locale (class template)[edit] | ||
represents the system-suppliedstd::moneypunct for the named locale (class template)[edit] | ||
Functions | ||
Locales and facets | ||
obtains a facet from a locale (function template)[edit] | ||
checks if a locale implements a specific facet (function template)[edit] | ||
Character classification | ||
checks if a character is classified as whitespace by a locale (function template)[edit] | ||
(C++11) | checks if a character is classified as a blank character by a locale (function template)[edit] | |
checks if a character is classified as a control character by a locale (function template)[edit] | ||
checks if a character is classified as uppercase by a locale (function template)[edit] | ||
checks if a character is classified as lowercase by a locale (function template)[edit] | ||
checks if a character is classified as alphabetic by a locale (function template)[edit] | ||
checks if a character is classified as a digit by a locale (function template)[edit] | ||
checks if a character is classified as punctuation by a locale (function template)[edit] | ||
checks if a character is classified as a hexadecimal digit by a locale (function template)[edit] | ||
checks if a character is classified as alphanumeric by a locale (function template)[edit] | ||
checks if a character is classified as printable by a locale (function template)[edit] | ||
checks if a character is classified as graphical by a locale (function template)[edit] | ||
Character conversions | ||
converts a character to uppercase using the ctype facet of a locale (function template)[edit] | ||
converts a character to lowercase using thectype facet of a locale(function template)[edit] |
namespace std{ // locale:class locale;template<class Facet>const Facet& use_facet(const locale&);template<class Facet>bool has_facet(const locale&)noexcept; // convenience interfaces: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> CharT toupper(CharT c,const locale& loc);template<class CharT> CharT tolower(CharT c,const locale& loc);template<class Codecvt,class Elem=wchar_t,class Wide_alloc=std::allocator<Elem>,class Byte_alloc=std::allocator<char>>class wstring_convert;template<class Codecvt,class Elem=wchar_t,class Tr= char_traits<Elem>>class wbuffer_convert; // ctype:class ctype_base;template<class CharT>class ctype;template<>class ctype<char>;// specializationtemplate<class CharT>class ctype_byname;class codecvt_base;template<class internT,class externT,class stateT>class codecvt;template<class internT,class externT,class stateT>class codecvt_byname; // numeric:template<class CharT,class InputIter= istreambuf_iterator<CharT>>class num_get;template<class CharT,class OutputIter= osterambuf_iterator<CharT>>class num_put;template<class CharT>class numpunct;template<class CharT>class numpunct_byname; // collation:template<class CharT>class collate;template<class CharT>class collate_byname; // date and time:class time_base;template<class CharT,class InputIter= istreambuf_iterator<CharT>>class time_get;template<class CharT,class InputIter>= istreambuf_iterator<CharT>>class time_get_byname;template<class CharT,class OutputIter>= ostreambuf_iterator<CharT>>class time_put;template<class CharT,class OutputIter>= ostreambuf_iterator<CharT>>class time_put_byname; // money:class money_base;template<class CharT,class InputIter= istreambuf_iterator<CharT>>>class money_get;template<class CharT,class OutputIter= ostreambuf_iterator<CharT>>>class money_put;template<class CharT,bool Intl=false>class moneypunct;template<class CharT,bool Intl=false>class moneypunct_byname; // message retrieval:class messages_base;template<class CharT>class messages;template<class CharT>class messages_byname;}
class locale{public:// types:class facet;class id;typedefint category;staticconst category// values assigned here are for exposition only none=0, collate=0x010, ctype=0x020, monetary=0x040, numeric=0x080, time=0x100, messages=0x200, all= collate| ctype| monetary| numeric| time| messages; // construct/copy/destroy: locale()noexcept; locale(const locale& other)noexcept;explicit locale(constchar* std_name);explicit locale(const string& std_name); locale(const locale& other,constchar* std_name, category); locale(const locale& other,const string& std_name, category);template<class Facet> locale(const locale& other, Facet* f); locale(const locale& other,const locale& one, category); ~locale(); // not virtualconst locale& operator=(const locale& other)noexcept;template<class Facet> locale combine(const locale& other)const; // locale operations: basic_string<char> name()const;bool operator==(const locale& other)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; // global locale objects:static locale global(const locale&);staticconst locale& classic();};
class ctype_base{public:typedef/*bitmask-type*/ mask; // numeric values are for exposition only.staticconst mask space=1<<0;staticconst mask print=1<<1;staticconst mask cntrl=1<<2;staticconst mask upper=1<<3;staticconst mask lower=1<<4;staticconst mask alpha=1<<5;staticconst mask digit=1<<6;staticconst mask punct=1<<7;staticconst mask xdigit=1<<8;staticconst mask blank=1<<9;staticconst mask alnum= alpha| digit;staticconst mask graph= alnum| punct;};
template<class CharT>class ctype:public locale::facet,public ctype_base{public:typedef CharT char_type; explicit ctype(size_t refs=0); 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 c)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;constchar* widen(constchar* low,constchar* high, CharT* to)const;char narrow(CharT c,char dfault)const;const CharT* narrow(const CharT* low,const CharT*,char dfault,char* to)const; static locale::id id; protected: ~ctype();virtualbool do_is(mask m, CharT c)const;virtualconst CharT* do_is(const CharT* low,const CharT* high, mask* vec)const;virtualconst CharT* do_scan_is(mask m,const CharT* low,const CharT* high)const;virtualconst CharT* do_scan_not(mask m,const CharT* low,const CharT* high)const; virtual CharT do_toupper(CharT)const;virtualconst CharT* do_toupper(CharT* low,const CharT* high)const;virtual CharT do_tolower(CharT)const;virtualconst CharT* do_tolower(CharT* low,const CharT* high)const;virtual CharT do_widen(char)const;virtualconstchar* do_widen(constchar* low,constchar* high, CharT* dest)const;virtualchar do_narrow(CharT,char dfault)const;virtualconst CharT* do_narrow(const CharT* low,const CharT* high,char dfault,char* dest)const;};
template<class CharT>class ctype_byname:public ctype<CharT>{public:typedeftypename ctype<CharT>::mask mask;explicit ctype_byname(constchar*, size_t refs=0);explicit ctype_byname(const string&, size_t refs=0);protected: ~ctype_byname();};
template<>class ctype<char>:public locale::facet,public ctype_base{public:typedefchar char_type;explicit ctype(const mask* tab=0,bool del=false, size_t refs=0);bool is(mask m,char c)const;constchar* is(constchar* low,constchar* high, mask* vec)const;constchar* scan_is(mask m,constchar* low,constchar* high)const;constchar* scan_not(mask m,constchar* low,constchar* high)const;char toupper(char c)const;constchar* toupper(char* low,constchar* high)const;char tolower(char c)const;constchar* tolower(char* low,constchar* high)const;char widen(char c)const;constchar* widen(constchar* low,constchar* high,char* to)const;char narrow(char c,char dfault)const;constchar* narrow(constchar* low,constchar* high,char dfault,char* to)const; static locale::id id; staticconst size_t table_size=/* implementation-defined */;const mask* table()constnoexcept;staticconst mask* classic_table()noexcept; protected: ~ctype();virtualchar do_toupper(char c)const;virtualconstchar* do_toupper(char* low,constchar* high)const;virtualchar do_tolower(char c)const;virtualconstchar* do_tolower(char* low,constchar* high)const;virtualchar do_widen(char c)const;virtualconstchar* do_widen(constchar* low,constchar* high,char* to)const;virtualchar do_narrow(char c,char dfault)const;virtualconstchar* do_narrow(constchar* low,constchar* high,char dfault,char* to)const;};
class codecvt_base{public:enum result{ ok, partial, error, noconv};};
template<class internT,class externT,class stateT>class codecvt:public locale::facet,public codecvt_base{public:typedef internT intern_type;typedef externT extern_type;typedef stateT state_type;explicit codecvt(size_t refs=0); 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()constnoexcept;bool always_noconv()constnoexcept;int length(stateT&,const externT* from,const externT* end, size_t max)const;int max_length()constnoexcept;static locale::id id;protected: ~codecvt();virtual 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;virtual 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;virtual result do_unshift(stateT& state, externT* to, externT* to_end, externT*& to_next)const;virtualint do_encoding()constnoexcept;virtualbool do_always_noconv()constnoexcept;virtualint do_length(stateT&,const externT* from,const externT* end, size_t max)const;virtualint do_max_length()constnoexcept;};
template<class internT,class externT,class stateT>class codecvt_byname:public codecvt<internT, externT, stateT>{public:explicit codecvt_byname(constchar*, size_t refs=0);explicit codecvt_byname(const string&, size_t refs=0);protected: ~codecvt_byname();};
template<class CharT,class InputIter= istreambuf_iterator<CharT>>class num_get:public locale::facet{public:typedef CharT char_type;typedef InputIter iter_type;explicit num_get(size_t refs=0); iter_type get(iter_type in, iter_type end, ios_base&, ios_base::iostate& err,bool& v)const; iter_type get(iter_type in, iter_type end, ios_base&, ios_base::iostate& err,long& v)const; iter_type get(iter_type in, iter_type end, ios_base&, ios_base::iostate& err,longlong& v)const; iter_type get(iter_type in, iter_type end, ios_base&, ios_base::iostate& err,unsignedshort& v)const; iter_type get(iter_type in, iter_type end, ios_base&, ios_base::iostate& err,unsignedint& v)const; iter_type get(iter_type in, iter_type end, ios_base&, ios_base::iostate& err,unsignedlong& v)const; iter_type get(iter_type in, iter_type end, ios_base&, ios_base::iostate& err,unsignedlonglong& v)const; iter_type get(iter_type in, iter_type end, ios_base&, ios_base::iostate& err,float& v)const; iter_type get(iter_type in, iter_type end, ios_base&, ios_base::iostate& err,double& v)const; iter_type get(iter_type in, iter_type end, ios_base&, ios_base::iostate& err,longdouble& v)const; iter_type get(iter_type in, iter_type end, ios_base&, ios_base::iostate& err,void*& v)const; static locale::id id; protected: ~num_get(); virtual iter_type do_get(iter_type, iter_type, ios_base&, ios_base::iostate& err,bool& v)const;virtual iter_type do_get(iter_type, iter_type, ios_base&, ios_base::iostate& err,long& v)const;virtual iter_type do_get(iter_type, iter_type, ios_base&, ios_base::iostate& err,longlong& v)const;virtual iter_type do_get(iter_type, iter_type, ios_base&, ios_base::iostate& err,unsignedshort& v)const;virtual iter_type do_get(iter_type, iter_type, ios_base&, ios_base::iostate& err,unsignedint& v)const;virtual iter_type do_get(iter_type, iter_type, ios_base&, ios_base::iostate& err,unsignedlong& v)const;virtual iter_type do_get(iter_type, iter_type, ios_base&, ios_base::iostate& err,unsignedlonglong& v)const;virtual iter_type do_get(iter_type, iter_type, ios_base&, ios_base::iostate& err,float& v)const;virtual iter_type do_get(iter_type, iter_type, ios_base&, ios_base::iostate& err,double& v)const;virtual iter_type do_get(iter_type, iter_type, ios_base&, ios_base::iostate& err,longdouble& v)const;virtual iter_type do_get(iter_type, iter_type, ios_base&, ios_base::iostate& err,void*& v)const;};
template<class CharT,class OutputIter= ostreambuf_iterator<CharT>>class num_put:public locale::facet{public:typedef CharT char_type;typedef OutputIter iter_type; explicit num_put(size_t refs=0); iter_type put(iter_type s, ios_base& f, char_type fill,bool v)const; iter_type put(iter_type s, ios_base& f, char_type fill,long v)const; iter_type put(iter_type s, ios_base& f, char_type fill,longlong v)const; iter_type put(iter_type s, ios_base& f, char_type fill,unsignedlong v)const; iter_type put(iter_type s, ios_base& f, char_type fill,unsignedlonglong v)const; iter_type put(iter_type s, ios_base& f, char_type fill,double v)const; iter_type put(iter_type s, ios_base& f, char_type fill,longdouble v)const; iter_type put(iter_type s, ios_base& f, char_type fill,constvoid* v)const; static locale::id id; protected: ~num_put(); virtual iter_type do_put(iter_type, ios_base&, char_type fill,bool v)const;virtual iter_type do_put(iter_type, ios_base&, char_type fill,long v)const;virtual iter_type do_put(iter_type, ios_base&, char_type fill,longlong v)const;virtual iter_type do_put(iter_type, ios_base&, char_type fill,unsignedlong)const;virtual iter_type do_put(iter_type, ios_base&, char_type fill,unsignedlonglong)const;virtual iter_type do_put(iter_type, ios_base&, char_type fill,double v)const;virtual iter_type do_put(iter_type, ios_base&, char_type fill,longdouble v)const;virtual iter_type do_put(iter_type, ios_base&, char_type fill,constvoid* v)const;};
template<class CharT>class numpunct:public locale::facet{public:typedef CharT char_type;typedef basic_string<CharT> string_type; explicit numpunct(size_t refs=0); char_type decimal_point()const; char_type thousands_sep()const; string grouping()const; string_type truename()const; string_type falsename()const; static locale::id id; protected: ~numpunct();// virtual virtual char_type do_decimal_point()const;virtual char_type do_thousands_sep()const;virtual string do_grouping()const;virtual string_type do_truename()const;// for boolvirtual string_type do_falsename()const;// for bool};
template<class CharT>class numpunct_byname:public numpunct<CharT>{public:typedef CharT char_type;typedef basic_string<CharT> string_type; explicit numpunct_byname(constchar*, size_t refs=0);explicit numpunct_byname(const string&, size_t refs=0); protected: ~numpunct_byname();};
template<class CharT>class collate:public locale::facet{public:typedef CharT char_type;typedef basic_string<CharT> string_type; explicit collate(size_t refs=0); 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; static locale::id id; protected: ~collate(); virtualint do_compare(const CharT* low1,const CharT* high1,const CharT* low2,const CharT* high2)const;virtual string_type do_transform(const CharT* low,const CharT* high)const;virtuallong do_hash(const CharT* low,const CharT* high)const;};
template<class CharT>class collate_byname:public collate<CharT>{public:typedef basic_string<CharT> string_type; explicit collate_byname(constchar*, size_t refs=0);explicit collate_byname(const string&, size_t refs=0); protected: ~collate_byname();};
class time_base{public:enum dateorder{ no_order, dmy, mdy, ymd, ydm};};
template<class CharT,class InputIter= istreambuf_iterator<CharT>>class time_get:public locale::facet,public time_base{public:typedef CharT char_type;typedef InputIter iter_type; explicit time_get(size_t refs=0); dateorder date_order()const; iter_type get_time(iter_type s, iter_type end, ios_base& f, ios_base::iostate& err, tm* t)const; iter_type get_date(iter_type s, iter_type end, ios_base& f, ios_base::iostate& err, tm* t)const; iter_type get_weekday(iter_type s, iter_type end, ios_base& f, ios_base::iostate& err, tm* t)const; iter_type get_monthname(iter_type s, iter_type end, ios_base& f, ios_base::iostate& err, tm* t)const; iter_type get_year(iter_type s, iter_type end, ios_base& f, 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; static locale::id id; protected: ~time_get(); virtual dateorder do_date_order()const;virtual iter_type do_get_time(iter_type s, iter_type end, ios_base&, ios_base::iostate& err, tm* t)const;virtual iter_type do_get_date(iter_type s, iter_type end, ios_base&, ios_base::iostate& err, tm* t)const;virtual iter_type do_get_weekday(iter_type s, iter_type end, ios_base&, ios_base::iostate& err, tm* t)const;virtual iter_type do_get_monthname(iter_type s, iter_type end, ios_base&, ios_base::iostate& err, tm* t)const;virtual iter_type do_get_year(iter_type s, iter_type end, ios_base&, ios_base::iostate& err, tm* t)const;virtual iter_type do_get(iter_type s, iter_type end, ios_base& f, ios_base::iostate& err, tm* t,char format,char modifier)const;};
template<class CharT,class InputIter= istreambuf_iterator<CharT>>class time_get_byname:public time_get<CharT, InputIter>{public:typedef time_base::dateorder dateorder;typedef InputIter iter_type; explicit time_get_byname(constchar*, size_t refs=0);explicit time_get_byname(const string&, size_t refs=0); protected: ~time_get_byname();};
template<class CharT,class OutputIter= ostreambuf_iterator<CharT>>class time_put:public locale::facet{public:typedef CharT char_type;typedef OutputIter iter_type; explicit time_put(size_t refs=0); // the following is implemented in terms of other member functions. iter_type put(iter_type s, ios_base& f, char_type fill,const tm* tmb,const CharT* pattern,const CharT* pat_end)const; iter_type put(iter_type s, ios_base& f, char_type fill,const tm* tmb,char format,char modifier=0)const; static locale::id id; protected: ~time_put(); virtual iter_type do_put(iter_type s, ios_base&, char_type,const tm* t,char format,char modifier)const;};
template<class CharT,class OutputIter= ostreambuf_iterator<CharT>>class time_put_byname:public time_put<CharT, OutputIter>{public:typedef CharT char_type;typedef OutputIter iter_type; explicit time_put_byname(constchar*, size_t refs=0);explicit time_put_byname(const string&, size_t refs=0); protected: ~time_put_byname();};
template<class CharT,class InputIter= istreambuf_iterator<CharT>>class money_get:public locale::facet{public:typedef CharT char_type;typedef InputIter iter_type;typedef basic_string<CharT> string_type; explicit money_get(size_t refs=0); iter_type get(iter_type s, iter_type end,bool intl, ios_base& f, ios_base::iostate& err,longdouble& units)const; iter_type get(iter_type s, iter_type end,bool intl, ios_base& f, ios_base::iostate& err, string_type& digits)const; static locale::id id; protected: ~money_get(); virtual iter_type do_get(iter_type, iter_type,bool, ios_base&, ios_base::iostate& err,longdouble& units)const;virtual iter_type do_get(iter_type, iter_type,bool, ios_base&, ios_base::iostate& err, string_type& digits)const;};
template<class CharT,class OutputIter= ostreambuf_iterator<CharT>>class money_put:public locale::facet{public:typedef CharT char_type;typedef OutputIter iter_type;typedef basic_string<CharT> string_type; explicit money_put(size_t refs=0); iter_type put(iter_type s,bool intl, ios_base& f, char_type fill,longdouble units)const; iter_type put(iter_type s,bool intl, ios_base& f, char_type fill,const string_type& digits)const; static locale::id id; protected: ~money_put(); virtual iter_type do_put(iter_type,bool, ios_base&, char_type fill,longdouble units)const;virtual iter_type do_put(iter_type,bool, ios_base&, char_type fill,const string_type& digits)const;};
class money_base{public:enum part{ none, space, symbol, sign, value};struct pattern{char field[4];};};
template<class CharT,bool International=false>class moneypunct:public locale::facet,public money_base{public:typedef CharT char_type;typedef basic_string<CharT> string_type; explicit moneypunct(size_t refs=0); CharT decimal_point()const; CharT thousands_sep()const; string grouping()const; string_type curr_symbol()const; string_type positive_sign()const; string_type negative_sign()const;int frac_digits()const; pattern pos_format()const; pattern neg_format()const; static locale::id id;staticconstbool intl= International; protected: ~moneypunct(); virtual CharT do_decimal_point()const;virtual CharT do_thousands_sep()const;virtual string do_grouping()const;virtual string_type do_curr_symbol()const;virtual string_type do_positive_sign()const;virtual string_type do_negative_sign()const;virtualint do_frac_digits()const;virtual pattern do_pos_format()const;virtual pattern do_neg_format()const;};
template<class CharT,bool Intl=false>class moneypunct_byname:public moneypunct<CharT, Intl>{public:typedef money_base::pattern pattern;typedef basic_string<CharT> string_type; explicit moneypunct_byname(constchar*, size_t refs=0);explicit moneypunct_byname(const string&, size_t refs=0); protected: ~moneypunct_byname();};
class messages_base{public:typedef/* unspecified signed integer type */ catalog;};
template<class CharT>class messages:public locale::facet,public messages_base{public:typedef CharT char_type;typedef basic_string<CharT> string_type; explicit messages(size_t refs=0); catalog open(const basic_string<char>& fn,const locale&)const; string_type get(catalog c,int set,int msgid,const string_type& dfault)const;void close(catalog c)const; static locale::id id; protected: ~messages(); virtual catalog do_open(const basic_string<char>&,const locale&)const;virtual string_type do_get(catalog,int set,int msgid,const string_type& dfault)const;virtualvoid do_close(catalog)const;};
template<class CharT>class messages_byname:public messages<CharT>{public:typedef messages_base::catalog catalog;typedef basic_string<CharT> string_type; explicit messages_byname(constchar*, size_t refs=0);explicit messages_byname(const string&, size_t refs=0); protected: ~messages_byname();};
template<class Codecvt,class Elem=wchar_t,class Wide_alloc=std::allocator<Elem>,class Byte_alloc=std::allocator<char>>class wstring_convert{public:typedefstd::basic_string<char, char_traits<char>, Byte_alloc> byte_string;typedefstd::basic_string<Elem, char_traits<Elem>, Wide_alloc> wide_string;typedeftypename Codecvt::state_type state_type;typedeftypename wide_string::traits_type::int_type int_type; explicit wstring_convert(Codecvt* pcvt= new Codecvt); wstring_convert(Codecvt* pcvt, state_type state);explicit wstring_convert(const byte_string& byte_err,const wide_string& wide_err= wide_string()); ~wstring_convert(); wstring_convert(const wstring_convert&)= delete; wstring_convert& operator=(const wstring_convert&)= delete; wide_string from_bytes(char byte); wide_string from_bytes(constchar* ptr); wide_string from_bytes(const byte_string& str); wide_string from_bytes(constchar* first,constchar* last); byte_string to_bytes(Elem wchar); byte_string to_bytes(const Elem* wptr); byte_string to_bytes(const wide_string& wstr); byte_string to_bytes(const Elem* first,const Elem* last); size_t converted()constnoexcept; state_type state()const; private: byte_string byte_err_string;// exposition only wide_string wide_err_string;// exposition only Codecvt* cvtptr;// exposition only state_type cvtstate;// exposition only size_t cvtcount;// exposition only};
template<class Codecvt,class Elem=wchar_t,class Tr=std::char_traits<Elem>>class wbuffer_convert:publicstd::basic_streambuf<Elem, Tr>{public:typedeftypename Codecvt::state_type state_type; explicit wbuffer_convert(std::streambuf* bytebuf=0, Codecvt* pcvt= new Codecvt, state_type state= state_type()); ~wbuffer_convert(); wbuffer_convert(const wbuffer_convert&)= delete; wbuffer_convert& operator=(const wbuffer_convert&)= delete; std::streambuf* rdbuf()const;std::streambuf* rdbuf(std::streambuf* bytebuf); state_type state()const;private:std::streambuf* bufptr;// exposition only Codecvt* cvtptr;// exposition only state_type cvtstate;// exposition only};
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
DR | Applied to | Behavior as published | Correct behavior |
---|---|---|---|
LWG 71 | C++98 | the parameterend oftime_get::do_get_monthname was missing in the synopsis | added |
LWG 75 | C++98 | the type of the parameterstate of memberslength anddo_length ofcodecvt andcodecvt_byname wasconst stateT& in the synopsis | corrected tostateT& |
LWG 124 | C++98 | the return types of membersdo_scan_is anddo_scan_not ofcodecvt_byname wereconstchar* in the synopsis | corrected to const charT* |
LWG 228 | C++98 | all virtual member functions ofXXX_byname facets were listed in the synopses | only lists the destructor (removed all other virtual member functions) |
LWG 268 | C++98 | the semicolons following the declarations of the default constructor and copy constructor ofstd::locale were missing in the synopsis | added |
LWG 1298 | C++98 | there was an explicit specialization ctype_byname<char> in the synopsis | removed |