.TH "std::__cxx11::collate< _CharT >" 3 "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::__cxx11::collate< _CharT > \- Facet for localized string comparison\&. .SH SYNOPSIS .br .PP .PP \fR#include \fP .PP Inherits \fBstd::locale::facet\fP\&. .SS "Public Types" .PP .RI "\fB\fP" .br .in +1c .in +1c .ti -1c .RI "typedef _CharT \fBchar_type\fP" .br .RI "Public typedefs\&. " .ti -1c .RI "typedef \fBbasic_string\fP< _CharT > \fBstring_type\fP" .br .RI "Public typedefs\&. " .in -1c .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBcollate\fP (__c_locale __cloc, size_t __refs=0)" .br .RI "Internal constructor\&. Not for general use\&. " .ti -1c .RI "\fBcollate\fP (size_t __refs=0)" .br .RI "Constructor performs initialization\&. " .ti -1c .RI "int \fB_M_compare\fP (const _CharT *, const _CharT *) const throw ()" .br .ti -1c .RI "size_t \fB_M_transform\fP (_CharT *, const _CharT *, size_t) const throw ()" .br .ti -1c .RI "int \fBcompare\fP (const _CharT *__lo1, const _CharT *__hi1, const _CharT *__lo2, const _CharT *__hi2) const" .br .RI "Compare two strings\&. " .ti -1c .RI "long \fBhash\fP (const _CharT *__lo, const _CharT *__hi) const" .br .RI "Return hash of a string\&. " .ti -1c .RI "\fBstring_type\fP \fBtransform\fP (const _CharT *__lo, const _CharT *__hi) const" .br .RI "Transform string to comparable form\&. " .in -1c .SS "Static Public Attributes" .in +1c .ti -1c .RI "static \fBlocale::id\fP \fBid\fP" .br .RI "Numpunct facet id\&. " .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "virtual \fB~collate\fP ()" .br .RI "Destructor\&. " .ti -1c .RI "virtual int \fBdo_compare\fP (const _CharT *__lo1, const _CharT *__hi1, const _CharT *__lo2, const _CharT *__hi2) const" .br .RI "Compare two strings\&. " .ti -1c .RI "virtual long \fBdo_hash\fP (const _CharT *__lo, const _CharT *__hi) const" .br .RI "Return hash of a string\&. " .ti -1c .RI "virtual \fBstring_type\fP \fBdo_transform\fP (const _CharT *__lo, const _CharT *__hi) const" .br .RI "Transform string to comparable form\&. " .in -1c .SS "Static Protected Member Functions" .in +1c .ti -1c .RI "static __c_locale \fB_S_clone_c_locale\fP (__c_locale &__cloc) throw ()" .br .ti -1c .RI "static void \fB_S_create_c_locale\fP (__c_locale &__cloc, const char *__s, __c_locale __old=0)" .br .ti -1c .RI "static void \fB_S_destroy_c_locale\fP (__c_locale &__cloc)" .br .ti -1c .RI "static __c_locale \fB_S_get_c_locale\fP ()" .br .ti -1c .RI "static const char * \fB_S_get_c_name\fP () throw ()" .br .ti -1c .RI "static __c_locale \fB_S_lc_ctype_c_locale\fP (__c_locale __cloc, const char *__s)" .br .in -1c .SS "Protected Attributes" .in +1c .ti -1c .RI "__c_locale \fB_M_c_locale_collate\fP" .br .in -1c .SH "Detailed Description" .PP .SS "template .br class std::__cxx11::collate< _CharT >"Facet for localized string comparison\&. This facet encapsulates the code to compare strings in a localized manner\&. .PP The collate template uses protected virtual functions to provide the actual results\&. The public accessors forward the call to the virtual functions\&. These virtual functions are hooks for developers to implement the behavior they require from the collate facet\&. .SH "Member Typedef Documentation" .PP .SS "template _CharT \fBstd::__cxx11::collate\fP< _CharT >::char_type" .PP Public typedefs\&. .SS "template \fBbasic_string\fP<_CharT> \fBstd::__cxx11::collate\fP< _CharT >::string_type" .PP Public typedefs\&. .SH "Constructor & Destructor Documentation" .PP .SS "template \fBstd::__cxx11::collate\fP< _CharT >::collate (size_t __refs = \fR0\fP)\fR [inline]\fP, \fR [explicit]\fP" .PP Constructor performs initialization\&. This is the constructor provided by the standard\&. .PP \fBParameters\fP .RS 4 \fI__refs\fP Passed to the base facet class\&. .RE .PP .SS "template \fBstd::__cxx11::collate\fP< _CharT >::collate (__c_locale __cloc, size_t __refs = \fR0\fP)\fR [inline]\fP, \fR [explicit]\fP" .PP Internal constructor\&. Not for general use\&. This is a constructor for use by the library itself to set up new locales\&. .PP \fBParameters\fP .RS 4 \fI__cloc\fP The C locale\&. .br \fI__refs\fP Passed to the base facet class\&. .RE .PP .SS "template virtual \fBstd::__cxx11::collate\fP< _CharT >::~\fBcollate\fP ()\fR [inline]\fP, \fR [protected]\fP, \fR [virtual]\fP" .PP Destructor\&. .SH "Member Function Documentation" .PP .SS "template int \fBstd::__cxx11::collate\fP< _CharT >::compare (const _CharT * __lo1, const _CharT * __hi1, const _CharT * __lo2, const _CharT * __hi2) const\fR [inline]\fP" .PP Compare two strings\&. This function compares two strings and returns the result by calling collate::do_compare()\&. .PP \fBParameters\fP .RS 4 \fI__lo1\fP Start of string 1\&. .br \fI__hi1\fP End of string 1\&. .br \fI__lo2\fP Start of string 2\&. .br \fI__hi2\fP End of string 2\&. .RE .PP \fBReturns\fP .RS 4 1 if string1 > string2, -1 if string1 < string2, else 0\&. .RE .PP .SS "template int std::collate< _CharT >::do_compare (const _CharT * __lo1, const _CharT * __hi1, const _CharT * __lo2, const _CharT * __hi2) const\fR [protected]\fP, \fR [virtual]\fP" .PP Compare two strings\&. This function is a hook for derived classes to change the value returned\&. .PP \fBSee also\fP .RS 4 compare()\&. .RE .PP \fBParameters\fP .RS 4 \fI__lo1\fP Start of string 1\&. .br \fI__hi1\fP End of string 1\&. .br \fI__lo2\fP Start of string 2\&. .br \fI__hi2\fP End of string 2\&. .RE .PP \fBReturns\fP .RS 4 1 if string1 > string2, -1 if string1 < string2, else 0\&. .RE .PP .SS "template long std::collate< _CharT >::do_hash (const _CharT * __lo, const _CharT * __hi) const\fR [protected]\fP, \fR [virtual]\fP" .PP Return hash of a string\&. This function computes and returns a hash on the input string\&. This function is a hook for derived classes to change the value returned\&. .PP \fBParameters\fP .RS 4 \fI__lo\fP Start of string\&. .br \fI__hi\fP End of string\&. .RE .PP \fBReturns\fP .RS 4 Hash value\&. .RE .PP .SS "template \fBcollate\fP< _CharT >\fB::string_type\fP std::collate< _CharT >::do_transform (const _CharT * __lo, const _CharT * __hi) const\fR [protected]\fP, \fR [virtual]\fP" .PP Transform string to comparable form\&. This function is a hook for derived classes to change the value returned\&. .PP \fBParameters\fP .RS 4 \fI__lo\fP Start\&. .br \fI__hi\fP End\&. .RE .PP \fBReturns\fP .RS 4 transformed string\&. .RE .PP .SS "template long \fBstd::__cxx11::collate\fP< _CharT >::hash (const _CharT * __lo, const _CharT * __hi) const\fR [inline]\fP" .PP Return hash of a string\&. This function computes and returns a hash on the input string\&. It does so by returning collate::do_hash()\&. .PP \fBParameters\fP .RS 4 \fI__lo\fP Start of string\&. .br \fI__hi\fP End of string\&. .RE .PP \fBReturns\fP .RS 4 Hash value\&. .RE .PP .SS "template \fBstring_type\fP \fBstd::__cxx11::collate\fP< _CharT >::transform (const _CharT * __lo, const _CharT * __hi) const\fR [inline]\fP" .PP Transform string to comparable form\&. This function is a wrapper for strxfrm functionality\&. It takes the input string and returns a modified string that can be directly compared to other transformed strings\&. In the C locale, this function just returns a copy of the input string\&. In some other locales, it may replace two chars with one, change a char for another, etc\&. It does so by returning collate::do_transform()\&. .PP \fBParameters\fP .RS 4 \fI__lo\fP Start of string\&. .br \fI__hi\fP End of string\&. .RE .PP \fBReturns\fP .RS 4 Transformed string_type\&. .RE .PP .SH "Member Data Documentation" .PP .SS "template \fBlocale::id\fP std::collate< _CharT >::id\fR [static]\fP" .PP Numpunct facet id\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.