Share via


regex_traits クラス

要素の一致に対する特性を表します。

template<class Elem>
    struct regex_traits {
    regex_traits();

    static size_type length(const char_type *str);
    char_type translate(char_type ch) const;
    char_type translate_nocase(char_type ch) const;
    template<class FwdIt>
        string_type transform(FwdIt first, FwdIt last) const;
    template<class FwdIt>
        string_type transform_primary(FwdIt first, FwdIt last) const;
    template<class FwdIt>
        char_class_type lookup_classname(FwdIt first, FwdIt last) const;
    template<class FwdIt>
        string_type lookup_collatename(FwdIt first, FwdIt last) const;
    bool isctype(char_type ch, char_class_type cls) const;
    int value(Elem ch, int base) const;
    locale_type imbue(locale_type loc);
    locale_type getloc() const;

    typedef Elem char_type;
    typedef T6 size_type;
    typedef basic_string<Elem> string_type;
    typedef T7 locale_type;
    typedef T8 char_class_type;
    };

パラメーター

  • Elem
    記述する要素の型。

解説

このテンプレート クラスは、Elem 型の各種正規表現の特徴 (traits) を表します。 テンプレート クラス basic_regex クラス では、この情報を使用して、型 Elem の要素を操作します。

各 regex_traits オブジェクトは、その一部のメンバー関数によって使用される regex_traits::locale 型のオブジェクトを保持します。 既定のロケールは、regex_traits::locale() のコピーです。 メンバー関数 imbue は、ロケール オブジェクトを置き換える関数です。また、メンバー関数 getloc はロケール オブジェクトのコピーを返す関数です。

必要条件

ヘッダー: <regex>

名前空間: std

参照

関連項目

<regex>

regex_traits クラス

regex_traits<char> クラス

regex_traits<wchar_t> クラス

その他の技術情報

<regex> メンバー