STD::COLLATE_BYNAME(3cxx)
okay bestie, we're in std::collate_byname< _CharT >, manual section 3cxx, and it's giving byname collate class energy from <locale> π
β¨. No cap, every tiny detail is staying, so grab a strawberry π and let's go.
π NAME π
std::collate_byname< _CharT > β the class collate_byname [22.2.4.2]. That's the whole name vibe. Periodt.
β¨ SYNOPSIS β¨
#include <locale>
Inherits std::collate< _CharT >. Yes bestie, inherited energy π.
πΈ Public Types πΈ
typedef _CharT char_typeβ public typedef, iconic.typedef basic_string< _CharT > string_typeβ public typedef, also iconic.
π Public Member Functions π
Constructors, exactly:
collate_byname (const char *__s, size_t __refs=0)collate_byname (const string &__s, size_t __refs=0)
The overloads, exactly:
int _M_compare (const _CharT *, const _CharT *) const throw ()int _M_compare (const char *, const char *) const throw()int _M_compare (const wchar_t *, const wchar_t *) const throw()size_t _M_transform (_CharT *, const _CharT *, size_t) const throw ()size_t _M_transform (char *, const char *, size_t) const throw()size_t _M_transform (wchar_t *, const wchar_t *, size_t) const throw()
The main-character functions:
int compare (const _CharT *__lo1, const _CharT *__hi1, const _CharT *__lo2, const _CharT *__hi2) constβ Compare two strings.long hash (const _CharT *__lo, const _CharT *__hi) constβ Return hash of a string.string_type transform (const _CharT *__lo, const _CharT *__hi) constβ Transform string to comparable form.
β Static Public Attributes β
static locale::id idβNumpunct facet id.(that's literally the description, bestie π).
π‘οΈ Protected Member Functions π‘οΈ
virtual int do_compare (const _CharT *__lo1, const _CharT *__hi1, const _CharT *__lo2, const _CharT *__hi2) constβ Compare two strings.virtual long do_hash (const _CharT *__lo, const _CharT *__hi) constβ Return hash of a string.virtual string_type do_transform (const _CharT *__lo, const _CharT *__hi) constβ Transform string to comparable form.
π§ Static Protected Member Functions π§
The source gives no extra blurb for these, so here are the exact signatures:
static __c_locale _S_clone_c_locale (__c_locale &__cloc) throw ()static void _S_create_c_locale (__c_locale &__cloc, const char *__s, __c_locale __old=0)static void _S_destroy_c_locale (__c_locale &__cloc)static __c_locale _S_get_c_locale ()static const char * _S_get_c_name () throw ()static __c_locale _S_lc_ctype_c_locale (__c_locale __cloc, const char *__s)
π Protected Attributes π
__c_locale _M_c_locale_collate
π¦ Detailed Description π¦
Doxygen gives us this exact template/class line, and I'm preserving it character for character:
template<typename _CharT>
class std::collate_byname< _CharT >"class collate_byname [22.2.4.2].
That quote mark is in the original, bestie β I'm not fixing it, I'm keeping it π.
π Member Typedef Documentation π
char_type
template<typename _CharT > typedef _CharT std::collate_byname< _CharT >::char_type
Public typedefs. That's the description. Slay.
string_type
template<typename _CharT > typedef basic_string<_CharT> std::collate_byname< _CharT >::string_type
Public typedefs. Same iconic public typedef energy π.
π₯ Member Function Documentation π₯
compare β [inline], [inherited]
template<typename _CharT > int std::collate< _CharT >::compare (const _CharT * __lo1, const _CharT * __hi1, const _CharT * __lo2, const _CharT * __hi2) const
Compare two strings. This function compares two strings and returns the result by calling collate::do_compare().
Parameters
__lo1β Start of string 1.__hi1β End of string 1.__lo2β Start of string 2.__hi2β End of string 2.
Returns 1 if string1 > string2, -1 if string1 < string2, else 0.
do_compare β [protected], [virtual], [inherited]
template<typename _CharT > int std::collate< _CharT >::do_compare (const _CharT * __lo1, const _CharT * __hi1, const _CharT * __lo2, const _CharT * __hi2) const
Compare two strings. This function is a hook for derived classes to change the value returned.
See also compare().
Parameters
__lo1β Start of string 1.__hi1β End of string 1.__lo2β Start of string 2.__hi2β End of string 2.
Returns 1 if string1 > string2, -1 if string1 < string2, else 0.
References std::basic_string< _CharT, _Traits, _Alloc >::c_str(), std::basic_string< _CharT, _Traits, _Alloc >::data(), and std::basic_string< _CharT, _Traits, _Alloc >::length().
do_hash β [protected], [virtual], [inherited]
template<typename _CharT > long std::collate< _CharT >::do_hash (const _CharT * __lo, const _CharT * __hi) const
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.
Parameters
__loβ Start of string.__hiβ End of string.
Returns Hash value.
do_transform β [protected], [virtual], [inherited]
template<typename _CharT > collate< _CharT >::string_type std::collate< _CharT >::do_transform (const _CharT * __lo, const _CharT * __hi) const
Transform string to comparable form. This function is a hook for derived classes to change the value returned.
Parameters
__loβ Start.__hiβ End.
Returns transformed string.
References std::basic_string< _CharT, _Traits, _Alloc >::append(), std::basic_string< _CharT, _Traits, _Alloc >::c_str(), std::basic_string< _CharT, _Traits, _Alloc >::data(), std::basic_string< _CharT, _Traits, _Alloc >::length(), and std::basic_string< _CharT, _Traits, _Alloc >::push_back().
hash β [inline], [inherited]
template<typename _CharT > long std::collate< _CharT >::hash (const _CharT * __lo, const _CharT * __hi) const
Return hash of a string. This function computes and returns a hash on the input string. It does so by returning collate::do_hash().
Parameters
__loβ Start of string.__hiβ End of string.
Returns Hash value.
transform β [inline], [inherited]
template<typename _CharT > string_type std::collate< _CharT >::transform (const _CharT * __lo, const _CharT * __hi) const
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().
Parameters
__loβ Start of string.__hiβ End of string.
Returns Transformed string_type.
π Member Data Documentation π
template<typename _CharT > locale::id std::collate< _CharT >::id
[static], [inherited] β Numpunct facet id. Yes, we're keeping that exact description again, bestie π.
π Author π
Generated automatically by Doxygen for libstdc++ from the source code.
π«Ά that's the whole page, bestie. source/version: libstdc++, manual section 3cxx; date: not listed in the footer. Doxygen-generated from the source code, and we kept every detail. Bye bye πβ¨
π¦ where this page comes from
- ubuntu noble: libstdc++-14-doc 14-20240412-0ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms