libstdc++
|
Public Types | |
typedef _RegexMask | char_class_type |
typedef _Ch_type | char_type |
typedef std::locale | locale_type |
typedef std::basic_string< char_type > | string_type |
Public Member Functions | |
regex_traits () | |
locale_type | getloc () const |
locale_type | imbue (locale_type __loc) |
bool | isctype (_Ch_type __c, char_class_type __f) const |
template<typename _Fwd_iter > | |
char_class_type | lookup_classname (_Fwd_iter __first, _Fwd_iter __last, bool __icase=false) const |
template<typename _Fwd_iter > | |
string_type | lookup_collatename (_Fwd_iter __first, _Fwd_iter __last) const |
template<typename _Fwd_iter > | |
string_type | transform (_Fwd_iter __first, _Fwd_iter __last) const |
template<typename _Fwd_iter > | |
string_type | transform_primary (_Fwd_iter __first, _Fwd_iter __last) const |
char_type | translate (char_type __c) const |
char_type | translate_nocase (char_type __c) const |
int | value (_Ch_type __ch, int __radix) const |
Static Public Member Functions | |
static std::size_t | length (const char_type *__p) |
Protected Attributes | |
locale_type | _M_locale |
Describes aspects of a regular expression.
A regular expression traits class that satisfies the requirements of section [28.7].
The class regex is parameterized around a set of related types and functions used to complete the definition of its semantics. This class satisfies the requirements of such a traits class.
|
inline |
|
inline |
Gets a copy of the current locale in use by the regex_traits object.
Definition at line 377 of file regex.h.
References std::regex_constants::awk, std::regex_constants::basic, std::regex_constants::collate, std::regex_constants::ECMAScript, std::regex_constants::egrep, std::regex_constants::extended, std::regex_constants::grep, std::regex_constants::icase, std::regex_constants::nosubs, and std::regex_constants::optimize.
Referenced by std::regex_traits< _Ch_type >::value().
|
inline |
Imbues the regex_traits object with a copy of a new locale.
__loc | A locale. |
bool std::regex_traits< _Ch_type >::isctype | ( | _Ch_type | __c, |
char_class_type | __f | ||
) | const |
Determines if c
is a member of an identified class.
__c | a character. |
__f | a class type (as returned from lookup_classname). |
__c
is a member of the classification represented by __f
, false otherwise.std::bad_cast | if the current locale does not have a ctype facet. |
Definition at line 344 of file regex.tcc.
References std::regex_traits< _Ch_type >::value().
Referenced by std::regex_traits< _Ch_type >::lookup_classname().
|
inlinestatic |
Gives the length of a C-style string starting at __p
.
__p | a pointer to the start of a character sequence. |
*__p
and the first default-initialized value of type char_type
. In other words, uses the C-string algorithm for determining the length of a sequence of characters. regex_traits< _Ch_type >::char_class_type std::regex_traits< _Ch_type >::lookup_classname | ( | _Fwd_iter | __first, |
_Fwd_iter | __last, | ||
bool | __icase = false |
||
) | const |
Maps one or more characters to a named character classification.
__first | beginning of the character sequence. |
__last | one-past-the-end of the character sequence. |
__icase | ignores the case of the classification name. |
icase
is true, the returned mask identifies the classification regardless of the case of the characters to be matched (for example, [[:lower:]] is the same as [[:alpha:]]), otherwise a case-dependent classification is returned. The value returned shall be independent of the case of the characters in the character sequence. If the name is not recognized then returns a value that compares equal to 0.At least the following names (or their wide-character equivalent) are supported.
Definition at line 300 of file regex.tcc.
References std::regex_traits< _Ch_type >::isctype().
Referenced by std::regex_traits< _Ch_type >::lookup_collatename().
regex_traits< _Ch_type >::string_type std::regex_traits< _Ch_type >::lookup_collatename | ( | _Fwd_iter | __first, |
_Fwd_iter | __last | ||
) | const |
Gets a collation element by name.
__first | beginning of the collation element name. |
__last | one-past-the-end of the collation element name. |
Definition at line 144 of file regex.tcc.
References std::regex_traits< _Ch_type >::lookup_classname().
|
inline |
Gets a sort key for a character sequence.
__first | beginning of the character sequence. |
__last | one-past-the-end of the character sequence. |
Returns a sort key for the character sequence designated by the iterator range [F1, F2) such that if the character sequence [G1, G2) sorts before the character sequence [H1, H2) then v.transform(G1, G2) < v.transform(H1, H2).
What this really does is provide a more efficient way to compare a string to multiple other strings in locales with fancy collation rules and equivalence classes.
std::bad_cast | if the current locale does not have a collate facet. |
Definition at line 230 of file regex.h.
References std::basic_string< _CharT, _Traits, _Alloc >::data(), and std::basic_string< _CharT, _Traits, _Alloc >::size().
|
inline |
Gets a sort key for a character sequence, independent of case.
__first | beginning of the character sequence. |
__last | one-past-the-end of the character sequence. |
Effects: if typeid(use_facet<collate<_Ch_type> >) == typeid(collate_byname<_Ch_type>) and the form of the sort key returned by collate_byname<_Ch_type>::transform(__first, __last) is known and can be converted into a primary sort key then returns that key, otherwise returns an empty string.
Definition at line 254 of file regex.h.
References std::vector< _Tp, _Alloc >::data(), and std::vector< _Tp, _Alloc >::size().
|
inline |
|
inline |
int std::regex_traits< _Ch_type >::value | ( | _Ch_type | __ch, |
int | __radix | ||
) | const |
Converts a digit to an int.
__ch | a character representing a digit. |
__radix | the radix if the numeric conversion (limited to 8, 10, or 16). |
Definition at line 358 of file regex.tcc.
References std::basic_ios< _CharT, _Traits >::fail(), std::match_results< _Bi_iter, _Alloc >::format(), std::regex_constants::format_sed, std::regex_traits< _Ch_type >::getloc(), std::hex(), std::oct(), and std::regex_traits< _Ch_type >::value().
Referenced by std::regex_traits< _Ch_type >::isctype(), and std::regex_traits< _Ch_type >::value().