std::collate_byname
来自cppreference.com
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
在头文件 <locale> 中定义
|
||
template< class CharT > class collate_byname : public std::collate<CharT>; |
||
std::collate_byname是一个std::collate方面,它封装了特定于语言环境的整理(比较)和散列字符串。就像std::collate,它可以充满std::regex和应用,通过的std::locale::operator(),直接向所有的标准算法,期望字符串比较谓词.
原文:
std::collate_byname is a std::collate facet which encapsulates locale-specific collation (comparison) and hashing of strings. Just like std::collate, it can be imbued in std::regex and applied, by means of std::locale::operator(), directly to all standard algorithms that expect a string comparison predicate.
两个专业所提供的标准库
原文:
Two specializations are provided by the standard library
在头文件
<locale> 中定义 | |
std::collate_byname<char> | 特定于语言环境的多字节字符串的排序规则
原文: locale-specific collation of multibyte strings |
std::collate_byname<wchar_t> | 区域设置特定的宽字符串的排序规则
原文: locale-specific collation of wide strings |
目录 |
[编辑] 成员函数
构造一个新collate_byname方面 原文: constructs a new collate_byname facet (公共成员函数) | |
解构一个collate_byname方面 (受保护的成员函数) |
Inherited from std::collate
Member types
会员类型
|
Definition |
char_type
|
charT
|
string_type
|
std::basic_string<charT>
|
Member functions
调用 do_compare (公共成员函数of std::collate )
| |
调用 do_transform (公共成员函数of std::collate )
| |
调用 do_hash (公共成员函数of std::collate )
|
Protected member functions
[虚]</div></div>
|
使用这方面的排序规则比较两个字符串 原文: compares two strings using this facet's collation rules (虚拟保护成员函数of std::collate )
|
[虚]</div></div>
|
转换的字符串排序规则,以便通过比较可以被替换 原文: transforms a string so that collation can be replaced by comparison (虚拟保护成员函数of std::collate )
|
[虚]</div></div>
|
生成一个整数的哈希值,使用这方面的排序规则 原文: generates an integer hash value using this facet's collation rules (虚拟保护成员函数of std::collate )
|
</div>
[编辑] 注释
根据语言环境的字母是典型的字典排序顺序不区分大小写的比较,但在某些地区,字符组比较为单一的整理单位。例如,“通道”捷克语如下的“h”与前面的“i”,和“及”在威尔士语如下“g”和前面的“h”.
原文:
Collation order is typically lexicographic case-insensitive comparison according to the locale's alphabet, but in some locales, groups of characters compare as single collation units. For example, "ch" in Czech follows "h" and precedes "i", and "ng" in Welsh follows "g" and precedes "h".
[编辑] 示例
本章尚未完成 原因:暂无示例 |
[编辑] 另请参阅
定义逐一比较和散列字符串 原文: defines lexicographical comparison and hashing of strings (类模板) | |
按照目前的语言环境比较两个字符串 原文: compares two strings in accordance to the current locale (函数) | |
比较两个宽字符串,按照目前的语言环境 原文: compares two wide strings in accordance to the current locale (函数) | |
lexicographically compares two strings using this locale's collate facet (公共成员函数of std::locale )
|