std::regex_traits(3)
NAME
std::regex_traits
SYNOPSIS
Detailed Description
- template<typename _Ch_type> struct std::regex_traits< _Ch_type >
- 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 352 of file tr1_impl/regex.
- 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
Constructor & Destructor Documentation
- template<typename _Ch_type> std::regex_traits< _Ch_type >::regex_traits ()
- [inline]
Constructs a default traits object. - Definition at line 364 of file tr1_impl/regex.
Member Function Documentation
- template<typename _Ch_type> locale_type std::regex_traits< _Ch_type
- >::getloc () const [inline] Gets a copy of the current locale in use by the regex_traits object.
- Definition at line 600 of file tr1_impl/regex.
- template<typename _Ch_type> locale_type std::regex_traits< _Ch_type
- >::imbue (locale_type __loc) [inline] Imbues the regex_traits object with a copy of a new locale.
- Parameters:
loc A locale.
- Returns:
a copy of the previous locale in use by the regex_traits object.
- Note:
Calling imbue with a different locale than the one currently in use invalidates all cached data held by *this.
- Definition at line 589 of file tr1_impl/regex.
- template<typename _Ch_type> bool std::regex_traits< _Ch_type >::isctype
- (_Ch_type __c, char_class_type __f) const [inline] Determines if c is a member of an identified class.
- Parameters:
c a character.
f a class type (as returned from lookup_classname). - Returns:
true if the character c is a member of the classification
represented by f, false otherwise. - Exceptions:
std::bad_cast if the current locale does not have a ctype facet.
- Definition at line 529 of file tr1_impl/regex.
- References std::__ctype_abstract_base< _CharT >::is(),
std::regex_traits< _Ch_type >::lookup_classname(), std::use_facet(),
and std::__ctype_abstract_base< _CharT >::widen(). - template<typename _Ch_type> static std::size_t std::regex_traits< _Ch_type
- >::length (const char_type * __p) [inline, static] Gives the length of a C-style string starting at __p.
- Parameters:
__p a pointer to the start of a character sequence.
- Returns:
the number of characters between *__p and the first defaultinitialized value of type char_type. In other words, uses the Cstring algorithm for determining the length of a sequence of
characters. - Definition at line 378 of file tr1_impl/regex.
- template<typename _Ch_type> template<typename _Fwd_iter> char_class_type
- std::regex_traits< _Ch_type >::lookup_classname (_Fwd_iter __first, _Fwd_iter __last) const [inline] Maps one or mire characters to a named character classification.
- Parameters:
first beginning of the character sequence.
last one-past-the-end of the character sequence. - Returns:
an unspecified value that represents the character classification
named by the character sequence designated by the iterator range [first, last). 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. - · d
- · w
- · s
- · alnum
- · alpha
- · blank
- · cntrl
- · digit
- · graph
- · lower
- · punct
- · space
- · upper
- · xdigit
- Todo
Implement this function.
- Definition at line 513 of file tr1_impl/regex.
- Referenced by std::regex_traits< _Ch_type >::isctype().
- template<typename _Ch_type> template<typename _Fwd_iter> string_type
- std::regex_traits< _Ch_type >::lookup_collatename (_Fwd_iter __first, _Fwd_iter __last) const [inline] Gets a collation element by name.
- Parameters:
first beginning of the collation element name.
last one-past-the-end of the collation element name. - Returns:
a sequence of one or more characters that represents the collating element consisting of the character sequence designated by the
iterator range [first, last). Returns an empty string if the character sequence is not a valid collating element. - Todo
Implement this function.
- Definition at line 475 of file tr1_impl/regex.
- template<typename _Ch_type> template<typename _Fwd_iter> string_type
- std::regex_traits< _Ch_type >::transform (_Fwd_iter __first, _Fwd_iter
__last) const [inline]
Gets a sort key for a character sequence. - Parameters:
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. - Returns:
a locale-specific sort key equivalent to the input range.
- Exceptions:
std::bad_cast if the current locale does not have a collate facet.
- Definition at line 431 of file tr1_impl/regex.
- References std::basic_string< _CharT, _Traits, _Alloc >::data(),
std::basic_string< _CharT, _Traits, _Alloc >::size(), std::collate<
_CharT >::transform(), and std::use_facet(). - template<typename _Ch_type> template<typename _Fwd_iter> string_type
- std::regex_traits< _Ch_type >::transform_primary (_Fwd_iter __first, _Fwd_iter __last) const [inline] Dunno.
- Parameters:
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?? - Todo
Implement this function.
- Definition at line 457 of file tr1_impl/regex.
- template<typename _Ch_type> char_type std::regex_traits< _Ch_type
- >::translate (char_type __c) const [inline] Performs the identity translation.
- Parameters:
c A character to the locale-specific character set.
- Returns:
c.
- Definition at line 389 of file tr1_impl/regex.
- template<typename _Ch_type> char_type std::regex_traits< _Ch_type
- >::translate_nocase (char_type __c) const [inline] Translates a character into a case-insensitive equivalent.
- Parameters:
c A character to the locale-specific character set.
- Returns:
the locale-specific lower-case equivalent of c.
- Exceptions:
std::bad_cast if the imbued locale does not support the ctype facet.
- Definition at line 402 of file tr1_impl/regex.
- References std::tolower(), and std::use_facet().
- template<typename _Ch_type> int std::regex_traits< _Ch_type >::value
- (_Ch_type __ch, int __radix) const Converts a digit to an int.
- Parameters:
ch a character representing a digit.
radix the radix if the numeric conversion (limited to 8, 10, or 16). - Returns:
the value represented by the digit ch in base radix if the
character ch is a valid digit in base radix; otherwise returns -1. - Todo
Implement this function.
Author
- Generated automatically by Doxygen for libstdc++ from the source code.