libstdc++
|
Public Types | |
typedef std::ctype_base::mask | char_class_type |
typedef _Ch_type | char_type |
typedef std::locale | locale_type |
typedef std::basic_string < char_type > | string_type |
Public Member Functions | |
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) const |
template<typename _Fwd_iter > | |
string_type | lookup_collatename (_Fwd_iter __first, _Fwd_iter __last) const |
regex_traits () | |
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 tr1 section [7.2].
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.
Definition at line 432 of file tr1_impl/regex.
|
inline |
Constructs a default traits object.
Definition at line 444 of file tr1_impl/regex.
|
inline |
Gets a copy of the current locale in use by the regex_traits object.
Definition at line 644 of file tr1_impl/regex.
|
inline |
Imbues the regex_traits object with a copy of a new locale.
loc | A locale. |
Definition at line 633 of file tr1_impl/regex.
|
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. Definition at line 458 of file tr1_impl/regex.
References std::basic_string< _CharT, _Traits, _Alloc >::length().
char_class_type std::regex_traits< _Ch_type >::lookup_classname | ( | _Fwd_iter | __first, |
_Fwd_iter | __last | ||
) | 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. |
At least the following names (or their wide-character equivalent) are supported.
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. |
|
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 511 of file tr1_impl/regex.
References std::regex_constants::collate, std::basic_string< _CharT, _Traits, _Alloc >::data(), std::basic_string< _CharT, _Traits, _Alloc >::size(), std::collate< _CharT >::transform(), and std::use_facet().
string_type std::regex_traits< _Ch_type >::transform_primary | ( | _Fwd_iter | __first, |
_Fwd_iter | __last | ||
) | const |
Dunno.
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. WTF??
|
inline |
Performs the identity translation.
c | A character to the locale-specific character set. |
Definition at line 469 of file tr1_impl/regex.
|
inline |
Translates a character into a case-insensitive equivalent.
c | A character to the locale-specific character set. |
std::bad_cast | if the imbued locale does not support the ctype facet. |
Definition at line 482 of file tr1_impl/regex.
References std::tolower(), and std::use_facet().