c_regex_traits 構造体テンプレート
-
template<typename Char>
struct c_regex_traits basic_regex<>
クラステンプレートで使用するために標準の C ロカール関数をカプセル化する。
概要
// ヘッダ:<boost/xpressive/xpressive_fwd.hpp
> template<typename Char> structc_regex_traits
{ // 構築、コピー、解体c_regex_traits
(locale_type const & = locale_type()); // 公開メンバ関数 booloperator==
(c_regex_traits
< char_type > const &) const; booloperator!=
(c_regex_traits
< char_type > const &) const; string_typefold_case
(char_type) const; locale_typeimbue
(locale_type); template<> charwiden
(char); template<> wchar_twiden
(char); template<> unsigned charhash
(char); template<> unsigned charhash
(wchar_t); template<> intvalue
(char, int); template<> intvalue
(wchar_t, int); // 公開静的メンバ関数 static char_typewiden
(char); static unsigned charhash
(char_type); static char_typetranslate
(char_type); static char_typetranslate_nocase
(char_type); static char_typetolower
(char_type); static char_typetoupper
(char_type); static boolin_range
(char_type, char_type, char_type); static boolin_range_nocase
(char_type, char_type, char_type); template<typename FwdIter> static string_typetransform
(FwdIter, FwdIter); template<typename FwdIter> static string_typetransform_primary
(FwdIter, FwdIter); template<typename FwdIter> static string_typelookup_collatename
(FwdIter, FwdIter); template<typename FwdIter> static char_class_typelookup_classname
(FwdIter, FwdIter, bool); static boolisctype
(char_type, char_class_type); static intvalue
(char_type, int); static locale_typegetloc
(); };
説明
c_regex_traits
構築、コピー、解体の公開演算
-
c_regex_traits(locale_type const &loc = locale_type())
グローバルな C ロカールを使用する
c_regex_traits
オブジェクトを初期化する。
c_regex_traits
公開メンバ関数
-
bool operator==(c_regex_traits<char_type> const&) const
2 つの
c_regex_traits
オブジェクトが等値か調べる。- 戻り値
真。
-
bool operator!=(c_regex_traits<char_type> const&) const
2 つの
c_regex_traits
オブジェクトが等値でないか調べる。- 戻り値
偽。
-
string_type fold_case(char_type ch) const
渡した文字と大文字小文字を区別せずに比較すると等値となる文字をすべて含む
string_type
を返す。この関数が呼び出されるのは has_fold_case<c_regex_traits<Char>> が真の場合のみである。- パラメータ
ch -- 元の文字。
- 戻り値
ch
と大文字小文字を区別せずに比較すると等値となる文字をすべて含むstring_type
-
locale_type imbue(locale_type loc)
何もしない。
-
template<>
char widen(char ch)
-
template<>
wchar_t widen(char ch)
-
template<>
unsigned char hash(char ch)
-
template<>
unsigned char hash(wchar_t ch)
-
template<>
int value(char ch, int radix)
-
template<>
int value(wchar_t ch, int radix)
c_regex_traits
公開静的メンバ関数
-
static char_type widen(char ch)
char
型の値をChar
型に変換する。- パラメータ
ch -- 元の文字。
- 戻り値
Char
がchar
であればch
、Char
がwchar_t
であれば std::btowc(ch)。
-
static unsigned char hash(char_type ch)
[0, UCHAR_MAX]
の範囲でChar
のハッシュ値を返す。- パラメータ
ch -- 元の文字
- 戻り値
0
以上UCHAR_MAX
以下の値。
-
static char_type translate(char_type ch)
何もしない。
- パラメータ
ch -- 元の文字。
- 戻り値
ch
-
static char_type translate_nocase(char_type ch)
現在のグローバルな C ロカールを使用して、文字を小文字に変換する。
-
static char_type tolower(char_type ch)
現在のグローバルな C ロカールを使用して、文字を小文字に変換する。
-
static char_type toupper(char_type ch)
現在のグローバルな C ロカールを使用して、文字を大文字に変換する。
-
static bool in_range(char_type first, char_type last, char_type ch)
文字が文字範囲に含まれるか調べる。
-
static bool in_range_nocase(char_type first, char_type last, char_type ch)
文字が文字範囲に含まれるか調べる。大文字小文字を区別しない。
注釈
既定の実装は適正な Unicode ケースフォールディングを行わないが、標準 C ロカールではこれが最善である。
-
template<typename FwdIter>
static string_type transform(FwdIter begin, FwdIter end) イテレータ範囲
[F1, F2)
が示す文字シーケンスのソートキーを返す。文字シーケンス[G1, G2)
が文字シーケンス[H1, H2)
の前にソートされる場合に v.transform(G1, G2) < v.transform(H1, H2) とならなければならない。注釈
現在使用していない。
-
template<typename FwdIter>
static string_type transform_primary(FwdIter begin, FwdIter end) イテレータ範囲
[F1, F2)
が示す文字シーケンスのソートキーを返す。大文字小文字を区別せずにソートして文字シーケンス[G1, G2)
が文字シーケンス[H1, H2)
の前に現れる場合に v.transform(G1, G2) < v.transform(H1, H2) とならなければならない。注釈
現在使用していない。
-
template<typename FwdIter>
static string_type lookup_collatename(FwdIter begin, FwdIter end) イテレータ範囲
[F1, F2)
が示す文字シーケンスが構成する照合要素を表す文字シーケンスを返す。文字シーケンスが正しい照合要素でなければ空文字列を返す。注釈
現在使用していない。
-
template<typename FwdIter>
static char_class_type lookup_classname(FwdIter begin, FwdIter end, bool icase) 指定した文字シーケンスが表す文字分類について、相当するビットマスクを返す。
- パラメータ
begin -- 文字分類の名前を表す文字シーケンスの先頭を指す前進イテレータ。
end -- 文字シーケンスの終端。
icase -- 戻り値のビットマスクが大文字小文字を区別しない文字分類を表すかを指定する。
- 戻り値
文字分類を表すビットマスク。
-
static bool isctype(char_type ch, char_class_type mask)
文字分類ビットマスクに対して文字をテストする。
- パラメータ
ch -- テストする文字。
mask -- テストする文字分類のビットマスク。
- 要件
mask
はlookup_classname
が返したビットマスクか、それらのビット和。- 戻り値
文字が指定した文字分類に含まれれば真、それ以外は偽。
-
static int value(char_type ch, int radix)
数字を数値に変換する。
- パラメータ
ch -- 数字。
radix -- 変換に使用する序数。
- 要件
radix
は 8 、10 、16 のいずれか。- 戻り値
ch
が数字でなければ-1
、それ以外は文字が表す数値。char_type
がchar
であればstd::strtol
を、char_type
がwchar_t
であればstd::wcstol
を使用する。
-
static locale_type getloc()
何もしない。