.TH "__gnu_cxx::__rc_string_base< _CharT, _Traits, _Alloc >" 3cxx "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME __gnu_cxx::__rc_string_base< _CharT, _Traits, _Alloc > .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits __gnu_cxx::__vstring_utility< _CharT, _Traits, _Alloc >\&. .SS "Public Types" .in +1c .ti -1c .RI "typedef _Util_Base::_CharT_alloc_type \fB_CharT_alloc_type\fP" .br .ti -1c .RI "typedef __vstring_utility< _CharT, _Traits, _Alloc > \fB_Util_Base\fP" .br .ti -1c .RI "typedef _Alloc \fBallocator_type\fP" .br .ti -1c .RI "typedef _CharT_alloc_type::size_type \fBsize_type\fP" .br .ti -1c .RI "typedef _Traits \fBtraits_type\fP" .br .ti -1c .RI "typedef _Traits::char_type \fBvalue_type\fP" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "\fB__rc_string_base\fP (\fB__rc_string_base\fP &&__rcs)" .br .ti -1c .RI "template \fB__rc_string_base\fP (_InputIterator __beg, _InputIterator __end, const _Alloc &__a)" .br .ti -1c .RI "\fB__rc_string_base\fP (const \fB__rc_string_base\fP &__rcs)" .br .ti -1c .RI "\fB__rc_string_base\fP (const _Alloc &__a)" .br .ti -1c .RI "\fB__rc_string_base\fP (size_type __n, _CharT __c, const _Alloc &__a)" .br .ti -1c .RI "void \fB_M_assign\fP (const \fB__rc_string_base\fP &__rcs)" .br .ti -1c .RI "size_type \fB_M_capacity\fP () const" .br .ti -1c .RI "void \fB_M_clear\fP ()" .br .ti -1c .RI "bool \fB_M_compare\fP (const \fB__rc_string_base\fP &) const" .br .ti -1c .RI "bool \fB_M_compare\fP (const \fB__rc_string_base\fP &__rcs) const" .br .ti -1c .RI "bool \fB_M_compare\fP (const \fB__rc_string_base\fP &__rcs) const" .br .ti -1c .RI "_CharT * \fB_M_data\fP () const" .br .ti -1c .RI "void \fB_M_erase\fP (size_type __pos, size_type __n)" .br .ti -1c .RI "allocator_type & \fB_M_get_allocator\fP ()" .br .ti -1c .RI "const allocator_type & \fB_M_get_allocator\fP () const" .br .ti -1c .RI "bool \fB_M_is_shared\fP () const" .br .ti -1c .RI "void \fB_M_leak\fP ()" .br .ti -1c .RI "size_type \fB_M_length\fP () const" .br .ti -1c .RI "size_type \fB_M_max_size\fP () const" .br .ti -1c .RI "void \fB_M_mutate\fP (size_type __pos, size_type __len1, const _CharT *__s, size_type __len2)" .br .ti -1c .RI "void \fB_M_reserve\fP (size_type __res)" .br .ti -1c .RI "void \fB_M_set_leaked\fP ()" .br .ti -1c .RI "void \fB_M_set_length\fP (size_type __n)" .br .ti -1c .RI "void \fB_M_swap\fP (\fB__rc_string_base\fP &__rcs)" .br .ti -1c .RI "template _CharT * \fB_S_construct\fP (_InIterator __beg, _InIterator __end, const _Alloc &__a, \fBstd::forward_iterator_tag\fP)" .br .in -1c .SS "Protected Types" .in +1c .ti -1c .RI "typedef __gnu_cxx::__normal_iterator< const_pointer, \fB__gnu_cxx::__versa_string\fP< _CharT, _Traits, _Alloc, \fB__rc_string_base\fP > > \fB__const_rc_iterator\fP" .br .ti -1c .RI "typedef __gnu_cxx::__normal_iterator< const_pointer, \fB__gnu_cxx::__versa_string\fP< _CharT, _Traits, _Alloc, __sso_string_base > > \fB__const_sso_iterator\fP" .br .ti -1c .RI "typedef __gnu_cxx::__normal_iterator< pointer, \fB__gnu_cxx::__versa_string\fP< _CharT, _Traits, _Alloc, \fB__rc_string_base\fP > > \fB__rc_iterator\fP" .br .ti -1c .RI "typedef __gnu_cxx::__normal_iterator< pointer, \fB__gnu_cxx::__versa_string\fP< _CharT, _Traits, _Alloc, __sso_string_base > > \fB__sso_iterator\fP" .br .ti -1c .RI "typedef _CharT_alloc_type::const_pointer \fBconst_pointer\fP" .br .ti -1c .RI "typedef _CharT_alloc_type::difference_type \fBdifference_type\fP" .br .ti -1c .RI "typedef _CharT_alloc_type::pointer \fBpointer\fP" .br .in -1c .SS "Static Protected Member Functions" .in +1c .ti -1c .RI "static void \fB_S_assign\fP (_CharT *__d, size_type __n, _CharT __c)" .br .ti -1c .RI "static int \fB_S_compare\fP (size_type __n1, size_type __n2)" .br .ti -1c .RI "static void \fB_S_copy\fP (_CharT *__d, const _CharT *__s, size_type __n)" .br .ti -1c .RI "static void \fB_S_copy_chars\fP (_CharT *__p, __const_rc_iterator __k1, __const_rc_iterator __k2)" .br .ti -1c .RI "static void \fB_S_copy_chars\fP (_CharT *__p, __const_sso_iterator __k1, __const_sso_iterator __k2)" .br .ti -1c .RI "static void \fB_S_copy_chars\fP (_CharT *__p, __rc_iterator __k1, __rc_iterator __k2)" .br .ti -1c .RI "static void \fB_S_copy_chars\fP (_CharT *__p, __sso_iterator __k1, __sso_iterator __k2)" .br .ti -1c .RI "static void \fB_S_copy_chars\fP (_CharT *__p, _CharT *__k1, _CharT *__k2)" .br .ti -1c .RI "template static void \fB_S_copy_chars\fP (_CharT *__p, _Iterator __k1, _Iterator __k2)" .br .ti -1c .RI "static void \fB_S_copy_chars\fP (_CharT *__p, const _CharT *__k1, const _CharT *__k2)" .br .ti -1c .RI "static void \fB_S_move\fP (_CharT *__d, const _CharT *__s, size_type __n)" .br .in -1c .SH "Detailed Description" .PP .SS "template .br class __gnu_cxx::__rc_string_base< _CharT, _Traits, _Alloc >"Documentation? What's that? Nathan Myers ncm@cantrip.org\&. .PP A string looks like this: .PP .PP .nf [_Rep] _M_length [__rc_string_base] _M_capacity _M_dataplus _M_refcount _M_p \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-> unnamed array of char_type .fi .PP .PP Where the _M_p points to the first character in the string, and you cast it to a pointer-to-_Rep and subtract 1 to get a pointer to the header\&. .PP This approach has the enormous advantage that a string object requires only one allocation\&. All the ugliness is confined within a single pair of inline functions, which each compile to a single \fIadd\fP instruction: _Rep::_M_refdata(), and __rc_string_base::_M_rep(); and the allocation function which gets a block of raw bytes and with room enough and constructs a _Rep object at the front\&. .PP The reason you want _M_data pointing to the character array and not the _Rep is so that the debugger can see the string contents\&. (Probably we should add a non-inline member to get the _Rep for the debugger to use, so users can check the actual string length\&.) .PP Note that the _Rep object is a POD so that you can have a static \fIempty string\fP _Rep object already \fIconstructed\fP before static constructors have run\&. The reference-count encoding is chosen so that a 0 indicates one reference, so you never try to destroy the empty-string _Rep object\&. .PP All but the last paragraph is considered pretty conventional for a C++ string implementation\&. .PP Definition at line \fB82\fP of file \fBrc_string_base\&.h\fP\&. .SH "Member Typedef Documentation" .PP .SS "template typedef __gnu_cxx:: __normal_iterator > __gnu_cxx::__vstring_utility< _CharT, _Traits, _Alloc >::__const_rc_iterator\fC [inherited]\fP" .PP Definition at line \fB84\fP of file \fBvstring_util\&.h\fP\&. .SS "template typedef __gnu_cxx:: __normal_iterator > __gnu_cxx::__vstring_utility< _CharT, _Traits, _Alloc >::__const_sso_iterator\fC [inherited]\fP" .PP Definition at line \fB72\fP of file \fBvstring_util\&.h\fP\&. .SS "template typedef __gnu_cxx:: __normal_iterator > __gnu_cxx::__vstring_utility< _CharT, _Traits, _Alloc >::__rc_iterator\fC [inherited]\fP" .PP Definition at line \fB79\fP of file \fBvstring_util\&.h\fP\&. .SS "template typedef __gnu_cxx:: __normal_iterator > __gnu_cxx::__vstring_utility< _CharT, _Traits, _Alloc >::__sso_iterator\fC [inherited]\fP" .PP Definition at line \fB67\fP of file \fBvstring_util\&.h\fP\&. .SS "template typedef _Util_Base::_CharT_alloc_type \fB__gnu_cxx::__rc_string_base\fP< _CharT, _Traits, _Alloc >::_CharT_alloc_type" .PP Definition at line \fB91\fP of file \fBrc_string_base\&.h\fP\&. .SS "template typedef __vstring_utility<_CharT, _Traits, _Alloc> \fB__gnu_cxx::__rc_string_base\fP< _CharT, _Traits, _Alloc >::_Util_Base" .PP Definition at line \fB90\fP of file \fBrc_string_base\&.h\fP\&. .SS "template typedef _Alloc \fB__gnu_cxx::__rc_string_base\fP< _CharT, _Traits, _Alloc >::allocator_type" .PP Definition at line \fB88\fP of file \fBrc_string_base\&.h\fP\&. .SS "template typedef _CharT_alloc_type::const_pointer __gnu_cxx::__vstring_utility< _CharT, _Traits, _Alloc >::const_pointer\fC [inherited]\fP" .PP Definition at line \fB60\fP of file \fBvstring_util\&.h\fP\&. .SS "template typedef _CharT_alloc_type::difference_type __gnu_cxx::__vstring_utility< _CharT, _Traits, _Alloc >::difference_type\fC [inherited]\fP" .PP Definition at line \fB58\fP of file \fBvstring_util\&.h\fP\&. .SS "template typedef _CharT_alloc_type::pointer __gnu_cxx::__vstring_utility< _CharT, _Traits, _Alloc >::pointer\fC [inherited]\fP" .PP Definition at line \fB59\fP of file \fBvstring_util\&.h\fP\&. .SS "template typedef _CharT_alloc_type::size_type \fB__gnu_cxx::__rc_string_base\fP< _CharT, _Traits, _Alloc >::size_type" .PP Definition at line \fB92\fP of file \fBrc_string_base\&.h\fP\&. .SS "template typedef _Traits \fB__gnu_cxx::__rc_string_base\fP< _CharT, _Traits, _Alloc >::traits_type" .PP Definition at line \fB86\fP of file \fBrc_string_base\&.h\fP\&. .SS "template typedef _Traits::char_type \fB__gnu_cxx::__rc_string_base\fP< _CharT, _Traits, _Alloc >::value_type" .PP Definition at line \fB87\fP of file \fBrc_string_base\&.h\fP\&. .SH "Constructor & Destructor Documentation" .PP .SS "template \fB__gnu_cxx::__rc_string_base\fP< _CharT, _Traits, _Alloc >::__rc_string_base ()\fC [inline]\fP" .PP Definition at line \fB309\fP of file \fBrc_string_base\&.h\fP\&. .SS "template \fB__gnu_cxx::__rc_string_base\fP< _CharT, _Traits, _Alloc >::__rc_string_base (const _Alloc & __a)" .PP Definition at line \fB473\fP of file \fBrc_string_base\&.h\fP\&. .SS "template \fB__gnu_cxx::__rc_string_base\fP< _CharT, _Traits, _Alloc >::__rc_string_base (const \fB__rc_string_base\fP< _CharT, _Traits, _Alloc > & __rcs)" .PP Definition at line \fB478\fP of file \fBrc_string_base\&.h\fP\&. .SS "template \fB__gnu_cxx::__rc_string_base\fP< _CharT, _Traits, _Alloc >::__rc_string_base (\fB__rc_string_base\fP< _CharT, _Traits, _Alloc > && __rcs)\fC [inline]\fP" .PP Definition at line \fB317\fP of file \fBrc_string_base\&.h\fP\&. .SS "template \fB__gnu_cxx::__rc_string_base\fP< _CharT, _Traits, _Alloc >::__rc_string_base (size_type __n, _CharT __c, const _Alloc & __a)" .PP Definition at line \fB484\fP of file \fBrc_string_base\&.h\fP\&. .SS "template template \fB__gnu_cxx::__rc_string_base\fP< _CharT, _Traits, _Alloc >::__rc_string_base (_InputIterator __beg, _InputIterator __end, const _Alloc & __a)" .PP Definition at line \fB490\fP of file \fBrc_string_base\&.h\fP\&. .SS "template \fB__gnu_cxx::__rc_string_base\fP< _CharT, _Traits, _Alloc >::~\fB__rc_string_base\fP ()\fC [inline]\fP" .PP Definition at line \fB328\fP of file \fBrc_string_base\&.h\fP\&. .SH "Member Function Documentation" .PP .SS "template void \fB__gnu_cxx::__rc_string_base\fP< _CharT, _Traits, _Alloc >::_M_assign (const \fB__rc_string_base\fP< _CharT, _Traits, _Alloc > & __rcs)" .PP Definition at line \fB623\fP of file \fBrc_string_base\&.h\fP\&. .SS "template size_type \fB__gnu_cxx::__rc_string_base\fP< _CharT, _Traits, _Alloc >::_M_capacity () const\fC [inline]\fP" .PP Definition at line \fB287\fP of file \fBrc_string_base\&.h\fP\&. .SS "template void \fB__gnu_cxx::__rc_string_base\fP< _CharT, _Traits, _Alloc >::_M_clear ()\fC [inline]\fP" .PP Definition at line \fB356\fP of file \fBrc_string_base\&.h\fP\&. .SS "template bool \fB__gnu_cxx::__rc_string_base\fP< _CharT, _Traits, _Alloc >::_M_compare (const \fB__rc_string_base\fP< _CharT, _Traits, _Alloc > &) const\fC [inline]\fP" .PP Definition at line \fB363\fP of file \fBrc_string_base\&.h\fP\&. .SS "bool \fB__gnu_cxx::__rc_string_base\fP< char, \fBstd::char_traits\fP< char >, \fBstd::allocator\fP< char > >::_M_compare (const \fB__rc_string_base\fP< _CharT, _Traits, _Alloc > & __rcs) const\fC [inline]\fP" .PP Definition at line \fB711\fP of file \fBrc_string_base\&.h\fP\&. .SS "bool \fB__gnu_cxx::__rc_string_base\fP< wchar_t, \fBstd::char_traits\fP< wchar_t >, \fBstd::allocator\fP< wchar_t > >::_M_compare (const \fB__rc_string_base\fP< _CharT, _Traits, _Alloc > & __rcs) const\fC [inline]\fP" .PP Definition at line \fB723\fP of file \fBrc_string_base\&.h\fP\&. .SS "template _CharT * \fB__gnu_cxx::__rc_string_base\fP< _CharT, _Traits, _Alloc >::_M_data () const\fC [inline]\fP" .PP Definition at line \fB279\fP of file \fBrc_string_base\&.h\fP\&. .SS "template void \fB__gnu_cxx::__rc_string_base\fP< _CharT, _Traits, _Alloc >::_M_erase (size_type __pos, size_type __n)" .PP Definition at line \fB677\fP of file \fBrc_string_base\&.h\fP\&. .SS "template allocator_type & \fB__gnu_cxx::__rc_string_base\fP< _CharT, _Traits, _Alloc >::_M_get_allocator ()\fC [inline]\fP" .PP Definition at line \fB332\fP of file \fBrc_string_base\&.h\fP\&. .SS "template const allocator_type & \fB__gnu_cxx::__rc_string_base\fP< _CharT, _Traits, _Alloc >::_M_get_allocator () const\fC [inline]\fP" .PP Definition at line \fB336\fP of file \fBrc_string_base\&.h\fP\&. .SS "template bool \fB__gnu_cxx::__rc_string_base\fP< _CharT, _Traits, _Alloc >::_M_is_shared () const\fC [inline]\fP" .PP Definition at line \fB291\fP of file \fBrc_string_base\&.h\fP\&. .SS "template void \fB__gnu_cxx::__rc_string_base\fP< _CharT, _Traits, _Alloc >::_M_leak ()\fC [inline]\fP" .PP Definition at line \fB299\fP of file \fBrc_string_base\&.h\fP\&. .SS "template size_type \fB__gnu_cxx::__rc_string_base\fP< _CharT, _Traits, _Alloc >::_M_length () const\fC [inline]\fP" .PP Definition at line \fB283\fP of file \fBrc_string_base\&.h\fP\&. .SS "template size_type \fB__gnu_cxx::__rc_string_base\fP< _CharT, _Traits, _Alloc >::_M_max_size () const\fC [inline]\fP" .PP Definition at line \fB275\fP of file \fBrc_string_base\&.h\fP\&. .SS "template void \fB__gnu_cxx::__rc_string_base\fP< _CharT, _Traits, _Alloc >::_M_mutate (size_type __pos, size_type __len1, const _CharT * __s, size_type __len2)" .PP Definition at line \fB654\fP of file \fBrc_string_base\&.h\fP\&. .SS "template void \fB__gnu_cxx::__rc_string_base\fP< _CharT, _Traits, _Alloc >::_M_reserve (size_type __res)" .PP Definition at line \fB636\fP of file \fBrc_string_base\&.h\fP\&. .SS "template void \fB__gnu_cxx::__rc_string_base\fP< _CharT, _Traits, _Alloc >::_M_set_leaked ()\fC [inline]\fP" .PP Definition at line \fB295\fP of file \fBrc_string_base\&.h\fP\&. .SS "template void \fB__gnu_cxx::__rc_string_base\fP< _CharT, _Traits, _Alloc >::_M_set_length (size_type __n)\fC [inline]\fP" .PP Definition at line \fB306\fP of file \fBrc_string_base\&.h\fP\&. .SS "template void \fB__gnu_cxx::__rc_string_base\fP< _CharT, _Traits, _Alloc >::_M_swap (\fB__rc_string_base\fP< _CharT, _Traits, _Alloc > & __rcs)" .PP Definition at line \fB603\fP of file \fBrc_string_base\&.h\fP\&. .SS "template static void __gnu_cxx::__vstring_utility< _CharT, _Traits, _Alloc >::_S_assign (_CharT * __d, size_type __n, _CharT __c)\fC [inline]\fP, \fC [static]\fP, \fC [inherited]\fP" .PP Definition at line \fB122\fP of file \fBvstring_util\&.h\fP\&. .SS "template static int __gnu_cxx::__vstring_utility< _CharT, _Traits, _Alloc >::_S_compare (size_type __n1, size_type __n2)\fC [inline]\fP, \fC [static]\fP, \fC [inherited]\fP" .PP Definition at line \fB167\fP of file \fBvstring_util\&.h\fP\&. .SS "template template _CharT * \fB__gnu_cxx::__rc_string_base\fP< _CharT, _Traits, _Alloc >::_S_construct (_InIterator __beg, _InIterator __end, const _Alloc & __a, \fBstd::forward_iterator_tag\fP)" .PP Definition at line \fB557\fP of file \fBrc_string_base\&.h\fP\&. .SS "template static void __gnu_cxx::__vstring_utility< _CharT, _Traits, _Alloc >::_S_copy (_CharT * __d, const _CharT * __s, size_type __n)\fC [inline]\fP, \fC [static]\fP, \fC [inherited]\fP" .PP Definition at line \fB104\fP of file \fBvstring_util\&.h\fP\&. .SS "template static void __gnu_cxx::__vstring_utility< _CharT, _Traits, _Alloc >::_S_copy_chars (_CharT * __p, __const_rc_iterator __k1, __const_rc_iterator __k2)\fC [inline]\fP, \fC [static]\fP, \fC [inherited]\fP" .PP Definition at line \fB154\fP of file \fBvstring_util\&.h\fP\&. .SS "template static void __gnu_cxx::__vstring_utility< _CharT, _Traits, _Alloc >::_S_copy_chars (_CharT * __p, __const_sso_iterator __k1, __const_sso_iterator __k2)\fC [inline]\fP, \fC [static]\fP, \fC [inherited]\fP" .PP Definition at line \fB145\fP of file \fBvstring_util\&.h\fP\&. .SS "template static void __gnu_cxx::__vstring_utility< _CharT, _Traits, _Alloc >::_S_copy_chars (_CharT * __p, __rc_iterator __k1, __rc_iterator __k2)\fC [inline]\fP, \fC [static]\fP, \fC [inherited]\fP" .PP Definition at line \fB150\fP of file \fBvstring_util\&.h\fP\&. .SS "template static void __gnu_cxx::__vstring_utility< _CharT, _Traits, _Alloc >::_S_copy_chars (_CharT * __p, __sso_iterator __k1, __sso_iterator __k2)\fC [inline]\fP, \fC [static]\fP, \fC [inherited]\fP" .PP Definition at line \fB141\fP of file \fBvstring_util\&.h\fP\&. .SS "template static void __gnu_cxx::__vstring_utility< _CharT, _Traits, _Alloc >::_S_copy_chars (_CharT * __p, _CharT * __k1, _CharT * __k2)\fC [inline]\fP, \fC [static]\fP, \fC [inherited]\fP" .PP Definition at line \fB159\fP of file \fBvstring_util\&.h\fP\&. .SS "template template static void __gnu_cxx::__vstring_utility< _CharT, _Traits, _Alloc >::_S_copy_chars (_CharT * __p, _Iterator __k1, _Iterator __k2)\fC [inline]\fP, \fC [static]\fP, \fC [inherited]\fP" .PP Definition at line \fB134\fP of file \fBvstring_util\&.h\fP\&. .SS "template static void __gnu_cxx::__vstring_utility< _CharT, _Traits, _Alloc >::_S_copy_chars (_CharT * __p, const _CharT * __k1, const _CharT * __k2)\fC [inline]\fP, \fC [static]\fP, \fC [inherited]\fP" .PP Definition at line \fB163\fP of file \fBvstring_util\&.h\fP\&. .SS "template static void __gnu_cxx::__vstring_utility< _CharT, _Traits, _Alloc >::_S_move (_CharT * __d, const _CharT * __s, size_type __n)\fC [inline]\fP, \fC [static]\fP, \fC [inherited]\fP" .PP Definition at line \fB113\fP of file \fBvstring_util\&.h\fP\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.