.TH "std::regex_traits< _Ch_type >" 3cxx "Thu Aug 2 2012" "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::regex_traits< _Ch_type > \- .SH SYNOPSIS .br .PP .SS "Public Types" .in +1c .ti -1c .RI "typedef std::ctype_base::mask \fBchar_class_type\fP" .br .ti -1c .RI "typedef _Ch_type \fBchar_type\fP" .br .ti -1c .RI "typedef \fBstd::locale\fP \fBlocale_type\fP" .br .ti -1c .RI "typedef \fBstd::basic_string\fP .br < char_type > \fBstring_type\fP" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBlocale_type\fP \fBgetloc\fP () const " .br .ti -1c .RI "\fBlocale_type\fP \fBimbue\fP (\fBlocale_type\fP __loc)" .br .ti -1c .RI "bool \fBisctype\fP (_Ch_type __c, char_class_type __f) const " .br .ti -1c .RI "template char_class_type \fBlookup_classname\fP (_Fwd_iter __first, _Fwd_iter __last) const " .br .ti -1c .RI "template \fBstring_type\fP \fBlookup_collatename\fP (_Fwd_iter __first, _Fwd_iter __last) const " .br .ti -1c .RI "\fBregex_traits\fP ()" .br .ti -1c .RI "template \fBstring_type\fP \fBtransform\fP (_Fwd_iter __first, _Fwd_iter __last) const " .br .ti -1c .RI "template \fBstring_type\fP \fBtransform_primary\fP (_Fwd_iter __first, _Fwd_iter __last) const " .br .ti -1c .RI "char_type \fBtranslate\fP (char_type __c) const " .br .ti -1c .RI "char_type \fBtranslate_nocase\fP (char_type __c) const " .br .ti -1c .RI "int \fBvalue\fP (_Ch_type __ch, int __radix) const " .br .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "static std::size_t \fBlength\fP (const char_type *__p)" .br .in -1c .SS "Protected Attributes" .in +1c .ti -1c .RI "\fBlocale_type\fP \fB_M_locale\fP" .br .in -1c .SH "Detailed Description" .PP .SS "templatestruct std::regex_traits< _Ch_type >" Describes aspects of a regular expression\&. A regular expression traits class that satisfies the requirements of \fBtr1\fP section [7\&.2]\&. .PP 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\&. .PP Definition at line 432 of file tr1_impl/regex\&. .SH "Constructor & Destructor Documentation" .PP .SS "template \fBstd::regex_traits\fP< _Ch_type >::\fBregex_traits\fP ()\fC [inline]\fP" .PP Constructs a default traits object\&. .PP Definition at line 444 of file tr1_impl/regex\&. .SH "Member Function Documentation" .PP .SS "template \fBlocale_type\fP \fBstd::regex_traits\fP< _Ch_type >::getloc () const\fC [inline]\fP" .PP Gets a copy of the current locale in use by the \fBregex_traits\fP object\&. .PP Definition at line 644 of file tr1_impl/regex\&. .SS "template \fBlocale_type\fP \fBstd::regex_traits\fP< _Ch_type >::imbue (\fBlocale_type\fP__loc)\fC [inline]\fP" .PP Imbues the \fBregex_traits\fP object with a copy of a new locale\&. \fBParameters:\fP .RS 4 \fIloc\fP A locale\&. .RE .PP \fBReturns:\fP .RS 4 a copy of the previous locale in use by the \fBregex_traits\fP object\&. .RE .PP \fBNote:\fP .RS 4 Calling imbue with a different locale than the one currently in use invalidates all cached data held by *this\&. .RE .PP .PP Definition at line 633 of file tr1_impl/regex\&. .SS "template static std::size_t \fBstd::regex_traits\fP< _Ch_type >::length (const char_type *__p)\fC [inline]\fP, \fC [static]\fP" .PP Gives the length of a C-style string starting at \fC__p\fP\&. \fBParameters:\fP .RS 4 \fI__p\fP a pointer to the start of a character sequence\&. .RE .PP \fBReturns:\fP .RS 4 the number of characters between \fC*__p\fP and the first default-initialized value of type \fCchar_type\fP\&. In other words, uses the C-string algorithm for determining the length of a sequence of characters\&. .RE .PP .PP Definition at line 458 of file tr1_impl/regex\&. .PP References std::basic_string< _CharT, _Traits, _Alloc >::length()\&. .SS "template template char_class_type \fBstd::regex_traits\fP< _Ch_type >::lookup_classname (_Fwd_iter__first, _Fwd_iter__last) const" .PP Maps one or more characters to a named character classification\&. \fBParameters:\fP .RS 4 \fIfirst\fP beginning of the character sequence\&. .br \fIlast\fP one-past-the-end of the character sequence\&. .RE .PP \fBReturns:\fP .RS 4 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\&. .RE .PP At least the following names (or their wide-character equivalent) are supported\&. .IP "\(bu" 2 d .IP "\(bu" 2 w .IP "\(bu" 2 s .IP "\(bu" 2 alnum .IP "\(bu" 2 alpha .IP "\(bu" 2 blank .IP "\(bu" 2 cntrl .IP "\(bu" 2 digit .IP "\(bu" 2 graph .IP "\(bu" 2 lower .IP "\(bu" 2 print .IP "\(bu" 2 punct .IP "\(bu" 2 space .IP "\(bu" 2 upper .IP "\(bu" 2 xdigit .PP .PP \fBTodo\fP .RS 4 Implement this function\&. .RE .PP .SS "template template \fBstring_type\fP \fBstd::regex_traits\fP< _Ch_type >::lookup_collatename (_Fwd_iter__first, _Fwd_iter__last) const" .PP Gets a collation element by name\&. \fBParameters:\fP .RS 4 \fIfirst\fP beginning of the collation element name\&. .br \fIlast\fP one-past-the-end of the collation element name\&. .RE .PP \fBReturns:\fP .RS 4 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\&. .RE .PP \fBTodo\fP .RS 4 Implement this function\&. .RE .PP .SS "template template \fBstring_type\fP \fBstd::regex_traits\fP< _Ch_type >::transform (_Fwd_iter__first, _Fwd_iter__last) const\fC [inline]\fP" .PP Gets a sort key for a character sequence\&. \fBParameters:\fP .RS 4 \fIfirst\fP beginning of the character sequence\&. .br \fIlast\fP one-past-the-end of the character sequence\&. .RE .PP 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)\&. .PP 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\&. .PP \fBReturns:\fP .RS 4 a locale-specific sort key equivalent to the input range\&. .RE .PP \fBExceptions:\fP .RS 4 \fI\fBstd::bad_cast\fP\fP if the current locale does not have a collate facet\&. .RE .PP .PP Definition at line 511 of file tr1_impl/regex\&. .PP 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()\&. .SS "template template \fBstring_type\fP \fBstd::regex_traits\fP< _Ch_type >::transform_primary (_Fwd_iter__first, _Fwd_iter__last) const" .PP Dunno\&. \fBParameters:\fP .RS 4 \fIfirst\fP beginning of the character sequence\&. .br \fIlast\fP one-past-the-end of the character sequence\&. .RE .PP Effects: if typeid(use_facet >) == 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?? .PP \fBTodo\fP .RS 4 Implement this function\&. .RE .PP .SS "template char_type \fBstd::regex_traits\fP< _Ch_type >::translate (char_type__c) const\fC [inline]\fP" .PP Performs the identity translation\&. \fBParameters:\fP .RS 4 \fIc\fP A character to the locale-specific character set\&. .RE .PP \fBReturns:\fP .RS 4 c\&. .RE .PP .PP Definition at line 469 of file tr1_impl/regex\&. .SS "template char_type \fBstd::regex_traits\fP< _Ch_type >::translate_nocase (char_type__c) const\fC [inline]\fP" .PP Translates a character into a case-insensitive equivalent\&. \fBParameters:\fP .RS 4 \fIc\fP A character to the locale-specific character set\&. .RE .PP \fBReturns:\fP .RS 4 the locale-specific lower-case equivalent of c\&. .RE .PP \fBExceptions:\fP .RS 4 \fI\fBstd::bad_cast\fP\fP if the imbued locale does not support the ctype facet\&. .RE .PP .PP Definition at line 482 of file tr1_impl/regex\&. .PP References std::tolower(), and std::use_facet()\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.