locale
标准库标头<locale>
此标头是本土化图书馆。
班
*。
封装文化差异的多态方面区域设置(%28class%29)
字符串和流转换
wstring[医]在C++17%29中被废弃的%28C++11%29%28在宽字符串和字节字符串%28类模板%29之间执行转换
W缓冲器[医]在C++17%29中被废弃的%28C++11%29%28在字节流缓冲区和宽流缓冲区%28类模板%29之间执行转换
面类别基类
C型[医]基定义字符分类类别%28类%29
编解码[医]基定义字符转换错误%28类%29
讯息[医]基本定义消息目录类型%28class%29
时间[医]基定义日期格式常量%28类%29
钱[医]基定义货币格式模式%28类%29
小面范畴
定义字符分类表%28类模板%29
C型<char>STd专业化::Ctype for type char%28 class模板专门化%29
字符编码之间的编码转换,包括utf-8、utf-16、utf-32%28类模板%29。
排序规则定义字符串的字典比较和散列%28类模板%29
消息实现从消息目录中检索字符串%28类模板%29
时间[医]将输入字符序列中的时间/日期值解析为structstd::tm%28class模板%29
时间[医]将输出的structstd::tm格式内容作为字符序列%28类模板%29
努姆[医]从输入字符序列%28类模板%29中获取解析数值
努姆[医]将输出的格式数值作为字符序列%28类模板%29
数字标点符号定义数字标点符号规则%28类模板%29
钱[医]从输入字符序列%28类模板%29中获取解析并构造货币值
钱[医]将输出的货币值格式化为字符序列%28类模板%29
货币化定义了STD::Money使用的货币格式参数[医]GET和STD:钱[医]放置%28类模板%29
区域-特定的方面类别
C型[医]byname表示系统提供的std::ctype,用于命名的locale%28类模板%29。
编解码[医]byname表示命名的locale%28类模板%29的系统提供的std::codecvt。
讯息[医]byname表示系统提供的std::命名区域设置%28类模板%29的消息。
校对[医]byname表示系统提供的STD::COLATE,用于命名的locale%28类模板%29。
时间[医]弄到[医]byname表示系统提供的std::time。[医]获取命名区域设置%28类模板%29
时间[医]放[医]byname表示系统提供的std::time。[医]为命名区域设置%28类模板%29
点点[医]byname表示命名的locale%28类模板%29的系统提供的std::num点。
货币[医]byname表示系统提供的std::货币区数为命名的locale%28类模板%29
功能
地点和面
使用[医]facet从locale%28函数模板%29获得一个facet
有[医]facet检查区域设置是否实现了特定的facet%28函数模板%29
字符分类
isspace%28std::locale%29检查某个字符是否被locale%28函数模板%29分类为空白
isspace%28std::locale%29%28C++11%29检查某个字符是否被区域设置%28函数模板%29分类为空白字符
iscntrl%28std::locale%29检查某个字符是否被locale%28函数模板%29归类为控制字符
isuper%28std::locale%29检查某个字符是否被区域设置%28函数模板%29归类为大写
islow%28std::locale%29检查某个字符是否被区域设置%28函数模板%29分类为小写
isalpha%28std::locale%29检查一个字符是否被区域设置%28函数模板%29分类为字母
is位%28std::locale%29检查某个字符是否被locale%28函数模板%29分类为数字
ispoint%28std::locale%29检查某个字符是否被区域设置%28函数模板%29归类为标点符号
isx位%28std::locale%29检查一个字符是否被区域设置%28函数模板%29分类为十六进制数字
isalnum%28std::locale%29检查某个字符是否被地区%28函数模板%29分类为字母数字
isprint%28std::locale%29检查一个字符是否被locale%28函数模板%29分类为可打印字符
isgram%28std::locale%29检查一个字符是否被locale%28函数模板%29分类为图形字符
字符转换
使用locale%28函数模板%29的Ctype facet将字符转换为大写字符::locale%28 std::locale%29
Tolower%28std::locale%29使用locale%28函数模板%29的Ctype facet将字符转换为小写
[医]滑膜
二次
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>; // specialization
template <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 InputIterator = istreambuf_iterator<charT> > class num_get;
template <class charT, class OutputIterator = 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 InputIterator = istreambuf_iterator<charT> >
class time_get;
template <class charT, class InputIterator> = istreambuf_iterator<charT> >
class time_get_byname;
template <class charT, class OutputIterator> = ostreambuf_iterator<charT> >
class time_put;
template <class charT, class OutputIterator> = ostreambuf_iterator<charT> >
class time_put_byname;
// money:
class money_base;
template <class charT, class InputIterator = istreambuf_iterator<charT> > >
class money_get;
template <class charT, class OutputIterator = 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;
}
二次
类std::locale
二次
class locale
{
public:
// types:
class facet;
class id;
typedef int category;
static const 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(const char* std_name
explicit locale(const string& std_name
locale(const locale& other, const char* 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 virtual
const 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&
static const locale& classic(
};
二次
类std::ctype_base
二次
class ctype_base {
public:
typedef /*T*/ mask;
// numeric values are for exposition only.
static const mask space = 1 << 0;
static const mask print = 1 << 1;
static const mask cntrl = 1 << 2;
static const mask upper = 1 << 3;
static const mask lower = 1 << 4;
static const mask alpha = 1 << 5;
static const mask digit = 1 << 6;
static const mask punct = 1 << 7;
static const mask xdigit= 1 << 8;
static const mask blank = 1 << 9;
static const mask alnum = alpha | digit;
static const mask graph = alnum | punct;
};
二次
类std::ctype
二次
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;
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*, char dfault,
char* to) const;
static locale::id id;
protected:
~ctype(
virtual bool do_is(mask m, charT c) const;
virtual const charT* do_is(const charT* low, const charT* high,
mask* vec) const;
virtual const charT* do_scan_is(mask m,
const charT* low, const charT* high) const;
virtual const charT* do_scan_not(mask m,
const charT* low, const charT* high) const;
virtual charT do_toupper(charT) const;
virtual const charT* do_toupper(charT* low, const charT* high) const;
virtual charT do_tolower(charT) const;
virtual const charT* do_tolower(charT* low, const charT* high) const;
virtual charT do_widen(char) const;
virtual const char* do_widen(const char* low, const char* high,
charT* dest) const;
virtual char do_narrow(charT, char dfault) const;
virtual const charT* do_narrow(const charT* low, const charT* high,
char dfault, char* dest) const;
};
二次
类std::ctype_byname
二次
template <class charT>
class ctype_byname : public ctype<charT> {
public:
typedef typename ctype<charT>::mask mask;
explicit ctype_byname(const char*, size_t refs = 0
explicit ctype_byname(const string&, size_t refs = 0
protected:
~ctype_byname(
};
二次
类std::ctype<char>
二次
template <> class ctype<char>
: public locale::facet, public ctype_base
{
public:
typedef char char_type;
explicit ctype(const mask* tab = 0, 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;
static locale::id id;
static const size_t table_size = implementation-defined;
const mask* table() const noexcept;
static const mask* classic_table() noexcept;
protected:
~ctype(
virtual char do_toupper(char c) const;
virtual const char* do_toupper(char* low, const char* high) const;
virtual char do_tolower(char c) const;
virtual const char* do_tolower(char* low, const char* high) const;
virtual char do_widen(char c) const;
virtual const char* do_widen(const char* low,
const char* high,
char* to) const;
virtual char do_narrow(char c, char dfault) const;
virtual const char* do_narrow(const char* low,
const char* high,
char dfault, char* to) const;
};
二次
类std::codecvt_base
二次
class codecvt_base
{
public:
enum result { ok, partial, error, noconv };
};
二次
类std::codecvt
二次
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() const noexcept;
bool always_noconv() const noexcept;
int length(stateT&, const externT* from, const externT* end,
size_t max) const;
int max_length() const noexcept;
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;
virtual int do_encoding() const noexcept;
virtual bool do_always_noconv() const noexcept;
virtual int do_length(stateT&, const externT* from,
const externT* end, size_t max) const;
virtual int do_max_length() const noexcept;
};
二次
类std::codecvt_byname
二次
template <class internT, class externT, class stateT>
class codecvt_byname : public codecvt<internT, externT, stateT> {
public:
explicit codecvt_byname(const char*, size_t refs = 0
explicit codecvt_byname(const string&, size_t refs = 0
protected:
~codecvt_byname(
};
二次
类std::num_get
二次
template <class charT, class InputIterator = istreambuf_iterator<charT> >
class num_get : public locale::facet
{
public:
typedef charT char_type;
typedef InputIterator 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, long long& v) const;
iter_type get(iter_type in, iter_type end, ios_base&,
ios_base::iostate& err, unsigned short& v) const;
iter_type get(iter_type in, iter_type end, ios_base&,
ios_base::iostate& err, unsigned int& v) const;
iter_type get(iter_type in, iter_type end, ios_base&,
ios_base::iostate& err, unsigned long& v) const;
iter_type get(iter_type in, iter_type end, ios_base& ,
ios_base::iostate& err, unsigned long long& 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, long double& 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, long long& v) const;
virtual iter_type do_get(iter_type, iter_type, ios_base&,
ios_base::iostate& err, unsigned short& v) const;
virtual iter_type do_get(iter_type, iter_type, ios_base&,
ios_base::iostate& err, unsigned int& v) const;
virtual iter_type do_get(iter_type, iter_type, ios_base&,
ios_base::iostate& err, unsigned long& v) const;
virtual iter_type do_get(iter_type, iter_type, ios_base&,
ios_base::iostate& err, unsigned long long& 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, long double& v) const;
virtual iter_type do_get(iter_type, iter_type, ios_base&,
ios_base::iostate& err, void*& v) const;
};
二次
© cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。