std::ctype_byname<char>
来自cppreference.com
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
在头文件 <locale> 中定义
|
||
template<> class ctype_byname : public std::ctype<char>; |
||
这种专业化的std::ctype_byname封装类型char的字符分类功能。喜欢它的基类
std::ctype<char>
与通用std::ctype_byname,表查找,分类字符原文:
This specialization of std::ctype_byname encapsulates character classification features for type char. Like its base class
std::ctype<char>
and unlike general-purpose std::ctype_byname, table lookup is used to classify characters目录 |
[编辑] 会员类型
会员类型
|
Definition |
mask
|
ctype<char>::mask
|
[编辑] 成员函数
构造一个新的ctype_byname <Char>来方面 原文: constructs a new ctype_byname<char> facet (公共成员函数) | |
解构一个ctype_byname <Char>来方面 原文: destructs a ctype_byname<char> facet (受保护的成员函数) |
Inherited from std::ctype<char>
Member types
会员类型
|
Definition |
char_type
|
char
|
Member objects
会员名称
|
Type |
id (静态的)
|
std::locale::id |
table_size (静态常量)
|
std::size_t大小的分类表,至少256
原文: std::size_t size of the classification table, at least 256 |
Member functions
得到的字符分类表 原文: obtains the character classification table (公共成员函数of std::ctype<char> )
| |
[静态的]</div></div>
|
获得“C”区域设置字符分类表 原文: obtains the "C" locale character classification table (公共静态成员函数of std::ctype<char> )
|
分类的字符或字符序列时,使用的分类表 原文: classifies a character or a character sequence, using the classification table (公共成员函数of std::ctype<char> )
| |
找到的第一个字符序列中符合给定的分类,使用的分类表 原文: locates the first character in a sequence that conforms to given classification, using the classification table (公共成员函数of std::ctype<char> )
| |
locates the first character in a sequence that fails given classification, using the classification table (公共成员函数of std::ctype<char> )
| |
调用 do_toupper (公共成员函数of std::ctype )
| |
调用 do_tolower (公共成员函数of std::ctype )
| |
调用 do_widen (公共成员函数of std::ctype )
| |
调用 do_narrow (公共成员函数of std::ctype )
|
Protected member functions
[虚]</div></div>
|
将一个或多个字符转换为大写 原文: converts a character or characters to uppercase (虚拟保护成员函数of std::ctype )
|
[虚]</div></div>
|
一个或多个字符转换为小写 原文: converts a character or characters to lowercase (虚拟保护成员函数of std::ctype )
|
[虚]</div></div>
|
将一个或多个字符从 char charT 原文: converts a character or characters from char to charT (虚拟保护成员函数of std::ctype )
|
[虚]</div></div>
|
将一个或多个字符从 charT char 原文: converts a character or characters from charT to char (虚拟保护成员函数of std::ctype )
|
</div>
Inherited from std::ctype_base
Member types
类型
|
Definition |
mask
|
未指定的位掩码类型(枚举,整数类型,或bitset的)
原文: unspecified bitmask type (enumeration, integer type, or bitset) |
Member constants
space [静态的]</div></div>
|
mask 识别的空白字符分类 原文: the value of mask identifying whitespace character classification (公共静态成员常量) |
print [静态的]</div></div>
|
mask 确定可打印字符分类的价值 原文: the value of mask identifying printable character classification (公共静态成员常量) |
cntrl [静态的]</div></div>
|
mask 识别控制字符分类 原文: the value of mask identifying control character classification (公共静态成员常量) |
upper [静态的]</div></div>
|
mask 确定的价值大写字符分类 原文: the value of mask identifying uppercase character classification (公共静态成员常量) |
lower [静态的]</div></div>
|
值 mask 识别小写字母分类 原文: the value of mask identifying lowercase character classification (公共静态成员常量) |
alpha [静态的]</div></div>
|
mask 识别英文字母分类的价值 原文: the value of mask identifying alphabetic character classification (公共静态成员常量) |
digit [静态的]</div></div>
|
mask 识别数字字符分类的价值 原文: the value of mask identifying digit character classification (公共静态成员常量) |
punct [静态的]</div></div>
|
mask 识别的标点字符分类 原文: the value of mask identifying punctuation character classification (公共静态成员常量) |
xdigit [静态的]</div></div>
|
mask 识别十六进制数字字符分类的价值 原文: the value of mask identifying hexadecimal digit character classification (公共静态成员常量) |
blank [静态的] (C++11)</div></div>
|
mask 识别空白字符分类的价值 原文: the value of mask identifying blank character classification (公共静态成员常量) |
alnum [静态的]</div></div>
|
alpha | digit (公共静态成员常量) |
graph [静态的]</div></div>
|
alnum | punct (公共静态成员常量) |
</div>
[编辑] 示例
#include <iostream> #include <locale> int main() { char c = '\xde'; // capital letter thorn std::locale loc("C"); std::cout << "isupper('Þ', C locale) returned " << std::boolalpha << std::isupper(c, loc) << '\n'; loc = std::locale(loc, new std::ctype_byname<char>("en_US.utf8")); std::cout << "isupper('Þ', C locale with Unicode ctype<char>) returned " << std::boolalpha << std::isupper(c, loc) << '\n'; loc = std::locale(loc, new std::ctype_byname<char>("is_IS.iso88591")); std::cout << "isupper('Þ', C locale with Islandic ctype<char>) returned " << std::boolalpha << std::isupper(c, loc) << '\n'; }
输出:
isupper('Þ', C locale) returned false isupper('Þ', C locale with Unicode ctype<char>) returned false isupper('Þ', C locale with Islandic ctype<char>) returned true
[编辑] 另请参阅
定义字符分类表 原文: defines character classification tables (类模板) | |
专业化的类型std::ctypechar 原文: specialization of std::ctype for type char (类模板特化) |