STLdoc
STLdocumentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
basic_string< _Elem, _Traits, _Alloc > Class Template Reference
Inheritance diagram for basic_string< _Elem, _Traits, _Alloc >:
_String_alloc< _String_base_types< _Elem, _Alloc > >

Public Types

typedef basic_string< _Elem, _Traits, _Alloc_Myt
 
typedef _String_alloc< _String_base_types< _Elem, _Alloc > > _Mybase
 
typedef _Traits traits_type
 
typedef _Alloc allocator_type
 
typedef _Mybase::_Alty _Alty
 
typedef _Mybase::value_type value_type
 
typedef _Mybase::size_type size_type
 
typedef _Mybase::difference_type difference_type
 
typedef _Mybase::pointer pointer
 
typedef _Mybase::const_pointer const_pointer
 
typedef _Mybase::reference reference
 
typedef _Mybase::const_reference const_reference
 
typedef _Mybase::iterator iterator
 
typedef _Mybase::const_iterator const_iterator
 
typedef _STD reverse_iterator< iteratorreverse_iterator
 
typedef _STD reverse_iterator< const_iteratorconst_reverse_iterator
 
- Public Types inherited from _String_alloc< _String_base_types< _Elem, _Alloc > >
enum  
 
enum  
 
typedef _String_alloc< _String_base_types< _Elem, _Alloc > > _Myt
 
typedef _String_base_types< _Elem, _Alloc >::_Alloc _Alloc
 
typedef _String_base_types< _Elem, _Alloc >::_Alty _Alty
 
typedef _String_base_types< _Elem, _Alloc >::_Val_types _Val_types
 
typedef _Val_types::value_type value_type
 
typedef _Val_types::size_type size_type
 
typedef _Val_types::difference_type difference_type
 
typedef _Val_types::pointer pointer
 
typedef _Val_types::const_pointer const_pointer
 
typedef _Val_types::reference reference
 
typedef _Val_types::const_reference const_reference
 
typedef _String_iterator< _String_val< _Val_types > > iterator
 
typedef _String_const_iterator< _String_val< _Val_types > > const_iterator
 
typedef _String_val< _Val_types >::_Bxty _Bxty
 

Public Member Functions

 basic_string (const _Myt &_Right)
 
 basic_string (const _Myt &_Right, const _Alloc &_Al)
 
 basic_string () _NOEXCEPT_OP(is_nothrow_default_constructible< _Alloc >
 
 basic_string (const _Alloc &_Al) _NOEXCEPT
 
 basic_string (const _Myt &_Right, size_type _Roff, size_type _Count=npos)
 
 basic_string (const _Myt &_Right, size_type _Roff, size_type _Count, const _Alloc &_Al)
 
 basic_string (const _Elem *_Ptr, size_type _Count)
 
 basic_string (const _Elem *_Ptr, size_type _Count, const _Alloc &_Al)
 
 basic_string (const _Elem *_Ptr)
 
 basic_string (const _Elem *_Ptr, const _Alloc &_Al)
 
 basic_string (size_type _Count, _Elem _Ch)
 
 basic_string (size_type _Count, _Elem _Ch, const _Alloc &_Al)
 
template<class _Iter , class = typename enable_if<_Is_iterator<_Iter>::value, void>::type>
 basic_string (_Iter _First, _Iter _Last, const _Alloc &_Al=_Alloc())
 
template<class _Iter >
void _Construct (_Iter _First, _Iter _Last, input_iterator_tag)
 
template<class _Iter >
void _Construct (_Iter _First, _Iter _Last, forward_iterator_tag)
 
void _Construct (_Elem *_First, _Elem *_Last, random_access_iterator_tag)
 
void _Construct (const _Elem *_First, const _Elem *_Last, random_access_iterator_tag)
 
 basic_string (_Myt &&_Right) _NOEXCEPT
 
 basic_string (_Myt &&_Right, const _Alloc &_Al)
 
_Mytoperator= (_Myt &&_Right) _NOEXCEPT_OP(_Alty
 
_Mytassign (_Myt &&_Right) _NOEXCEPT
 
void _Assign_rv (_Myt &&_Right)
 
 basic_string (_XSTD initializer_list< _Elem > _Ilist, const _Alloc &_Al=allocator_type())
 
_Mytoperator= (_XSTD initializer_list< _Elem > _Ilist)
 
_Mytoperator+= (_XSTD initializer_list< _Elem > _Ilist)
 
_Mytassign (_XSTD initializer_list< _Elem > _Ilist)
 
_Mytappend (_XSTD initializer_list< _Elem > _Ilist)
 
iterator insert (const_iterator _Where, _XSTD initializer_list< _Elem > _Ilist)
 
_Mytreplace (const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
 
 ~basic_string () _NOEXCEPT
 
_Mytoperator= (const _Myt &_Right)
 
_Mytoperator= (const _Elem *_Ptr)
 
_Mytoperator= (_Elem _Ch)
 
_Mytoperator+= (const _Myt &_Right)
 
_Mytoperator+= (const _Elem *_Ptr)
 
_Mytoperator+= (_Elem _Ch)
 
_Mytappend (const _Myt &_Right)
 
_Mytappend (const _Myt &_Right, size_type _Roff, size_type _Count=npos)
 
_Mytappend (const _Elem *_Ptr, size_type _Count)
 
_Mytappend (const _Elem *_Ptr)
 
_Mytappend (size_type _Count, _Elem _Ch)
 
template<class _Iter >
enable_if< _Is_iterator< _Iter >::value, _Myt & >::type append (_Iter _First, _Iter _Last)
 
_Mytappend (const_pointer _First, const_pointer _Last)
 
_Mytappend (const_iterator _First, const_iterator _Last)
 
_Mytassign (const _Myt &_Right)
 
_Mytassign (const _Myt &_Right, size_type _Roff, size_type _Count=npos)
 
_Mytassign (const _Elem *_Ptr, size_type _Count)
 
_Mytassign (const _Elem *_Ptr)
 
_Mytassign (size_type _Count, _Elem _Ch)
 
template<class _Iter >
enable_if< _Is_iterator< _Iter >::value, _Myt & >::type assign (_Iter _First, _Iter _Last)
 
_Mytassign (const_pointer _First, const_pointer _Last)
 
_Mytassign (const_iterator _First, const_iterator _Last)
 
_Mytinsert (size_type _Off, const _Myt &_Right)
 
_Mytinsert (size_type _Off, const _Myt &_Right, size_type _Roff, size_type _Count=npos)
 
_Mytinsert (size_type _Off, const _Elem *_Ptr, size_type _Count)
 
_Mytinsert (size_type _Off, const _Elem *_Ptr)
 
_Mytinsert (size_type _Off, size_type _Count, _Elem _Ch)
 
iterator insert (const_iterator _Where)
 
iterator insert (const_iterator _Where, _Elem _Ch)
 
iterator insert (const_iterator _Where, size_type _Count, _Elem _Ch)
 
template<class _Iter >
enable_if< _Is_iterator< _Iter >::value, iterator >::type insert (const_iterator _Where, _Iter _First, _Iter _Last)
 
iterator insert (const_iterator _Where, const_pointer _First, const_pointer _Last)
 
iterator insert (const_iterator _Where, const_iterator _First, const_iterator _Last)
 
_Myterase (size_type _Off=0)
 
_Myterase (size_type _Off, size_type _Count)
 
iterator erase (const_iterator _Where)
 
iterator erase (const_iterator _First, const_iterator _Last)
 
void clear () _NOEXCEPT
 
_Mytreplace (size_type _Off, size_type _N0, const _Myt &_Right)
 
_Mytreplace (size_type _Off, size_type _N0, const _Myt &_Right, size_type _Roff, size_type _Count=npos)
 
_Mytreplace (size_type _Off, size_type _N0, const _Elem *_Ptr, size_type _Count)
 
_Mytreplace (size_type _Off, size_type _N0, const _Elem *_Ptr)
 
_Mytreplace (size_type _Off, size_type _N0, size_type _Count, _Elem _Ch)
 
_Mytreplace (const_iterator _First, const_iterator _Last, const _Myt &_Right)
 
_Mytreplace (const_iterator _First, const_iterator _Last, const _Elem *_Ptr, size_type _Count)
 
_Mytreplace (const_iterator _First, const_iterator _Last, const _Elem *_Ptr)
 
_Mytreplace (const_iterator _First, const_iterator _Last, size_type _Count, _Elem _Ch)
 
template<class _Iter >
enable_if< _Is_iterator< _Iter >::value, _Myt & >::type replace (const_iterator _First, const_iterator _Last, _Iter _First2, _Iter _Last2)
 
_Mytreplace (const_iterator _First, const_iterator _Last, const_pointer _First2, const_pointer _Last2)
 
_Mytreplace (const_iterator _First, const_iterator _Last, pointer _First2, pointer _Last2)
 
_Mytreplace (const_iterator _First, const_iterator _Last, const_iterator _First2, const_iterator _Last2)
 
_Mytreplace (const_iterator _First, const_iterator _Last, iterator _First2, iterator _Last2)
 
iterator begin () _NOEXCEPT
 
const_iterator begin () const _NOEXCEPT
 
iterator end () _NOEXCEPT
 
const_iterator end () const _NOEXCEPT
 
reverse_iterator rbegin () _NOEXCEPT
 
const_reverse_iterator rbegin () const _NOEXCEPT
 
reverse_iterator rend () _NOEXCEPT
 
const_reverse_iterator rend () const _NOEXCEPT
 
const_iterator cbegin () const _NOEXCEPT
 
const_iterator cend () const _NOEXCEPT
 
const_reverse_iterator crbegin () const _NOEXCEPT
 
const_reverse_iterator crend () const _NOEXCEPT
 
void shrink_to_fit ()
 
reference at (size_type _Off)
 
const_reference at (size_type _Off) const
 
reference operator[] (size_type _Off)
 
const_reference operator[] (size_type _Off) const
 
void push_back (_Elem _Ch)
 
void pop_back ()
 
reference front ()
 
const_reference front () const
 
reference back ()
 
const_reference back () const
 
const _Elem * c_str () const _NOEXCEPT
 
const _Elem * data () const _NOEXCEPT
 
size_type length () const _NOEXCEPT
 
size_type size () const _NOEXCEPT
 
size_type max_size () const _NOEXCEPT
 
void resize (size_type _Newsize)
 
void resize (size_type _Newsize, _Elem _Ch)
 
size_type capacity () const _NOEXCEPT
 
void reserve (size_type _Newcap=0)
 
bool empty () const _NOEXCEPT
 
size_type copy (_Elem *_Ptr, size_type _Count, size_type _Off=0) const
 
size_type _Copy_s (_Elem *_Dest, size_type _Dest_size, size_type _Count, size_type _Off=0) const
 
void _Swap_bx (_Myt &_Right)
 
void swap (_Myt &_Right) _NOEXCEPT_OP(_Alty
 
size_type find (const _Myt &_Right, size_type _Off=0) const _NOEXCEPT
 
size_type find (const _Elem *_Ptr, size_type _Off, size_type _Count) const
 
size_type find (const _Elem *_Ptr, size_type _Off=0) const
 
size_type find (_Elem _Ch, size_type _Off=0) const
 
size_type rfind (const _Myt &_Right, size_type _Off=npos) const _NOEXCEPT
 
size_type rfind (const _Elem *_Ptr, size_type _Off, size_type _Count) const
 
size_type rfind (const _Elem *_Ptr, size_type _Off=npos) const
 
size_type rfind (_Elem _Ch, size_type _Off=npos) const
 
size_type find_first_of (const _Myt &_Right, size_type _Off=0) const _NOEXCEPT
 
size_type find_first_of (const _Elem *_Ptr, size_type _Off, size_type _Count) const
 
size_type find_first_of (const _Elem *_Ptr, size_type _Off=0) const
 
size_type find_first_of (_Elem _Ch, size_type _Off=0) const
 
size_type find_last_of (const _Myt &_Right, size_type _Off=npos) const _NOEXCEPT
 
size_type find_last_of (const _Elem *_Ptr, size_type _Off, size_type _Count) const
 
size_type find_last_of (const _Elem *_Ptr, size_type _Off=npos) const
 
size_type find_last_of (_Elem _Ch, size_type _Off=npos) const
 
size_type find_first_not_of (const _Myt &_Right, size_type _Off=0) const _NOEXCEPT
 
size_type find_first_not_of (const _Elem *_Ptr, size_type _Off, size_type _Count) const
 
size_type find_first_not_of (const _Elem *_Ptr, size_type _Off=0) const
 
size_type find_first_not_of (_Elem _Ch, size_type _Off=0) const
 
size_type find_last_not_of (const _Myt &_Right, size_type _Off=npos) const _NOEXCEPT
 
size_type find_last_not_of (const _Elem *_Ptr, size_type _Off, size_type _Count) const
 
size_type find_last_not_of (const _Elem *_Ptr, size_type _Off=npos) const
 
size_type find_last_not_of (_Elem _Ch, size_type _Off=npos) const
 
_Myt substr (size_type _Off=0, size_type _Count=npos) const
 
size_type _Clamp_suffix_size (const size_type _Off, const size_type _Size) const
 
int compare (const _Myt &_Right) const _NOEXCEPT
 
int compare (size_type _Off, size_type _N0, const _Myt &_Right) const
 
int compare (size_type _Off, size_type _N0, const _Myt &_Right, size_type _Roff, size_type _Count=npos) const
 
int compare (const _Elem *_Ptr) const
 
int compare (size_type _Off, size_type _N0, const _Elem *_Ptr) const
 
int compare (size_type _Off, size_type _N0, const _Elem *_Ptr, size_type _Count) const
 
allocator_type get_allocator () const _NOEXCEPT
 
void _Chassign (size_type _Off, size_type _Count, _Elem _Ch)
 
void _Copy (size_type _Newsize, size_type _Oldlen)
 
void _Eos (size_type _Newsize)
 
bool _Grow (size_type _Newsize, bool _Trim=false)
 
bool _Inside (const _Elem *_Ptr)
 
void _Tidy (bool _Built=false, size_type _Newsize=0)
 
void _Xlen () const
 
void _Check_offset (const size_type _Off) const
 
void _Check_offset_exclusive (const size_type _Off) const
 
void _Xran () const
 
- Public Member Functions inherited from _String_alloc< _String_base_types< _Elem, _Alloc > >
value_type_Myptr ()
 
const value_type_Myptr () const
 
 _String_alloc ()
 
 _String_alloc (_Any_alloc &&_Al)
 
void _Copy_alloc (const _Alty &_Al)
 
void _Move_alloc (_Alty &_Al)
 
void _Orphan_all ()
 
void _Swap_all (_Myt &_Right)
 
_Alty_Getal () _NOEXCEPT
 
const _Alty_Getal () const _NOEXCEPT
 
_String_val< _Val_types > & _Get_data () _NOEXCEPT
 
const _String_val< _Val_types > & _Get_data () const _NOEXCEPT
 
_Bxty_Bx () _NOEXCEPT
 
const _Bxty_Bx () const _NOEXCEPT
 
size_type_Mysize () _NOEXCEPT
 
const size_type_Mysize () const _NOEXCEPT
 
size_type_Myres () _NOEXCEPT
 
const size_type_Myres () const _NOEXCEPT
 

Static Public Member Functions

static int _Traits_compare (const _Elem *const _Left, const size_type _Left_size, const _Elem *const _Right, const size_type _Right_size)
 

Static Public Attributes

static _PGLOBAL const size_type npos
 

Member Typedef Documentation

template<class _Elem, class _Traits, class _Alloc>
typedef _Mybase::_Alty basic_string< _Elem, _Traits, _Alloc >::_Alty
template<class _Elem, class _Traits, class _Alloc>
typedef _String_alloc<_String_base_types<_Elem, _Alloc> > basic_string< _Elem, _Traits, _Alloc >::_Mybase
template<class _Elem, class _Traits, class _Alloc>
typedef basic_string<_Elem, _Traits, _Alloc> basic_string< _Elem, _Traits, _Alloc >::_Myt
template<class _Elem, class _Traits, class _Alloc>
typedef _Alloc basic_string< _Elem, _Traits, _Alloc >::allocator_type
template<class _Elem, class _Traits, class _Alloc>
typedef _Mybase::const_iterator basic_string< _Elem, _Traits, _Alloc >::const_iterator
template<class _Elem, class _Traits, class _Alloc>
typedef _Mybase::const_pointer basic_string< _Elem, _Traits, _Alloc >::const_pointer
template<class _Elem, class _Traits, class _Alloc>
typedef _Mybase::const_reference basic_string< _Elem, _Traits, _Alloc >::const_reference
template<class _Elem, class _Traits, class _Alloc>
typedef _STD reverse_iterator<const_iterator> basic_string< _Elem, _Traits, _Alloc >::const_reverse_iterator
template<class _Elem, class _Traits, class _Alloc>
typedef _Mybase::difference_type basic_string< _Elem, _Traits, _Alloc >::difference_type
template<class _Elem, class _Traits, class _Alloc>
typedef _Mybase::iterator basic_string< _Elem, _Traits, _Alloc >::iterator
template<class _Elem, class _Traits, class _Alloc>
typedef _Mybase::pointer basic_string< _Elem, _Traits, _Alloc >::pointer
template<class _Elem, class _Traits, class _Alloc>
typedef _Mybase::reference basic_string< _Elem, _Traits, _Alloc >::reference
template<class _Elem, class _Traits, class _Alloc>
typedef _STD reverse_iterator<iterator> basic_string< _Elem, _Traits, _Alloc >::reverse_iterator
template<class _Elem, class _Traits, class _Alloc>
typedef _Mybase::size_type basic_string< _Elem, _Traits, _Alloc >::size_type
template<class _Elem, class _Traits, class _Alloc>
typedef _Traits basic_string< _Elem, _Traits, _Alloc >::traits_type
template<class _Elem, class _Traits, class _Alloc>
typedef _Mybase::value_type basic_string< _Elem, _Traits, _Alloc >::value_type

Constructor & Destructor Documentation

template<class _Elem, class _Traits, class _Alloc>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( const _Myt _Right)
inline
777  : _Mybase(_Right._Getal().select_on_container_copy_construction())
778 
779 
780  { // construct by copying _Right
781  _Tidy();
782  assign(_Right, 0, npos);
783  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2246
static _PGLOBAL const size_type npos
Definition: xstring:1020
_String_alloc< _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:755
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:945
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Elem, class _Traits, class _Alloc>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( const _Myt _Right,
const _Alloc _Al 
)
inline
786  : _Mybase(_Al)
787  { // construct by copying with allocator
788  _Tidy();
789  assign(_Right, 0, npos);
790  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2246
static _PGLOBAL const size_type npos
Definition: xstring:1020
_String_alloc< _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:755
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:945
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Elem, class _Traits, class _Alloc>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( )
inline
793  : _Mybase()
794  { // construct empty string
795  _Tidy();
796  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2246
_String_alloc< _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:755
template<class _Elem, class _Traits, class _Alloc>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( const _Alloc _Al)
inlineexplicit
799  : _Mybase(_Al)
800  { // construct empty string with allocator
801  _Tidy();
802  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2246
_String_alloc< _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:755
template<class _Elem, class _Traits, class _Alloc>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( const _Myt _Right,
size_type  _Roff,
size_type  _Count = npos 
)
inline
806  : _Mybase(_Right._Getal())
807  { // construct from _Right [_Roff, _Roff + _Count)
808  _Tidy();
809  assign(_Right, _Roff, _Count);
810  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2246
unsigned int _Count
Definition: xcomplex:668
_String_alloc< _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:755
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:945
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Elem, class _Traits, class _Alloc>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( const _Myt _Right,
size_type  _Roff,
size_type  _Count,
const _Alloc _Al 
)
inline
814  : _Mybase(_Al)
815  { // construct from _Right [_Roff, _Roff + _Count) with allocator
816  _Tidy();
817  assign(_Right, _Roff, _Count);
818  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2246
unsigned int _Count
Definition: xcomplex:668
_String_alloc< _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:755
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:945
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Elem, class _Traits, class _Alloc>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( const _Elem *  _Ptr,
size_type  _Count 
)
inline
821  : _Mybase()
822  { // construct from [_Ptr, _Ptr + _Count)
823  _Tidy();
824  assign(_Ptr, _Count);
825  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2246
unsigned int _Count
Definition: xcomplex:668
_String_alloc< _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:755
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:945
template<class _Elem, class _Traits, class _Alloc>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( const _Elem *  _Ptr,
size_type  _Count,
const _Alloc _Al 
)
inline
828  : _Mybase(_Al)
829  { // construct from [_Ptr, _Ptr + _Count) with allocator
830  _Tidy();
831  assign(_Ptr, _Count);
832  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2246
unsigned int _Count
Definition: xcomplex:668
_String_alloc< _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:755
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:945
template<class _Elem, class _Traits, class _Alloc>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( const _Elem *  _Ptr)
inline
835  : _Mybase()
836  { // construct from [_Ptr, <null>)
837  _Tidy();
838  assign(_Ptr);
839  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2246
_String_alloc< _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:755
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:945
template<class _Elem, class _Traits, class _Alloc>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( const _Elem *  _Ptr,
const _Alloc _Al 
)
inline
842  : _Mybase(_Al)
843  { // construct from [_Ptr, <null>) with allocator
844  _Tidy();
845  assign(_Ptr);
846  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2246
_String_alloc< _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:755
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:945
template<class _Elem, class _Traits, class _Alloc>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( size_type  _Count,
_Elem  _Ch 
)
inline
849  : _Mybase()
850  { // construct from _Count * _Ch
851  _Tidy();
852  assign(_Count, _Ch);
853  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2246
unsigned int _Count
Definition: xcomplex:668
_String_alloc< _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:755
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:945
template<class _Elem, class _Traits, class _Alloc>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( size_type  _Count,
_Elem  _Ch,
const _Alloc _Al 
)
inline
856  : _Mybase(_Al)
857  { // construct from _Count * _Ch with allocator
858  _Tidy();
859  assign(_Count, _Ch);
860  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2246
unsigned int _Count
Definition: xcomplex:668
_String_alloc< _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:755
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:945
template<class _Elem, class _Traits, class _Alloc>
template<class _Iter , class = typename enable_if<_Is_iterator<_Iter>::value, void>::type>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( _Iter  _First,
_Iter  _Last,
const _Alloc _Al = _Alloc() 
)
inline
866  : _Mybase(_Al)
867  { // construct from [_First, _Last) with optional allocator
868  _DEBUG_RANGE(_First, _Last);
869  _Tidy();
871  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2246
#define _DEBUG_RANGE(first, last)
Definition: xutility:822
typename iterator_traits< _Iter >::iterator_category _Iter_cat_t
Definition: xutility:655
_String_alloc< _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:755
void _Construct(_Iter _First, _Iter _Last, input_iterator_tag)
Definition: xstring:874
_String_const_iterator< _Mystr >::_Unchecked_type _Unchecked(_String_const_iterator< _Mystr > _Iter)
Definition: xstring:278
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits, class _Alloc>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( _Myt &&  _Right)
inline
910  : _Mybase(_STD move(_Right._Getal()))
911  { // construct by moving _Right
912  _Tidy();
913  _Assign_rv(_STD forward<_Myt>(_Right));
914  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2246
_String_alloc< _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:755
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1290
void _Assign_rv(_Myt &&_Right)
Definition: xstring:960
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Elem, class _Traits, class _Alloc>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( _Myt &&  _Right,
const _Alloc _Al 
)
inline
917  : _Mybase(_Al)
918  { // construct by moving _Right, allocator
919  if (this->_Getal() != _Right._Getal())
920  assign(_Right.begin(), _Right.end());
921  else
922  _Assign_rv(_STD forward<_Myt>(_Right));
923  }
_Alty & _Getal() _NOEXCEPT
Definition: xstring:690
_String_alloc< _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:755
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:945
void _Assign_rv(_Myt &&_Right)
Definition: xstring:960
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Elem, class _Traits, class _Alloc>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( _XSTD initializer_list< _Elem >  _Ilist,
const _Alloc _Al = allocator_type() 
)
inline
977  : _Mybase(_Al)
978  { // construct from initializer_list
979  _Tidy();
980  assign(_Ilist.begin(), _Ilist.end());
981  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2246
_String_alloc< _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:755
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:945
template<class _Elem, class _Traits, class _Alloc>
basic_string< _Elem, _Traits, _Alloc >::~basic_string ( )
inline
1016  { // destroy the string
1017  _Tidy(true);
1018  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2246

Member Function Documentation

template<class _Elem, class _Traits, class _Alloc>
void basic_string< _Elem, _Traits, _Alloc >::_Assign_rv ( _Myt &&  _Right)
inline
961  { // assign by moving _Right
962  if (_Right._Myres() < this->_BUF_SIZE)
963  _Traits::move(this->_Bx()._Buf, _Right._Bx()._Buf,
964  _Right._Mysize() + 1);
965  else
966  { // copy pointer
967  this->_Getal().construct(_STD addressof(this->_Bx()._Ptr), _Right._Bx()._Ptr);
968  _Right._Bx()._Ptr = pointer();
969  }
970  this->_Mysize() = _Right._Mysize();
971  this->_Myres() = _Right._Myres();
972  _Right._Tidy();
973  }
_Alty & _Getal() _NOEXCEPT
Definition: xstring:690
constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:723
size_type & _Mysize() _NOEXCEPT
Definition: xstring:722
_Bxty & _Bx() _NOEXCEPT
Definition: xstring:712
_Mybase::pointer pointer
Definition: xstring:764
size_type & _Myres() _NOEXCEPT
Definition: xstring:732
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1290
constexpr const _Ty &() _Right
Definition: algorithm:3591
value_type _Buf[_BUF_SIZE]
Definition: xstring:536
template<class _Elem, class _Traits, class _Alloc>
void basic_string< _Elem, _Traits, _Alloc >::_Chassign ( size_type  _Off,
size_type  _Count,
_Elem  _Ch 
)
inline
2174  { // assign _Count copies of _Ch beginning at _Off
2175  if (_Count == 1)
2176  _Traits::assign(*(this->_Myptr() + _Off), _Ch);
2177  else
2178  _Traits::assign(this->_Myptr() + _Off, _Count, _Ch);
2179  }
unsigned int _Count
Definition: xcomplex:668
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
value_type * _Myptr()
Definition: xstring:576
template<class _Elem, class _Traits, class _Alloc>
void basic_string< _Elem, _Traits, _Alloc >::_Check_offset ( const size_type  _Off) const
inline
2270  { // checks whether _Off is in the bounds of [0, this->size()]
2271  if (this->_Mysize() < _Off)
2272  _Xran();
2273  }
void _Xran() const
Definition: xstring:2281
size_type & _Mysize() _NOEXCEPT
Definition: xstring:722
template<class _Elem, class _Traits, class _Alloc>
void basic_string< _Elem, _Traits, _Alloc >::_Check_offset_exclusive ( const size_type  _Off) const
inline
2276  { // checks whether _Off is in the bounds of [0, this->size())
2277  if (this->_Mysize() <= _Off)
2278  _Xran();
2279  }
void _Xran() const
Definition: xstring:2281
size_type & _Mysize() _NOEXCEPT
Definition: xstring:722
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::_Clamp_suffix_size ( const size_type  _Off,
const size_type  _Size 
) const
inline
2111  { // trims _Size to the longest it can be assuming a string starting at _Off
2112  const size_type _Max_effective_size = this->_Mysize() - _Off;
2113  if (_Size <= _Max_effective_size)
2114  return (_Size);
2115  else
2116  return (_Max_effective_size);
2117  }
size_type & _Mysize() _NOEXCEPT
Definition: xstring:722
_Mybase::size_type size_type
Definition: xstring:762
_Size
Definition: vcruntime_string.h:36
template<class _Elem, class _Traits, class _Alloc>
template<class _Iter >
void basic_string< _Elem, _Traits, _Alloc >::_Construct ( _Iter  _First,
_Iter  _Last,
input_iterator_tag   
)
inline
876  { // initialize from [_First, _Last), input iterators
877  _TRY_BEGIN
878  for (; _First != _Last; ++_First)
879  append((size_type)1, (_Elem)*_First);
880  _CATCH_ALL
881  _Tidy(true);
882  _RERAISE;
883  _CATCH_END
884  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2246
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
#define _CATCH_ALL
Definition: xstddef:62
_Mybase::size_type size_type
Definition: xstring:762
_Myt & append(_XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:998
#define _RERAISE
Definition: xstddef:74
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits, class _Alloc>
template<class _Iter >
void basic_string< _Elem, _Traits, _Alloc >::_Construct ( _Iter  _First,
_Iter  _Last,
forward_iterator_tag   
)
inline
889  { // initialize from [_First, _Last), forward iterators
890  size_type _Count = _STD distance(_First, _Last);
891  reserve(_Count);
892  _Construct(_First, _Last, input_iterator_tag());
893  }
unsigned int _Count
Definition: xcomplex:668
_Iter_diff_t< _InIt > distance(_InIt _First, _InIt _Last)
Definition: xutility:1124
Definition: xutility:506
void _Construct(_Iter _First, _Iter _Last, input_iterator_tag)
Definition: xstring:874
void reserve(size_type _Newcap=0)
Definition: xstring:1792
_Mybase::size_type size_type
Definition: xstring:762
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits, class _Alloc>
void basic_string< _Elem, _Traits, _Alloc >::_Construct ( _Elem *  _First,
_Elem *  _Last,
random_access_iterator_tag   
)
inline
897  { // initialize from [_First, _Last), pointers
898  if (_First != _Last)
899  assign(_First, _Last - _First);
900  }
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:945
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits, class _Alloc>
void basic_string< _Elem, _Traits, _Alloc >::_Construct ( const _Elem *  _First,
const _Elem *  _Last,
random_access_iterator_tag   
)
inline
904  { // initialize from [_First, _Last), const pointers
905  if (_First != _Last)
906  assign(_First, _Last - _First);
907  }
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:945
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits, class _Alloc>
void basic_string< _Elem, _Traits, _Alloc >::_Copy ( size_type  _Newsize,
size_type  _Oldlen 
)
inline
2182  { // copy _Oldlen elements to newly allocated buffer
2183  size_type _Newres = _Newsize | this->_ALLOC_MASK;
2184  if (max_size() < _Newres)
2185  _Newres = _Newsize; // undo roundup if too big
2186  else if (this->_Myres() / 2 <= _Newres / 3)
2187  ;
2188  else if (this->_Myres() <= max_size() - this->_Myres() / 2)
2189  _Newres = this->_Myres()
2190  + this->_Myres() / 2; // grow exponentially if possible
2191  else
2192  _Newres = max_size(); // settle for max_size()
2193 
2194  pointer _Ptr;
2195  _TRY_BEGIN
2196  _Ptr = this->_Getal().allocate(_Newres + 1);
2197  _CATCH_ALL
2198  _Newres = _Newsize; // allocation failed, undo roundup and retry
2199  _TRY_BEGIN
2200  _Ptr = this->_Getal().allocate(_Newres + 1);
2201  _CATCH_ALL
2202  _Tidy(true); // failed again, discard storage and reraise
2203  _RERAISE;
2204  _CATCH_END
2205  _CATCH_END
2206 
2207  if (0 < _Oldlen)
2208  _Traits::copy(_Unfancy(_Ptr), this->_Myptr(),
2209  _Oldlen); // copy existing elements
2210  _Tidy(true);
2211  this->_Getal().construct(_STD addressof(this->_Bx()._Ptr), _Ptr);
2212  this->_Myres() = _Newres;
2213  _Eos(_Oldlen);
2214  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2246
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2369
void _Eos(size_type _Newsize)
Definition: xstring:2216
_Alty & _Getal() _NOEXCEPT
Definition: xstring:690
constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:723
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
_Bxty & _Bx() _NOEXCEPT
Definition: xstring:712
_Mybase::pointer pointer
Definition: xstring:764
value_type * _Myptr()
Definition: xstring:576
#define _CATCH_ALL
Definition: xstddef:62
size_type max_size() const _NOEXCEPT
Definition: xstring:1768
size_type & _Myres() _NOEXCEPT
Definition: xstring:732
_Mybase::size_type size_type
Definition: xstring:762
auto _Unfancy(_Ptrty _Ptr)
Definition: xstddef:732
#define _RERAISE
Definition: xstddef:74
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::_Copy_s ( _Elem *  _Dest,
size_type  _Dest_size,
size_type  _Count,
size_type  _Off = 0 
) const
inline
1820  { // copy [_Off, _Off + _Count) to [_Dest, _Dest + _Count)
1821  _DEBUG_POINTER_IF(_Count != 0, _Dest);
1822  _Check_offset(_Off);
1823  _Count = _Clamp_suffix_size(_Off, _Count);
1824  _Traits::_Copy_s(_Dest, _Dest_size, this->_Myptr() + _Off, _Count);
1825  return (_Count);
1826  }
unsigned int _Count
Definition: xcomplex:668
#define _DEBUG_POINTER_IF(test, first)
Definition: xutility:820
void _Check_offset(const size_type _Off) const
Definition: xstring:2269
size_type _Clamp_suffix_size(const size_type _Off, const size_type _Size) const
Definition: xstring:2110
value_type * _Myptr()
Definition: xstring:576
template<class _Elem, class _Traits, class _Alloc>
void basic_string< _Elem, _Traits, _Alloc >::_Eos ( size_type  _Newsize)
inline
2217  { // set new length and null terminator
2218  auto& _Dx = this->_Get_data();
2219  _Traits::assign(_Dx._Myptr()[_Dx._Mysize = _Newsize], _Elem());
2220  }
_String_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: xstring:700
template<class _Elem, class _Traits, class _Alloc>
bool basic_string< _Elem, _Traits, _Alloc >::_Grow ( size_type  _Newsize,
bool  _Trim = false 
)
inline
2224  { // ensure buffer is big enough, trim to size if _Trim is true
2225  if (max_size() < _Newsize)
2226  _Xlen(); // result too long
2227  if (this->_Myres() < _Newsize)
2228  _Copy(_Newsize, this->_Mysize()); // reallocate to grow
2229  else if (_Trim && _Newsize < this->_BUF_SIZE)
2230  _Tidy(true, // copy and deallocate if trimming to small string
2231  _Newsize < this->_Mysize() ? _Newsize : this->_Mysize());
2232  else if (_Newsize == 0)
2233  _Eos(0); // new size is zero, just null terminate
2234  return (0 < _Newsize); // return true only if more work to do
2235  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2246
void _Eos(size_type _Newsize)
Definition: xstring:2216
size_type & _Mysize() _NOEXCEPT
Definition: xstring:722
void _Copy(size_type _Newsize, size_type _Oldlen)
Definition: xstring:2181
void _Xlen() const
Definition: xstring:2264
size_type max_size() const _NOEXCEPT
Definition: xstring:1768
size_type & _Myres() _NOEXCEPT
Definition: xstring:732
template<class _Elem, class _Traits, class _Alloc>
bool basic_string< _Elem, _Traits, _Alloc >::_Inside ( const _Elem *  _Ptr)
inline
2238  { // test if _Ptr points inside string
2239  if (_Ptr == nullptr_t{} || _Ptr < this->_Myptr()
2240  || this->_Myptr() + this->_Mysize() <= _Ptr)
2241  return (false); // don't ask
2242  else
2243  return (true);
2244  }
size_type & _Mysize() _NOEXCEPT
Definition: xstring:722
value_type * _Myptr()
Definition: xstring:576
template<class _Elem, class _Traits, class _Alloc>
void basic_string< _Elem, _Traits, _Alloc >::_Swap_bx ( _Myt _Right)
inline
1829  { // exchange _Bx() with _Right._Bx()
1830  if (this->_BUF_SIZE <= this->_Myres())
1831  if (this->_BUF_SIZE <= _Right._Myres())
1832  _Swap_adl(this->_Bx()._Ptr, _Right._Bx()._Ptr);
1833  else
1834  { // swap large with small
1835  pointer _Ptr = this->_Bx()._Ptr;
1836  this->_Getal().destroy(_STD addressof(this->_Bx()._Ptr));
1837  _Traits::copy(this->_Bx()._Buf,
1838  _Right._Bx()._Buf, _Right._Mysize() + 1);
1839  this->_Getal().construct(_STD addressof(_Right._Bx()._Ptr), _Ptr);
1840  }
1841  else
1842  if (_Right._Myres() < this->_BUF_SIZE)
1843  _STD swap(this->_Bx()._Buf, _Right._Bx()._Buf);
1844  else
1845  { // swap small with large
1846  pointer _Ptr = _Right._Bx()._Ptr;
1847  this->_Getal().destroy(_STD addressof(_Right._Bx()._Ptr));
1848  _Traits::copy(_Right._Bx()._Buf,
1849  this->_Bx()._Buf, this->_Mysize() + 1);
1850  this->_Getal().construct(_STD addressof(this->_Bx()._Ptr), _Ptr);
1851  }
1852  }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2369
_Alty & _Getal() _NOEXCEPT
Definition: xstring:690
constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:723
Definition: regex:1539
size_type & _Mysize() _NOEXCEPT
Definition: xstring:722
pointer _Ptr
Definition: xstring:537
_Bxty & _Bx() _NOEXCEPT
Definition: xstring:712
void swap(_Myt &_Right) _NOEXCEPT_OP(_Alty
Definition: xstring:1854
_Mybase::pointer pointer
Definition: xstring:764
size_type & _Myres() _NOEXCEPT
Definition: xstring:732
void _Swap_adl(_Ty &_Left, _Ty &_Right) _NOEXCEPT_OP(_Is_nothrow_swappable< _Ty >
Definition: utility:56
constexpr const _Ty &() _Right
Definition: algorithm:3591
value_type _Buf[_BUF_SIZE]
Definition: xstring:536
template<class _Elem, class _Traits, class _Alloc>
void basic_string< _Elem, _Traits, _Alloc >::_Tidy ( bool  _Built = false,
size_type  _Newsize = 0 
)
inline
2248  { // initialize buffer, deallocating any storage
2249  if (!_Built)
2250  ;
2251  else if (this->_BUF_SIZE <= this->_Myres())
2252  { // copy any leftovers to small buffer and deallocate
2253  pointer _Ptr = this->_Bx()._Ptr;
2254  this->_Getal().destroy(_STD addressof(this->_Bx()._Ptr));
2255  if (0 < _Newsize)
2256  _Traits::copy(this->_Bx()._Buf,
2257  _Unfancy(_Ptr), _Newsize);
2258  this->_Getal().deallocate(_Ptr, this->_Myres() + 1);
2259  }
2260  this->_Myres() = this->_BUF_SIZE - 1;
2261  _Eos(_Newsize);
2262  }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2369
void _Eos(size_type _Newsize)
Definition: xstring:2216
_Alty & _Getal() _NOEXCEPT
Definition: xstring:690
constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:723
Definition: regex:1539
pointer _Ptr
Definition: xstring:537
_Bxty & _Bx() _NOEXCEPT
Definition: xstring:712
_Mybase::pointer pointer
Definition: xstring:764
size_type & _Myres() _NOEXCEPT
Definition: xstring:732
auto _Unfancy(_Ptrty _Ptr)
Definition: xstddef:732
template<class _Elem, class _Traits, class _Alloc>
static int basic_string< _Elem, _Traits, _Alloc >::_Traits_compare ( const _Elem *const  _Left,
const size_type  _Left_size,
const _Elem *const  _Right,
const size_type  _Right_size 
)
inlinestatic
2094  { // compare [_Left, _Left + _Left_size) to [_Right, _Right + _Right_size) using _Traits
2095  const size_type _Min_size = _Left_size < _Right_size ? _Left_size : _Right_size;
2096  const int _Ans = _Traits::compare(_Left, _Right, _Min_size);
2097 
2098  if (_Ans != 0)
2099  return (_Ans);
2100 
2101  if (_Left_size < _Right_size)
2102  return (-1);
2103 
2104  if (_Left_size > _Right_size)
2105  return (1);
2106 
2107  return (0);
2108  }
constexpr const _Ty &() _Left
Definition: algorithm:3590
_Mybase::size_type size_type
Definition: xstring:762
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Elem, class _Traits, class _Alloc>
void basic_string< _Elem, _Traits, _Alloc >::_Xlen ( ) const
inline
2265  { // report a length_error
2266  _Xlength_error("string too long");
2267  }
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xlength_error(_In_z_ const char *)
template<class _Elem, class _Traits, class _Alloc>
void basic_string< _Elem, _Traits, _Alloc >::_Xran ( ) const
inline
2282  { // report an out_of_range error
2283  _Xout_of_range("invalid string position");
2284  }
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xout_of_range(_In_z_ const char *)
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::append ( _XSTD initializer_list< _Elem >  _Ilist)
inline
999  { // append initializer_list
1000  return (append(_Ilist.begin(), _Ilist.end()));
1001  }
_Myt & append(_XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:998
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::append ( const _Myt _Right)
inline
1064  { // append _Right
1065  return (append(_Right, 0, npos));
1066  }
static _PGLOBAL const size_type npos
Definition: xstring:1020
_Myt & append(_XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:998
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::append ( const _Myt _Right,
size_type  _Roff,
size_type  _Count = npos 
)
inline
1070  { // append _Right [_Roff, _Roff + _Count)
1071  _Right._Check_offset(_Roff);
1072  _Count = _Right._Clamp_suffix_size(_Roff, _Count);
1073  if (npos - this->_Mysize() <= _Count)
1074  _Xlen(); // result too long
1075 
1076  const size_type _Num = this->_Mysize() + _Count;
1077  if (0 < _Count && _Grow(_Num))
1078  { // make room and append new stuff
1079  _Traits::copy(this->_Myptr() + this->_Mysize(),
1080  _Right._Myptr() + _Roff, _Count);
1081  _Eos(_Num);
1082  }
1083  return (*this);
1084  }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2369
void _Eos(size_type _Newsize)
Definition: xstring:2216
static _PGLOBAL const size_type npos
Definition: xstring:1020
unsigned int _Count
Definition: xcomplex:668
size_type & _Mysize() _NOEXCEPT
Definition: xstring:722
void _Xlen() const
Definition: xstring:2264
value_type * _Myptr()
Definition: xstring:576
_Mybase::size_type size_type
Definition: xstring:762
bool _Grow(size_type _Newsize, bool _Trim=false)
Definition: xstring:2222
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::append ( const _Elem *  _Ptr,
size_type  _Count 
)
inline
1087  { // append [_Ptr, _Ptr + _Count)
1088  _DEBUG_POINTER_IF(_Count != 0, _Ptr);
1089  if (_Inside(_Ptr))
1090  return (append(*this,
1091  _Ptr - this->_Myptr(), _Count)); // substring
1092  if (npos - this->_Mysize() <= _Count)
1093  _Xlen(); // result too long
1094 
1095  const size_type _Num = this->_Mysize() + _Count;
1096  if (0 < _Count && _Grow(_Num))
1097  { // make room and append new stuff
1098  _Traits::copy(this->_Myptr() + this->_Mysize(), _Ptr, _Count);
1099  _Eos(_Num);
1100  }
1101  return (*this);
1102  }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2369
void _Eos(size_type _Newsize)
Definition: xstring:2216
static _PGLOBAL const size_type npos
Definition: xstring:1020
unsigned int _Count
Definition: xcomplex:668
#define _DEBUG_POINTER_IF(test, first)
Definition: xutility:820
size_type & _Mysize() _NOEXCEPT
Definition: xstring:722
void _Xlen() const
Definition: xstring:2264
value_type * _Myptr()
Definition: xstring:576
bool _Inside(const _Elem *_Ptr)
Definition: xstring:2237
_Mybase::size_type size_type
Definition: xstring:762
bool _Grow(size_type _Newsize, bool _Trim=false)
Definition: xstring:2222
_Myt & append(_XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:998
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::append ( const _Elem *  _Ptr)
inline
1105  { // append [_Ptr, <null>)
1106  _DEBUG_POINTER(_Ptr);
1107  return (append(_Ptr, _Traits::length(_Ptr)));
1108  }
#define _DEBUG_POINTER(first)
Definition: xutility:819
_Myt & append(_XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:998
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::append ( size_type  _Count,
_Elem  _Ch 
)
inline
1111  { // append _Count * _Ch
1112  if (npos - this->_Mysize() <= _Count)
1113  _Xlen(); // result too long
1114 
1115  const size_type _Num = this->_Mysize() + _Count;
1116  if (0 < _Count && _Grow(_Num))
1117  { // make room and append new stuff using assign
1118  _Chassign(this->_Mysize(), _Count, _Ch);
1119  _Eos(_Num);
1120  }
1121  return (*this);
1122  }
void _Eos(size_type _Newsize)
Definition: xstring:2216
static _PGLOBAL const size_type npos
Definition: xstring:1020
unsigned int _Count
Definition: xcomplex:668
size_type & _Mysize() _NOEXCEPT
Definition: xstring:722
void _Chassign(size_type _Off, size_type _Count, _Elem _Ch)
Definition: xstring:2173
void _Xlen() const
Definition: xstring:2264
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
_Mybase::size_type size_type
Definition: xstring:762
bool _Grow(size_type _Newsize, bool _Trim=false)
Definition: xstring:2222
template<class _Elem, class _Traits, class _Alloc>
template<class _Iter >
enable_if<_Is_iterator<_Iter>::value, _Myt&>::type basic_string< _Elem, _Traits, _Alloc >::append ( _Iter  _First,
_Iter  _Last 
)
inline
1128  { // append [_First, _Last), input iterators
1129  return (replace(end(), end(), _First, _Last));
1130  }
iterator end() _NOEXCEPT
Definition: xstring:1605
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:1009
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::append ( const_pointer  _First,
const_pointer  _Last 
)
inline
1133  { // append [_First, _Last), const pointers
1134  return (replace(end(), end(), _First, _Last));
1135  }
iterator end() _NOEXCEPT
Definition: xstring:1605
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:1009
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::append ( const_iterator  _First,
const_iterator  _Last 
)
inline
1138  { // append [_First, _Last), const_iterators
1139  return (replace(end(), end(), _First, _Last));
1140  }
iterator end() _NOEXCEPT
Definition: xstring:1605
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:1009
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::assign ( _Myt &&  _Right)
inline
946  { // assign by moving _Right
947  if (this == &_Right)
948  ;
949  else if (get_allocator() != _Right.get_allocator()
950  && this->_BUF_SIZE <= _Right._Myres())
951  *this = _Right;
952  else
953  { // not same, clear this and steal from _Right
954  _Tidy(true);
955  _Assign_rv(_STD forward<_Myt>(_Right));
956  }
957  return (*this);
958  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2246
allocator_type get_allocator() const _NOEXCEPT
Definition: xstring:2167
void _Assign_rv(_Myt &&_Right)
Definition: xstring:960
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::assign ( _XSTD initializer_list< _Elem >  _Ilist)
inline
994  { // assign initializer_list
995  return (assign(_Ilist.begin(), _Ilist.end()));
996  }
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:945
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::assign ( const _Myt _Right)
inline
1143  { // assign _Right
1144  return (assign(_Right, 0, npos));
1145  }
static _PGLOBAL const size_type npos
Definition: xstring:1020
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:945
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::assign ( const _Myt _Right,
size_type  _Roff,
size_type  _Count = npos 
)
inline
1149  { // assign _Right [_Roff, _Roff + _Count)
1150  _Right._Check_offset(_Roff);
1151  _Count = _Right._Clamp_suffix_size(_Roff, _Count);
1152 
1153  if (this == &_Right)
1154  erase((size_type)(_Roff + _Count)), erase(0, _Roff); // substring
1155  else if (_Grow(_Count))
1156  { // make room and assign new stuff
1157  _Traits::copy(this->_Myptr(),
1158  _Right._Myptr() + _Roff, _Count);
1159  _Eos(_Count);
1160  }
1161  return (*this);
1162  }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2369
void _Eos(size_type _Newsize)
Definition: xstring:2216
unsigned int _Count
Definition: xcomplex:668
value_type * _Myptr()
Definition: xstring:576
_Myt & erase(size_type _Off=0)
Definition: xstring:1339
_Mybase::size_type size_type
Definition: xstring:762
bool _Grow(size_type _Newsize, bool _Trim=false)
Definition: xstring:2222
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::assign ( const _Elem *  _Ptr,
size_type  _Count 
)
inline
1165  { // assign [_Ptr, _Ptr + _Count)
1166  _DEBUG_POINTER_IF(_Count != 0, _Ptr);
1167  if (_Inside(_Ptr))
1168  return (assign(*this,
1169  _Ptr - this->_Myptr(), _Count)); // substring
1170 
1171  if (_Grow(_Count))
1172  { // make room and assign new stuff
1173  _Traits::copy(this->_Myptr(), _Ptr, _Count);
1174  _Eos(_Count);
1175  }
1176  return (*this);
1177  }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2369
void _Eos(size_type _Newsize)
Definition: xstring:2216
unsigned int _Count
Definition: xcomplex:668
#define _DEBUG_POINTER_IF(test, first)
Definition: xutility:820
value_type * _Myptr()
Definition: xstring:576
bool _Inside(const _Elem *_Ptr)
Definition: xstring:2237
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:945
bool _Grow(size_type _Newsize, bool _Trim=false)
Definition: xstring:2222
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::assign ( const _Elem *  _Ptr)
inline
1180  { // assign [_Ptr, <null>)
1181  _DEBUG_POINTER(_Ptr);
1182  return (assign(_Ptr, _Traits::length(_Ptr)));
1183  }
#define _DEBUG_POINTER(first)
Definition: xutility:819
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:945
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::assign ( size_type  _Count,
_Elem  _Ch 
)
inline
1186  { // assign _Count * _Ch
1187  if (_Count == npos)
1188  _Xlen(); // result too long
1189 
1190  if (_Grow(_Count))
1191  { // make room and assign new stuff
1192  _Chassign(0, _Count, _Ch);
1193  _Eos(_Count);
1194  }
1195  return (*this);
1196  }
void _Eos(size_type _Newsize)
Definition: xstring:2216
static _PGLOBAL const size_type npos
Definition: xstring:1020
unsigned int _Count
Definition: xcomplex:668
void _Chassign(size_type _Off, size_type _Count, _Elem _Ch)
Definition: xstring:2173
void _Xlen() const
Definition: xstring:2264
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
bool _Grow(size_type _Newsize, bool _Trim=false)
Definition: xstring:2222
template<class _Elem, class _Traits, class _Alloc>
template<class _Iter >
enable_if<_Is_iterator<_Iter>::value, _Myt&>::type basic_string< _Elem, _Traits, _Alloc >::assign ( _Iter  _First,
_Iter  _Last 
)
inline
1202  { // assign [_First, _Last), input iterators
1203  return (replace(begin(), end(), _First, _Last));
1204  }
iterator end() _NOEXCEPT
Definition: xstring:1605
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:1009
iterator begin() _NOEXCEPT
Definition: xstring:1593
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::assign ( const_pointer  _First,
const_pointer  _Last 
)
inline
1207  { // assign [_First, _Last), const pointers
1208  return (replace(begin(), end(), _First, _Last));
1209  }
iterator end() _NOEXCEPT
Definition: xstring:1605
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:1009
iterator begin() _NOEXCEPT
Definition: xstring:1593
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::assign ( const_iterator  _First,
const_iterator  _Last 
)
inline
1212  { // assign [_First, _Last), const_iterators
1213  return (replace(begin(), end(), _First, _Last));
1214  }
iterator end() _NOEXCEPT
Definition: xstring:1605
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:1009
iterator begin() _NOEXCEPT
Definition: xstring:1593
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits, class _Alloc>
reference basic_string< _Elem, _Traits, _Alloc >::at ( size_type  _Off)
inline
1667  { // subscript mutable sequence with checking
1669  return (this->_Myptr()[_Off]);
1670  }
value_type * _Myptr()
Definition: xstring:576
void _Check_offset_exclusive(const size_type _Off) const
Definition: xstring:2275
template<class _Elem, class _Traits, class _Alloc>
const_reference basic_string< _Elem, _Traits, _Alloc >::at ( size_type  _Off) const
inline
1673  { // subscript nonmutable sequence with checking
1675  return (this->_Myptr()[_Off]);
1676  }
value_type * _Myptr()
Definition: xstring:576
void _Check_offset_exclusive(const size_type _Off) const
Definition: xstring:2275
template<class _Elem, class _Traits, class _Alloc>
reference basic_string< _Elem, _Traits, _Alloc >::back ( )
inline
1732  { // return last element of mutable sequence
1733  return (*(end() - 1));
1734  }
iterator end() _NOEXCEPT
Definition: xstring:1605
template<class _Elem, class _Traits, class _Alloc>
const_reference basic_string< _Elem, _Traits, _Alloc >::back ( ) const
inline
1737  { // return last element of nonmutable sequence
1738  return (*(end() - 1));
1739  }
iterator end() _NOEXCEPT
Definition: xstring:1605
template<class _Elem, class _Traits, class _Alloc>
iterator basic_string< _Elem, _Traits, _Alloc >::begin ( )
inline
1594  { // return iterator for beginning of mutable sequence
1595  auto _Mydata = &this->_Get_data();
1596  return (iterator(this->_Getal().address(*_Mydata->_Myptr()), _Mydata));
1597  }
_Mybase::iterator iterator
Definition: xstring:769
_Alty & _Getal() _NOEXCEPT
Definition: xstring:690
_String_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: xstring:700
template<class _Elem, class _Traits, class _Alloc>
const_iterator basic_string< _Elem, _Traits, _Alloc >::begin ( ) const
inline
1600  { // return iterator for beginning of nonmutable sequence
1601  auto _Mydata = &this->_Get_data();
1602  return (const_iterator(this->_Getal().address(*_Mydata->_Myptr()), _Mydata));
1603  }
_Mybase::const_iterator const_iterator
Definition: xstring:770
_Alty & _Getal() _NOEXCEPT
Definition: xstring:690
_String_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: xstring:700
template<class _Elem, class _Traits, class _Alloc>
const _Elem* basic_string< _Elem, _Traits, _Alloc >::c_str ( ) const
inline
1742  { // return pointer to null-terminated nonmutable array
1743  return (this->_Myptr());
1744  }
value_type * _Myptr()
Definition: xstring:576
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::capacity ( ) const
inline
1788  { // return current length of allocated storage
1789  return (this->_Myres());
1790  }
size_type & _Myres() _NOEXCEPT
Definition: xstring:732
template<class _Elem, class _Traits, class _Alloc>
const_iterator basic_string< _Elem, _Traits, _Alloc >::cbegin ( ) const
inline
1638  { // return iterator for beginning of nonmutable sequence
1639  return (begin());
1640  }
iterator begin() _NOEXCEPT
Definition: xstring:1593
template<class _Elem, class _Traits, class _Alloc>
const_iterator basic_string< _Elem, _Traits, _Alloc >::cend ( ) const
inline
1643  { // return iterator for end of nonmutable sequence
1644  return (end());
1645  }
iterator end() _NOEXCEPT
Definition: xstring:1605
template<class _Elem, class _Traits, class _Alloc>
void basic_string< _Elem, _Traits, _Alloc >::clear ( )
inline
1377  { // erase all
1378  _Eos(0);
1379  }
void _Eos(size_type _Newsize)
Definition: xstring:2216
template<class _Elem, class _Traits, class _Alloc>
int basic_string< _Elem, _Traits, _Alloc >::compare ( const _Myt _Right) const
inline
2120  { // compare [0, _Mysize()) with _Right
2121  return (_Traits_compare(this->_Myptr(), this->_Mysize(),
2122  _Right._Myptr(), _Right._Mysize()));
2123  }
size_type & _Mysize() _NOEXCEPT
Definition: xstring:722
static int _Traits_compare(const _Elem *const _Left, const size_type _Left_size, const _Elem *const _Right, const size_type _Right_size)
Definition: xstring:2092
value_type * _Myptr()
Definition: xstring:576
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Elem, class _Traits, class _Alloc>
int basic_string< _Elem, _Traits, _Alloc >::compare ( size_type  _Off,
size_type  _N0,
const _Myt _Right 
) const
inline
2127  { // compare [_Off, _Off + _N0) with _Right
2128  _Check_offset(_Off);
2129  return (_Traits_compare(this->_Myptr() + _Off, _Clamp_suffix_size(_Off, _N0),
2130  _Right._Myptr(), _Right._Mysize()));
2131  }
void _Check_offset(const size_type _Off) const
Definition: xstring:2269
static int _Traits_compare(const _Elem *const _Left, const size_type _Left_size, const _Elem *const _Right, const size_type _Right_size)
Definition: xstring:2092
size_type _Clamp_suffix_size(const size_type _Off, const size_type _Size) const
Definition: xstring:2110
value_type * _Myptr()
Definition: xstring:576
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Elem, class _Traits, class _Alloc>
int basic_string< _Elem, _Traits, _Alloc >::compare ( size_type  _Off,
size_type  _N0,
const _Myt _Right,
size_type  _Roff,
size_type  _Count = npos 
) const
inline
2136  { // compare [_Off, _Off + _N0) with _Right [_Roff, _Roff + _Count)
2137  _Check_offset(_Off);
2138  _Right._Check_offset(_Roff);
2139  return (_Traits_compare(this->_Myptr() + _Off, _Clamp_suffix_size(_Off, _N0),
2140  _Right._Myptr() + _Roff, _Right._Clamp_suffix_size(_Roff, _Count)));
2141  }
unsigned int _Count
Definition: xcomplex:668
void _Check_offset(const size_type _Off) const
Definition: xstring:2269
static int _Traits_compare(const _Elem *const _Left, const size_type _Left_size, const _Elem *const _Right, const size_type _Right_size)
Definition: xstring:2092
size_type _Clamp_suffix_size(const size_type _Off, const size_type _Size) const
Definition: xstring:2110
value_type * _Myptr()
Definition: xstring:576
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Elem, class _Traits, class _Alloc>
int basic_string< _Elem, _Traits, _Alloc >::compare ( const _Elem *  _Ptr) const
inline
2144  { // compare [0, _Mysize()) with [_Ptr, <null>)
2145  _DEBUG_POINTER(_Ptr);
2146  return (_Traits_compare(this->_Myptr(), this->_Mysize(),
2147  _Ptr, _Traits::length(_Ptr)));
2148  }
size_type & _Mysize() _NOEXCEPT
Definition: xstring:722
static int _Traits_compare(const _Elem *const _Left, const size_type _Left_size, const _Elem *const _Right, const size_type _Right_size)
Definition: xstring:2092
value_type * _Myptr()
Definition: xstring:576
#define _DEBUG_POINTER(first)
Definition: xutility:819
template<class _Elem, class _Traits, class _Alloc>
int basic_string< _Elem, _Traits, _Alloc >::compare ( size_type  _Off,
size_type  _N0,
const _Elem *  _Ptr 
) const
inline
2151  { // compare [_Off, _Off + _N0) with [_Ptr, <null>)
2152  _DEBUG_POINTER(_Ptr);
2153  _Check_offset(_Off);
2154  return (_Traits_compare(this->_Myptr() + _Off, _Clamp_suffix_size(_Off, _N0),
2155  _Ptr, _Traits::length(_Ptr)));
2156  }
void _Check_offset(const size_type _Off) const
Definition: xstring:2269
static int _Traits_compare(const _Elem *const _Left, const size_type _Left_size, const _Elem *const _Right, const size_type _Right_size)
Definition: xstring:2092
size_type _Clamp_suffix_size(const size_type _Off, const size_type _Size) const
Definition: xstring:2110
value_type * _Myptr()
Definition: xstring:576
#define _DEBUG_POINTER(first)
Definition: xutility:819
template<class _Elem, class _Traits, class _Alloc>
int basic_string< _Elem, _Traits, _Alloc >::compare ( size_type  _Off,
size_type  _N0,
const _Elem *  _Ptr,
size_type  _Count 
) const
inline
2160  { // compare [_Off, _Off + _N0) with [_Ptr, _Ptr + _Count)
2161  _DEBUG_POINTER_IF(_Count != 0, _Ptr);
2162  _Check_offset(_Off);
2163  return (_Traits_compare(this->_Myptr() + _Off, _Clamp_suffix_size(_Off, _N0),
2164  _Ptr, _Count));
2165  }
unsigned int _Count
Definition: xcomplex:668
#define _DEBUG_POINTER_IF(test, first)
Definition: xutility:820
void _Check_offset(const size_type _Off) const
Definition: xstring:2269
static int _Traits_compare(const _Elem *const _Left, const size_type _Left_size, const _Elem *const _Right, const size_type _Right_size)
Definition: xstring:2092
size_type _Clamp_suffix_size(const size_type _Off, const size_type _Size) const
Definition: xstring:2110
value_type * _Myptr()
Definition: xstring:576
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::copy ( _Elem *  _Ptr,
size_type  _Count,
size_type  _Off = 0 
) const
inline
1810  { // copy [_Off, _Off + _Count) to [_Ptr, _Ptr + _Count)
1811  _DEBUG_POINTER_IF(_Count != 0, _Ptr);
1812  _Check_offset(_Off);
1813  _Count = _Clamp_suffix_size(_Off, _Count);
1814  _Traits::copy(_Ptr, this->_Myptr() + _Off, _Count);
1815  return (_Count);
1816  }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2369
unsigned int _Count
Definition: xcomplex:668
#define _DEBUG_POINTER_IF(test, first)
Definition: xutility:820
void _Check_offset(const size_type _Off) const
Definition: xstring:2269
size_type _Clamp_suffix_size(const size_type _Off, const size_type _Size) const
Definition: xstring:2110
value_type * _Myptr()
Definition: xstring:576
template<class _Elem, class _Traits, class _Alloc>
const_reverse_iterator basic_string< _Elem, _Traits, _Alloc >::crbegin ( ) const
inline
1648  { // return iterator for beginning of reversed nonmutable sequence
1649  return (rbegin());
1650  }
reverse_iterator rbegin() _NOEXCEPT
Definition: xstring:1617
template<class _Elem, class _Traits, class _Alloc>
const_reverse_iterator basic_string< _Elem, _Traits, _Alloc >::crend ( ) const
inline
1653  { // return iterator for end of reversed nonmutable sequence
1654  return (rend());
1655  }
reverse_iterator rend() _NOEXCEPT
Definition: xstring:1627
template<class _Elem, class _Traits, class _Alloc>
const _Elem* basic_string< _Elem, _Traits, _Alloc >::data ( ) const
inline
1747  { // return pointer to nonmutable array
1748  return (this->_Myptr());
1749  }
value_type * _Myptr()
Definition: xstring:576
template<class _Elem, class _Traits, class _Alloc>
bool basic_string< _Elem, _Traits, _Alloc >::empty ( ) const
inline
1803  { // test if sequence is empty
1804  return (this->_Mysize() == 0);
1805  }
size_type & _Mysize() _NOEXCEPT
Definition: xstring:722
template<class _Elem, class _Traits, class _Alloc>
iterator basic_string< _Elem, _Traits, _Alloc >::end ( )
inline
1606  { // return iterator for end of mutable sequence
1607  auto _Mydata = &this->_Get_data();
1608  return (iterator(this->_Getal().address(*_Mydata->_Myptr()) + _Mydata->_Mysize, _Mydata));
1609  }
_Mybase::iterator iterator
Definition: xstring:769
_Alty & _Getal() _NOEXCEPT
Definition: xstring:690
_String_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: xstring:700
template<class _Elem, class _Traits, class _Alloc>
const_iterator basic_string< _Elem, _Traits, _Alloc >::end ( ) const
inline
1612  { // return iterator for end of nonmutable sequence
1613  auto _Mydata = &this->_Get_data();
1614  return (const_iterator(this->_Getal().address(*_Mydata->_Myptr()) + _Mydata->_Mysize, _Mydata));
1615  }
_Mybase::const_iterator const_iterator
Definition: xstring:770
_Alty & _Getal() _NOEXCEPT
Definition: xstring:690
_String_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: xstring:700
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::erase ( size_type  _Off = 0)
inline
1340  { // erase elements [_Off, ...)
1341  _Check_offset(_Off);
1342  _Eos(_Off);
1343  return (*this);
1344  }
void _Eos(size_type _Newsize)
Definition: xstring:2216
void _Check_offset(const size_type _Off) const
Definition: xstring:2269
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::erase ( size_type  _Off,
size_type  _Count 
)
inline
1347  { // erase elements [_Off, _Off + _Count)
1348  _Check_offset(_Off);
1349  if (this->_Mysize() - _Off <= _Count)
1350  _Eos(_Off); // erase elements [_Off, ...)
1351  else if (0 < _Count)
1352  { // move elements down
1353  value_type *_Ptr = this->_Myptr() + _Off;
1354  size_type _Newsize = this->_Mysize() - _Count;
1355  _Traits::move(_Ptr, _Ptr + _Count, _Newsize - _Off);
1356  _Eos(_Newsize);
1357  }
1358  return (*this);
1359  }
void _Eos(size_type _Newsize)
Definition: xstring:2216
_Mybase::value_type value_type
Definition: xstring:761
unsigned int _Count
Definition: xcomplex:668
size_type & _Mysize() _NOEXCEPT
Definition: xstring:722
void _Check_offset(const size_type _Off) const
Definition: xstring:2269
value_type * _Myptr()
Definition: xstring:576
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1290
_Mybase::size_type size_type
Definition: xstring:762
template<class _Elem, class _Traits, class _Alloc>
iterator basic_string< _Elem, _Traits, _Alloc >::erase ( const_iterator  _Where)
inline
1362  { // erase element at _Where
1363  size_type _Count = _Where - begin();
1364  erase(_Count, 1);
1365  return (begin() + _Count);
1366  }
unsigned int _Count
Definition: xcomplex:668
_Myt & erase(size_type _Off=0)
Definition: xstring:1339
iterator begin() _NOEXCEPT
Definition: xstring:1593
_Mybase::size_type size_type
Definition: xstring:762
template<class _Elem, class _Traits, class _Alloc>
iterator basic_string< _Elem, _Traits, _Alloc >::erase ( const_iterator  _First,
const_iterator  _Last 
)
inline
1369  { // erase substring [_First, _Last)
1370  _DEBUG_RANGE(_First, _Last);
1371  size_type _Count = _First - begin();
1372  erase(_Count, _Last - _First);
1373  return (begin() + _Count);
1374  }
unsigned int _Count
Definition: xcomplex:668
#define _DEBUG_RANGE(first, last)
Definition: xutility:822
_Myt & erase(size_type _Off=0)
Definition: xstring:1339
iterator begin() _NOEXCEPT
Definition: xstring:1593
_Mybase::size_type size_type
Definition: xstring:762
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::find ( const _Myt _Right,
size_type  _Off = 0 
) const
inline
1869  { // look for _Right beginning at or after _Off
1870  return (find(_Right._Myptr(), _Off, _Right.size()));
1871  }
size_type find(const _Myt &_Right, size_type _Off=0) const _NOEXCEPT
Definition: xstring:1868
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::find ( const _Elem *  _Ptr,
size_type  _Off,
size_type  _Count 
) const
inline
1875  { // look for [_Ptr, _Ptr + _Count) beginning at or after _Off
1876  _DEBUG_POINTER_IF(_Count != 0, _Ptr);
1877  if (_Count == 0 && _Off <= this->_Mysize())
1878  return (_Off); // null string always matches (if inside string)
1879 
1880  size_type _Nm;
1881  if (_Off < this->_Mysize() && _Count <= (_Nm = this->_Mysize() - _Off))
1882  { // room for match, look for it
1883  const _Elem *_Uptr, *_Vptr;
1884  for (_Nm -= _Count - 1, _Vptr = this->_Myptr() + _Off;
1885  (_Uptr = _Traits::find(_Vptr, _Nm, *_Ptr)) != 0;
1886  _Nm -= _Uptr - _Vptr + 1, _Vptr = _Uptr + 1)
1887  if (_Traits::compare(_Uptr, _Ptr, _Count) == 0)
1888  return (_Uptr - this->_Myptr()); // found a match
1889  }
1890 
1891  return (npos); // no match
1892  }
static _PGLOBAL const size_type npos
Definition: xstring:1020
unsigned int _Count
Definition: xcomplex:668
#define _DEBUG_POINTER_IF(test, first)
Definition: xutility:820
size_type & _Mysize() _NOEXCEPT
Definition: xstring:722
value_type * _Myptr()
Definition: xstring:576
_Mybase::size_type size_type
Definition: xstring:762
_InIt find(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3282
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::find ( const _Elem *  _Ptr,
size_type  _Off = 0 
) const
inline
1895  { // look for [_Ptr, <null>) beginning at or after _Off
1896  _DEBUG_POINTER(_Ptr);
1897  return (find(_Ptr, _Off, _Traits::length(_Ptr)));
1898  }
size_type find(const _Myt &_Right, size_type _Off=0) const _NOEXCEPT
Definition: xstring:1868
#define _DEBUG_POINTER(first)
Definition: xutility:819
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::find ( _Elem  _Ch,
size_type  _Off = 0 
) const
inline
1901  { // look for _Ch at or after _Off
1902  return (find((const _Elem *)&_Ch, _Off, 1));
1903  }
size_type find(const _Myt &_Right, size_type _Off=0) const _NOEXCEPT
Definition: xstring:1868
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::find_first_not_of ( const _Myt _Right,
size_type  _Off = 0 
) const
inline
2018  { // look for none of _Right at or after _Off
2019  return (find_first_not_of(_Right._Myptr(), _Off,
2020  _Right.size()));
2021  }
size_type find_first_not_of(const _Myt &_Right, size_type _Off=0) const _NOEXCEPT
Definition: xstring:2016
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::find_first_not_of ( const _Elem *  _Ptr,
size_type  _Off,
size_type  _Count 
) const
inline
2025  { // look for none of [_Ptr, _Ptr + _Count) at or after _Off
2026  _DEBUG_POINTER_IF(_Count != 0, _Ptr);
2027  if (_Off < this->_Mysize())
2028  { // room for match, look for it
2029  const _Elem *const _Vptr = this->_Myptr() + this->_Mysize();
2030  for (const _Elem *_Uptr = this->_Myptr() + _Off;
2031  _Uptr < _Vptr; ++_Uptr)
2032  if (_Traits::find(_Ptr, _Count, *_Uptr) == 0)
2033  return (_Uptr - this->_Myptr());
2034  }
2035  return (npos);
2036  }
static _PGLOBAL const size_type npos
Definition: xstring:1020
unsigned int _Count
Definition: xcomplex:668
#define _DEBUG_POINTER_IF(test, first)
Definition: xutility:820
size_type & _Mysize() _NOEXCEPT
Definition: xstring:722
value_type * _Myptr()
Definition: xstring:576
_InIt find(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3282
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::find_first_not_of ( const _Elem *  _Ptr,
size_type  _Off = 0 
) const
inline
2040  { // look for one of [_Ptr, <null>) at or after _Off
2041  _DEBUG_POINTER(_Ptr);
2042  return (find_first_not_of(_Ptr, _Off, _Traits::length(_Ptr)));
2043  }
size_type find_first_not_of(const _Myt &_Right, size_type _Off=0) const _NOEXCEPT
Definition: xstring:2016
#define _DEBUG_POINTER(first)
Definition: xutility:819
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::find_first_not_of ( _Elem  _Ch,
size_type  _Off = 0 
) const
inline
2047  { // look for non _Ch at or after _Off
2048  return (find_first_not_of((const _Elem *)&_Ch, _Off, 1));
2049  }
size_type find_first_not_of(const _Myt &_Right, size_type _Off=0) const _NOEXCEPT
Definition: xstring:2016
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::find_first_of ( const _Myt _Right,
size_type  _Off = 0 
) const
inline
1946  { // look for one of _Right at or after _Off
1947  return (find_first_of(_Right._Myptr(), _Off, _Right.size()));
1948  }
size_type find_first_of(const _Myt &_Right, size_type _Off=0) const _NOEXCEPT
Definition: xstring:1944
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::find_first_of ( const _Elem *  _Ptr,
size_type  _Off,
size_type  _Count 
) const
inline
1952  { // look for one of [_Ptr, _Ptr + _Count) at or after _Off
1953  _DEBUG_POINTER_IF(_Count != 0, _Ptr);
1954  if (0 < _Count && _Off < this->_Mysize())
1955  { // room for match, look for it
1956  const _Elem *const _Vptr = this->_Myptr() + this->_Mysize();
1957  for (const _Elem *_Uptr = this->_Myptr() + _Off;
1958  _Uptr < _Vptr; ++_Uptr)
1959  if (_Traits::find(_Ptr, _Count, *_Uptr) != 0)
1960  return (_Uptr - this->_Myptr()); // found a match
1961  }
1962 
1963  return (npos); // no match
1964  }
static _PGLOBAL const size_type npos
Definition: xstring:1020
unsigned int _Count
Definition: xcomplex:668
#define _DEBUG_POINTER_IF(test, first)
Definition: xutility:820
size_type & _Mysize() _NOEXCEPT
Definition: xstring:722
value_type * _Myptr()
Definition: xstring:576
_InIt find(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3282
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::find_first_of ( const _Elem *  _Ptr,
size_type  _Off = 0 
) const
inline
1968  { // look for one of [_Ptr, <null>) at or after _Off
1969  _DEBUG_POINTER(_Ptr);
1970  return (find_first_of(_Ptr, _Off, _Traits::length(_Ptr)));
1971  }
size_type find_first_of(const _Myt &_Right, size_type _Off=0) const _NOEXCEPT
Definition: xstring:1944
#define _DEBUG_POINTER(first)
Definition: xutility:819
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::find_first_of ( _Elem  _Ch,
size_type  _Off = 0 
) const
inline
1975  { // look for _Ch at or after _Off
1976  return (find((const _Elem *)&_Ch, _Off, 1));
1977  }
size_type find(const _Myt &_Right, size_type _Off=0) const _NOEXCEPT
Definition: xstring:1868
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::find_last_not_of ( const _Myt _Right,
size_type  _Off = npos 
) const
inline
2053  { // look for none of _Right before _Off
2054  return (find_last_not_of(_Right._Myptr(), _Off, _Right.size()));
2055  }
size_type find_last_not_of(const _Myt &_Right, size_type _Off=npos) const _NOEXCEPT
Definition: xstring:2051
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::find_last_not_of ( const _Elem *  _Ptr,
size_type  _Off,
size_type  _Count 
) const
inline
2059  { // look for none of [_Ptr, _Ptr + _Count) before _Off
2060  _DEBUG_POINTER_IF(_Count != 0, _Ptr);
2061  if (0 < this->_Mysize())
2062  { // worth searching, do it
2063  const _Elem *_Uptr = this->_Myptr()
2064  + (_Off < this->_Mysize() ? _Off : this->_Mysize() - 1);
2065  for (; ; --_Uptr)
2066  if (_Traits::find(_Ptr, _Count, *_Uptr) == 0)
2067  return (_Uptr - this->_Myptr());
2068  else if (_Uptr == this->_Myptr())
2069  break;
2070  }
2071  return (npos);
2072  }
static _PGLOBAL const size_type npos
Definition: xstring:1020
unsigned int _Count
Definition: xcomplex:668
#define _DEBUG_POINTER_IF(test, first)
Definition: xutility:820
size_type & _Mysize() _NOEXCEPT
Definition: xstring:722
value_type * _Myptr()
Definition: xstring:576
_InIt find(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3282
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::find_last_not_of ( const _Elem *  _Ptr,
size_type  _Off = npos 
) const
inline
2076  { // look for none of [_Ptr, <null>) before _Off
2077  _DEBUG_POINTER(_Ptr);
2078  return (find_last_not_of(_Ptr, _Off, _Traits::length(_Ptr)));
2079  }
size_type find_last_not_of(const _Myt &_Right, size_type _Off=npos) const _NOEXCEPT
Definition: xstring:2051
#define _DEBUG_POINTER(first)
Definition: xutility:819
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::find_last_not_of ( _Elem  _Ch,
size_type  _Off = npos 
) const
inline
2083  { // look for non _Ch before _Off
2084  return (find_last_not_of((const _Elem *)&_Ch, _Off, 1));
2085  }
size_type find_last_not_of(const _Myt &_Right, size_type _Off=npos) const _NOEXCEPT
Definition: xstring:2051
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::find_last_of ( const _Myt _Right,
size_type  _Off = npos 
) const
inline
1981  { // look for one of _Right before _Off
1982  return (find_last_of(_Right._Myptr(), _Off, _Right.size()));
1983  }
size_type find_last_of(const _Myt &_Right, size_type _Off=npos) const _NOEXCEPT
Definition: xstring:1979
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::find_last_of ( const _Elem *  _Ptr,
size_type  _Off,
size_type  _Count 
) const
inline
1987  { // look for one of [_Ptr, _Ptr + _Count) before _Off
1988  _DEBUG_POINTER_IF(_Count != 0, _Ptr);
1989  if (0 < _Count && 0 < this->_Mysize())
1990  { // worth searching, do it
1991  const _Elem *_Uptr = this->_Myptr()
1992  + (_Off < this->_Mysize() ? _Off : this->_Mysize() - 1);
1993  for (; ; --_Uptr)
1994  if (_Traits::find(_Ptr, _Count, *_Uptr) != 0)
1995  return (_Uptr - this->_Myptr()); // found a match
1996  else if (_Uptr == this->_Myptr())
1997  break; // at beginning, no more chance for match
1998  }
1999 
2000  return (npos); // no match
2001  }
static _PGLOBAL const size_type npos
Definition: xstring:1020
unsigned int _Count
Definition: xcomplex:668
#define _DEBUG_POINTER_IF(test, first)
Definition: xutility:820
size_type & _Mysize() _NOEXCEPT
Definition: xstring:722
value_type * _Myptr()
Definition: xstring:576
_InIt find(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3282
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::find_last_of ( const _Elem *  _Ptr,
size_type  _Off = npos 
) const
inline
2005  { // look for one of [_Ptr, <null>) before _Off
2006  _DEBUG_POINTER(_Ptr);
2007  return (find_last_of(_Ptr, _Off, _Traits::length(_Ptr)));
2008  }
size_type find_last_of(const _Myt &_Right, size_type _Off=npos) const _NOEXCEPT
Definition: xstring:1979
#define _DEBUG_POINTER(first)
Definition: xutility:819
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::find_last_of ( _Elem  _Ch,
size_type  _Off = npos 
) const
inline
2012  { // look for _Ch before _Off
2013  return (rfind((const _Elem *)&_Ch, _Off, 1));
2014  }
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
size_type rfind(const _Myt &_Right, size_type _Off=npos) const _NOEXCEPT
Definition: xstring:1905
template<class _Elem, class _Traits, class _Alloc>
reference basic_string< _Elem, _Traits, _Alloc >::front ( )
inline
1722  { // return first element of mutable sequence
1723  return (*begin());
1724  }
iterator begin() _NOEXCEPT
Definition: xstring:1593
template<class _Elem, class _Traits, class _Alloc>
const_reference basic_string< _Elem, _Traits, _Alloc >::front ( ) const
inline
1727  { // return first element of nonmutable sequence
1728  return (*begin());
1729  }
iterator begin() _NOEXCEPT
Definition: xstring:1593
template<class _Elem, class _Traits, class _Alloc>
allocator_type basic_string< _Elem, _Traits, _Alloc >::get_allocator ( ) const
inline
2168  { // return allocator object for values
2169  allocator_type _Ret(this->_Getal());
2170  return (_Ret);
2171  }
_Alty & _Getal() _NOEXCEPT
Definition: xstring:690
_Alloc allocator_type
Definition: xstring:757
template<class _Elem, class _Traits, class _Alloc>
iterator basic_string< _Elem, _Traits, _Alloc >::insert ( const_iterator  _Where,
_XSTD initializer_list< _Elem >  _Ilist 
)
inline
1005  { // insert initializer_list
1006  return (insert(_Where, _Ilist.begin(), _Ilist.end()));
1007  }
iterator insert(const_iterator _Where, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:1003
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::insert ( size_type  _Off,
const _Myt _Right 
)
inline
1217  { // insert _Right at _Off
1218  return (insert(_Off, _Right, 0, npos));
1219  }
static _PGLOBAL const size_type npos
Definition: xstring:1020
iterator insert(const_iterator _Where, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:1003
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::insert ( size_type  _Off,
const _Myt _Right,
size_type  _Roff,
size_type  _Count = npos 
)
inline
1223  { // insert _Right [_Roff, _Roff + _Count) at _Off
1224  _Check_offset(_Off);
1225  _Right._Check_offset(_Roff);
1226  _Count = _Right._Clamp_suffix_size(_Roff, _Count);
1227  if (npos - this->_Mysize() <= _Count)
1228  _Xlen(); // result too long
1229 
1230  const size_type _Num = this->_Mysize() + _Count;
1231  if (0 < _Count && _Grow(_Num))
1232  { // make room and insert new stuff
1233  _Traits::move(this->_Myptr() + _Off + _Count,
1234  this->_Myptr() + _Off,
1235  this->_Mysize() - _Off); // empty out hole
1236  if (this == &_Right)
1237  _Traits::move(this->_Myptr() + _Off,
1238  this->_Myptr() + (_Off < _Roff ? _Roff + _Count : _Roff),
1239  _Count); // substring
1240  else
1241  _Traits::copy(this->_Myptr() + _Off,
1242  _Right._Myptr() + _Roff, _Count); // fill hole
1243  _Eos(_Num);
1244  }
1245  return (*this);
1246  }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2369
void _Eos(size_type _Newsize)
Definition: xstring:2216
static _PGLOBAL const size_type npos
Definition: xstring:1020
unsigned int _Count
Definition: xcomplex:668
size_type & _Mysize() _NOEXCEPT
Definition: xstring:722
void _Check_offset(const size_type _Off) const
Definition: xstring:2269
void _Xlen() const
Definition: xstring:2264
value_type * _Myptr()
Definition: xstring:576
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1290
_Mybase::size_type size_type
Definition: xstring:762
bool _Grow(size_type _Newsize, bool _Trim=false)
Definition: xstring:2222
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::insert ( size_type  _Off,
const _Elem *  _Ptr,
size_type  _Count 
)
inline
1250  { // insert [_Ptr, _Ptr + _Count) at _Off
1251  _DEBUG_POINTER_IF(_Count != 0, _Ptr);
1252  if (_Inside(_Ptr))
1253  return (insert(_Off, *this,
1254  _Ptr - this->_Myptr(), _Count)); // substring
1255  _Check_offset(_Off);
1256  if (npos - this->_Mysize() <= _Count)
1257  _Xlen(); // result too long
1258  const size_type _Num = this->_Mysize() + _Count;
1259  if (0 < _Count && _Grow(_Num))
1260  { // make room and insert new stuff
1261  _Traits::move(this->_Myptr() + _Off + _Count,
1262  this->_Myptr() + _Off,
1263  this->_Mysize() - _Off); // empty out hole
1264  _Traits::copy(this->_Myptr() + _Off, _Ptr, _Count); // fill hole
1265  _Eos(_Num);
1266  }
1267  return (*this);
1268  }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2369
void _Eos(size_type _Newsize)
Definition: xstring:2216
static _PGLOBAL const size_type npos
Definition: xstring:1020
unsigned int _Count
Definition: xcomplex:668
#define _DEBUG_POINTER_IF(test, first)
Definition: xutility:820
size_type & _Mysize() _NOEXCEPT
Definition: xstring:722
void _Check_offset(const size_type _Off) const
Definition: xstring:2269
void _Xlen() const
Definition: xstring:2264
iterator insert(const_iterator _Where, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:1003
value_type * _Myptr()
Definition: xstring:576
bool _Inside(const _Elem *_Ptr)
Definition: xstring:2237
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1290
_Mybase::size_type size_type
Definition: xstring:762
bool _Grow(size_type _Newsize, bool _Trim=false)
Definition: xstring:2222
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::insert ( size_type  _Off,
const _Elem *  _Ptr 
)
inline
1271  { // insert [_Ptr, <null>) at _Off
1272  _DEBUG_POINTER(_Ptr);
1273  return (insert(_Off, _Ptr, _Traits::length(_Ptr)));
1274  }
iterator insert(const_iterator _Where, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:1003
#define _DEBUG_POINTER(first)
Definition: xutility:819
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::insert ( size_type  _Off,
size_type  _Count,
_Elem  _Ch 
)
inline
1278  { // insert _Count * _Ch at _Off
1279  _Check_offset(_Off);
1280  if (npos - this->_Mysize() <= _Count)
1281  _Xlen(); // result too long
1282  const size_type _Num = this->_Mysize() + _Count;
1283  if (0 < _Count && _Grow(_Num))
1284  { // make room and insert new stuff
1285  _Traits::move(this->_Myptr() + _Off + _Count,
1286  this->_Myptr() + _Off,
1287  this->_Mysize() - _Off); // empty out hole
1288  _Chassign(_Off, _Count, _Ch); // fill hole
1289  _Eos(_Num);
1290  }
1291  return (*this);
1292  }
void _Eos(size_type _Newsize)
Definition: xstring:2216
static _PGLOBAL const size_type npos
Definition: xstring:1020
unsigned int _Count
Definition: xcomplex:668
size_type & _Mysize() _NOEXCEPT
Definition: xstring:722
void _Check_offset(const size_type _Off) const
Definition: xstring:2269
void _Chassign(size_type _Off, size_type _Count, _Elem _Ch)
Definition: xstring:2173
void _Xlen() const
Definition: xstring:2264
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
value_type * _Myptr()
Definition: xstring:576
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1290
_Mybase::size_type size_type
Definition: xstring:762
bool _Grow(size_type _Newsize, bool _Trim=false)
Definition: xstring:2222
template<class _Elem, class _Traits, class _Alloc>
iterator basic_string< _Elem, _Traits, _Alloc >::insert ( const_iterator  _Where)
inline
1295  { // insert <null> at _Where
1296  return (insert(_Where, _Elem()));
1297  }
iterator insert(const_iterator _Where, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:1003
template<class _Elem, class _Traits, class _Alloc>
iterator basic_string< _Elem, _Traits, _Alloc >::insert ( const_iterator  _Where,
_Elem  _Ch 
)
inline
1300  { // insert _Ch at _Where
1301  size_type _Off = _Where - begin();
1302  insert(_Off, 1, _Ch);
1303  return (begin() + _Off);
1304  }
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
iterator insert(const_iterator _Where, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:1003
iterator begin() _NOEXCEPT
Definition: xstring:1593
_Mybase::size_type size_type
Definition: xstring:762
template<class _Elem, class _Traits, class _Alloc>
iterator basic_string< _Elem, _Traits, _Alloc >::insert ( const_iterator  _Where,
size_type  _Count,
_Elem  _Ch 
)
inline
1307  { // insert _Count * _Elem at _Where
1308  size_type _Off = _Where - begin();
1309  insert(_Off, _Count, _Ch);
1310  return (begin() + _Off);
1311  }
unsigned int _Count
Definition: xcomplex:668
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
iterator insert(const_iterator _Where, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:1003
iterator begin() _NOEXCEPT
Definition: xstring:1593
_Mybase::size_type size_type
Definition: xstring:762
template<class _Elem, class _Traits, class _Alloc>
template<class _Iter >
enable_if<_Is_iterator<_Iter>::value, iterator>::type basic_string< _Elem, _Traits, _Alloc >::insert ( const_iterator  _Where,
_Iter  _First,
_Iter  _Last 
)
inline
1317  { // insert [_First, _Last) at _Where, input iterators
1318  size_type _Off = _Where - begin();
1319  replace(_Where, _Where, _First, _Last);
1320  return (begin() + _Off);
1321  }
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:1009
iterator begin() _NOEXCEPT
Definition: xstring:1593
_Mybase::size_type size_type
Definition: xstring:762
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits, class _Alloc>
iterator basic_string< _Elem, _Traits, _Alloc >::insert ( const_iterator  _Where,
const_pointer  _First,
const_pointer  _Last 
)
inline
1325  { // insert [_First, _Last) at _Where, const pointers
1326  size_type _Off = _Where - begin();
1327  replace(_Where, _Where, _First, _Last);
1328  return (begin() + _Off);
1329  }
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:1009
iterator begin() _NOEXCEPT
Definition: xstring:1593
_Mybase::size_type size_type
Definition: xstring:762
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits, class _Alloc>
iterator basic_string< _Elem, _Traits, _Alloc >::insert ( const_iterator  _Where,
const_iterator  _First,
const_iterator  _Last 
)
inline
1333  { // insert [_First, _Last) at _Where, const_iterators
1334  size_type _Off = _Where - begin();
1335  replace(_Where, _Where, _First, _Last);
1336  return (begin() + _Off);
1337  }
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:1009
iterator begin() _NOEXCEPT
Definition: xstring:1593
_Mybase::size_type size_type
Definition: xstring:762
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::length ( ) const
inline
1759  { // return length of sequence
1760  return (this->_Mysize());
1761  }
size_type & _Mysize() _NOEXCEPT
Definition: xstring:722
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::max_size ( ) const
inline
1769  { // return maximum possible length of sequence
1770  const size_type _Num = this->_Getal().max_size();
1771  return (_Num <= 1 ? 1 : _Num - 1);
1772  }
_Alty & _Getal() _NOEXCEPT
Definition: xstring:690
_Mybase::size_type size_type
Definition: xstring:762
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::operator+= ( _XSTD initializer_list< _Elem >  _Ilist)
inline
989  { // append initializer_list
990  return (append(_Ilist.begin(), _Ilist.end()));
991  }
_Myt & append(_XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:998
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::operator+= ( const _Myt _Right)
inline
1049  { // append _Right
1050  return (append(_Right));
1051  }
_Myt & append(_XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:998
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::operator+= ( const _Elem *  _Ptr)
inline
1054  { // append [_Ptr, <null>)
1055  return (append(_Ptr));
1056  }
_Myt & append(_XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:998
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::operator+= ( _Elem  _Ch)
inline
1059  { // append 1 * _Ch
1060  return (append((size_type)1, _Ch));
1061  }
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
_Mybase::size_type size_type
Definition: xstring:762
_Myt & append(_XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:998
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::operator= ( _Myt &&  _Right)
inline
928  { // assign by moving _Right
929  if (this != &_Right)
930  { // different, assign it
931  _Tidy(true);
932 
933  if (_Alty::propagate_on_container_move_assignment::value
934  && this->_Getal() != _Right._Getal())
935  this->_Move_alloc(_Right._Getal());
936 
937  if (this->_Getal() != _Right._Getal())
938  assign(_Right.begin(), _Right.end());
939  else
940  _Assign_rv(_STD forward<_Myt>(_Right));
941  }
942  return (*this);
943  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2246
_Alty & _Getal() _NOEXCEPT
Definition: xstring:690
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:945
void _Assign_rv(_Myt &&_Right)
Definition: xstring:960
void _Move_alloc(_Alty &_Al)
Definition: xstring:605
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::operator= ( _XSTD initializer_list< _Elem >  _Ilist)
inline
984  { // assign initializer_list
985  return (assign(_Ilist.begin(), _Ilist.end()));
986  }
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:945
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::operator= ( const _Myt _Right)
inline
1023  { // assign _Right
1024  if (this != &_Right)
1025  { // different, assign it
1026  if (this->_Getal() != _Right._Getal()
1027  && _Alty::propagate_on_container_copy_assignment::value)
1028  { // change allocator before copying
1029  _Tidy(true);
1030  this->_Copy_alloc(_Right._Getal());
1031  }
1032 
1033  assign(_Right);
1034  }
1035  return (*this);
1036  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2246
_Alty & _Getal() _NOEXCEPT
Definition: xstring:690
void _Copy_alloc(const _Alty &_Al)
Definition: xstring:600
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:945
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::operator= ( const _Elem *  _Ptr)
inline
1039  { // assign [_Ptr, <null>)
1040  return (assign(_Ptr));
1041  }
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:945
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::operator= ( _Elem  _Ch)
inline
1044  { // assign 1 * _Ch
1045  return (assign(1, _Ch));
1046  }
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:945
template<class _Elem, class _Traits, class _Alloc>
reference basic_string< _Elem, _Traits, _Alloc >::operator[] ( size_type  _Off)
inline
1679  { // subscript mutable sequence
1680  #if _ITERATOR_DEBUG_LEVEL == 2
1681  if (this->_Mysize() < _Off) // sic
1682  _DEBUG_ERROR("string subscript out of range");
1683 
1684  #elif _ITERATOR_DEBUG_LEVEL == 1
1685  _SCL_SECURE_VALIDATE_RANGE(_Off <= this->_Mysize()); // sic
1686  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1687 
1688  return (this->_Myptr()[_Off]);
1689  }
size_type & _Mysize() _NOEXCEPT
Definition: xstring:722
value_type * _Myptr()
Definition: xstring:576
#define _SCL_SECURE_VALIDATE_RANGE(cond)
Definition: yvals.h:392
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
template<class _Elem, class _Traits, class _Alloc>
const_reference basic_string< _Elem, _Traits, _Alloc >::operator[] ( size_type  _Off) const
inline
1692  { // subscript nonmutable sequence
1693  #if _ITERATOR_DEBUG_LEVEL == 2
1694  if (this->_Mysize() < _Off) // sic
1695  _DEBUG_ERROR("string subscript out of range");
1696 
1697  #elif _ITERATOR_DEBUG_LEVEL == 1
1698  _SCL_SECURE_VALIDATE_RANGE(_Off <= this->_Mysize()); // sic
1699  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1700 
1701  return (this->_Myptr()[_Off]);
1702  }
size_type & _Mysize() _NOEXCEPT
Definition: xstring:722
value_type * _Myptr()
Definition: xstring:576
#define _SCL_SECURE_VALIDATE_RANGE(cond)
Definition: yvals.h:392
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
template<class _Elem, class _Traits, class _Alloc>
void basic_string< _Elem, _Traits, _Alloc >::pop_back ( )
inline
1717  { // erase element at end
1718  erase(this->_Mysize() - 1); // throws if _Mysize() == 0
1719  }
size_type & _Mysize() _NOEXCEPT
Definition: xstring:722
_Myt & erase(size_type _Off=0)
Definition: xstring:1339
template<class _Elem, class _Traits, class _Alloc>
void basic_string< _Elem, _Traits, _Alloc >::push_back ( _Elem  _Ch)
inline
1705  { // insert element at end
1706  auto& _Dx = this->_Get_data();
1707  auto& _Sz = _Dx._Mysize;
1708  if (_Sz == _Dx._Myres)
1709  _Grow(_Sz + 1); // _Grow checks for overflow
1710  auto _Ptr = _Dx._Myptr();
1711  _Traits::assign(_Ptr[_Sz], _Ch);
1712  ++_Sz;
1713  _Traits::assign(_Ptr[_Sz], _Elem());
1714  }
_String_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: xstring:700
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
bool _Grow(size_type _Newsize, bool _Trim=false)
Definition: xstring:2222
template<class _Elem, class _Traits, class _Alloc>
reverse_iterator basic_string< _Elem, _Traits, _Alloc >::rbegin ( )
inline
1618  { // return iterator for beginning of reversed mutable sequence
1619  return (reverse_iterator(end()));
1620  }
_STD reverse_iterator< iterator > reverse_iterator
Definition: xstring:772
iterator end() _NOEXCEPT
Definition: xstring:1605
template<class _Elem, class _Traits, class _Alloc>
const_reverse_iterator basic_string< _Elem, _Traits, _Alloc >::rbegin ( ) const
inline
1623  { // return iterator for beginning of reversed nonmutable sequence
1624  return (const_reverse_iterator(end()));
1625  }
_STD reverse_iterator< const_iterator > const_reverse_iterator
Definition: xstring:773
iterator end() _NOEXCEPT
Definition: xstring:1605
template<class _Elem, class _Traits, class _Alloc>
reverse_iterator basic_string< _Elem, _Traits, _Alloc >::rend ( )
inline
1628  { // return iterator for end of reversed mutable sequence
1629  return (reverse_iterator(begin()));
1630  }
_STD reverse_iterator< iterator > reverse_iterator
Definition: xstring:772
iterator begin() _NOEXCEPT
Definition: xstring:1593
template<class _Elem, class _Traits, class _Alloc>
const_reverse_iterator basic_string< _Elem, _Traits, _Alloc >::rend ( ) const
inline
1633  { // return iterator for end of reversed nonmutable sequence
1634  return (const_reverse_iterator(begin()));
1635  }
_STD reverse_iterator< const_iterator > const_reverse_iterator
Definition: xstring:773
iterator begin() _NOEXCEPT
Definition: xstring:1593
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::replace ( const_iterator  _First,
const_iterator  _Last,
_XSTD initializer_list< _Elem >  _Ilist 
)
inline
1011  { // replace with initializer_list
1012  return (replace(_First, _Last, _Ilist.begin(), _Ilist.end()));
1013  }
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:1009
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::replace ( size_type  _Off,
size_type  _N0,
const _Myt _Right 
)
inline
1382  { // replace [_Off, _Off + _N0) with _Right
1383  return (replace(_Off, _N0, _Right, 0, npos));
1384  }
static _PGLOBAL const size_type npos
Definition: xstring:1020
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:1009
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::replace ( size_type  _Off,
size_type  _N0,
const _Myt _Right,
size_type  _Roff,
size_type  _Count = npos 
)
inline
1389  { // replace [_Off, _Off + _N0) with _Right [_Roff, _Roff + _Count)
1390  _Check_offset(_Off);
1391  _Right._Check_offset(_Roff);
1392  _N0 = _Clamp_suffix_size(_Off, _N0);
1393  _Count = _Right._Clamp_suffix_size(_Roff, _Count);
1394  if (npos - _Count <= this->_Mysize() - _N0)
1395  _Xlen(); // result too long
1396 
1397  const size_type _Nm = this->_Mysize() - _N0 - _Off; // length of kept tail
1398  const size_type _Newsize = this->_Mysize() + _Count - _N0;
1399  if (this->_Mysize() < _Newsize)
1400  _Grow(_Newsize);
1401 
1402  if (_Count == _N0)
1403  { // only one movement required, so _Traits::move handles any overlap
1404  _Traits::move(this->_Myptr() + _Off,
1405  _Right._Myptr() + _Roff, _Count); // fill hole
1406  }
1407  else if (this != &_Right)
1408  { // no overlap, just move down and copy in new stuff
1409  _Traits::move(this->_Myptr() + _Off + _Count,
1410  this->_Myptr() + _Off + _N0, _Nm); // empty hole
1411  _Traits::copy(this->_Myptr() + _Off,
1412  _Right._Myptr() + _Roff, _Count); // fill hole
1413  }
1414  else if (_Count < _N0)
1415  { // hole doesn't get larger, just copy in substring
1416  _Traits::move(this->_Myptr() + _Off,
1417  this->_Myptr() + _Roff, _Count); // fill hole
1418  _Traits::move(this->_Myptr() + _Off + _Count,
1419  this->_Myptr() + _Off + _N0, _Nm); // move tail down
1420  }
1421  else if (_Roff <= _Off)
1422  { // hole gets larger, substring begins before hole
1423  _Traits::move(this->_Myptr() + _Off + _Count,
1424  this->_Myptr() + _Off + _N0, _Nm); // move tail down
1425  _Traits::move(this->_Myptr() + _Off,
1426  this->_Myptr() + _Roff, _Count); // fill hole
1427  }
1428  else if (_Off + _N0 <= _Roff)
1429  { // hole gets larger, substring begins after hole
1430  _Traits::move(this->_Myptr() + _Off + _Count,
1431  this->_Myptr() + _Off + _N0, _Nm); // move tail down
1432  _Traits::move(this->_Myptr() + _Off,
1433  this->_Myptr() + (_Roff + _Count - _N0),
1434  _Count); // fill hole
1435  }
1436  else
1437  { // hole gets larger, substring begins in hole
1438  _Traits::move(this->_Myptr() + _Off,
1439  this->_Myptr() + _Roff, _N0); // fill old hole
1440  _Traits::move(this->_Myptr() + _Off + _Count,
1441  this->_Myptr() + _Off + _N0, _Nm); // move tail down
1442  _Traits::move(this->_Myptr() + _Off + _N0,
1443  this->_Myptr() + _Roff + _Count,
1444  _Count - _N0); // fill rest of new hole
1445  }
1446 
1447  _Eos(_Newsize);
1448  return (*this);
1449  }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2369
void _Eos(size_type _Newsize)
Definition: xstring:2216
static _PGLOBAL const size_type npos
Definition: xstring:1020
unsigned int _Count
Definition: xcomplex:668
size_type & _Mysize() _NOEXCEPT
Definition: xstring:722
void _Check_offset(const size_type _Off) const
Definition: xstring:2269
void _Xlen() const
Definition: xstring:2264
size_type _Clamp_suffix_size(const size_type _Off, const size_type _Size) const
Definition: xstring:2110
value_type * _Myptr()
Definition: xstring:576
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1290
_Mybase::size_type size_type
Definition: xstring:762
bool _Grow(size_type _Newsize, bool _Trim=false)
Definition: xstring:2222
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::replace ( size_type  _Off,
size_type  _N0,
const _Elem *  _Ptr,
size_type  _Count 
)
inline
1453  { // replace [_Off, _Off + _N0) with [_Ptr, _Ptr + _Count)
1454  _DEBUG_POINTER_IF(_Count != 0, _Ptr);
1455  if (_Inside(_Ptr))
1456  return (replace(_Off, _N0, *this,
1457  _Ptr - this->_Myptr(),
1458  _Count)); // substring, replace carefully
1459  _Check_offset(_Off);
1460  _N0 = _Clamp_suffix_size(_Off, _N0);
1461  if (npos - _Count <= this->_Mysize() - _N0)
1462  _Xlen(); // result too long
1463  size_type _Nm = this->_Mysize() - _N0 - _Off;
1464 
1465  if (_Count < _N0)
1466  _Traits::move(this->_Myptr() + _Off + _Count,
1467  this->_Myptr() + _Off + _N0,
1468  _Nm); // smaller hole, move tail up
1469  const size_type _Num = this->_Mysize() + _Count - _N0;
1470  if ((0 < _Count || 0 < _N0)
1471  && _Grow(_Num))
1472  { // make room and rearrange
1473  if (_N0 < _Count)
1474  _Traits::move(this->_Myptr() + _Off + _Count,
1475  this->_Myptr() + _Off + _N0, _Nm); // move tail down
1476  _Traits::copy(this->_Myptr() + _Off, _Ptr, _Count); // fill hole
1477  _Eos(_Num);
1478  }
1479  return (*this);
1480  }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2369
void _Eos(size_type _Newsize)
Definition: xstring:2216
static _PGLOBAL const size_type npos
Definition: xstring:1020
unsigned int _Count
Definition: xcomplex:668
#define _DEBUG_POINTER_IF(test, first)
Definition: xutility:820
size_type & _Mysize() _NOEXCEPT
Definition: xstring:722
void _Check_offset(const size_type _Off) const
Definition: xstring:2269
void _Xlen() const
Definition: xstring:2264
size_type _Clamp_suffix_size(const size_type _Off, const size_type _Size) const
Definition: xstring:2110
value_type * _Myptr()
Definition: xstring:576
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:1009
bool _Inside(const _Elem *_Ptr)
Definition: xstring:2237
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1290
_Mybase::size_type size_type
Definition: xstring:762
bool _Grow(size_type _Newsize, bool _Trim=false)
Definition: xstring:2222
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::replace ( size_type  _Off,
size_type  _N0,
const _Elem *  _Ptr 
)
inline
1483  { // replace [_Off, _Off + _N0) with [_Ptr, <null>)
1484  _DEBUG_POINTER(_Ptr);
1485  return (replace(_Off, _N0, _Ptr, _Traits::length(_Ptr)));
1486  }
#define _DEBUG_POINTER(first)
Definition: xutility:819
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:1009
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::replace ( size_type  _Off,
size_type  _N0,
size_type  _Count,
_Elem  _Ch 
)
inline
1490  { // replace [_Off, _Off + _N0) with _Count * _Ch
1491  _Check_offset(_Off);
1492  _N0 = _Clamp_suffix_size(_Off, _N0);
1493  if (npos - _Count <= this->_Mysize() - _N0)
1494  _Xlen(); // result too long
1495  size_type _Nm = this->_Mysize() - _N0 - _Off;
1496 
1497  if (_Count < _N0)
1498  _Traits::move(this->_Myptr() + _Off + _Count,
1499  this->_Myptr() + _Off + _N0,
1500  _Nm); // smaller hole, move tail up
1501  const size_type _Num = this->_Mysize() + _Count - _N0;
1502  if ((0 < _Count || 0 < _N0)
1503  && _Grow(_Num))
1504  { // make room and rearrange
1505  if (_N0 < _Count)
1506  _Traits::move(this->_Myptr() + _Off + _Count,
1507  this->_Myptr() + _Off + _N0, _Nm); // move tail down
1508  _Chassign(_Off, _Count, _Ch); // fill hole
1509  _Eos(_Num);
1510  }
1511  return (*this);
1512  }
void _Eos(size_type _Newsize)
Definition: xstring:2216
static _PGLOBAL const size_type npos
Definition: xstring:1020
unsigned int _Count
Definition: xcomplex:668
size_type & _Mysize() _NOEXCEPT
Definition: xstring:722
void _Check_offset(const size_type _Off) const
Definition: xstring:2269
void _Chassign(size_type _Off, size_type _Count, _Elem _Ch)
Definition: xstring:2173
void _Xlen() const
Definition: xstring:2264
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
size_type _Clamp_suffix_size(const size_type _Off, const size_type _Size) const
Definition: xstring:2110
value_type * _Myptr()
Definition: xstring:576
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1290
_Mybase::size_type size_type
Definition: xstring:762
bool _Grow(size_type _Newsize, bool _Trim=false)
Definition: xstring:2222
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::replace ( const_iterator  _First,
const_iterator  _Last,
const _Myt _Right 
)
inline
1516  { // replace [_First, _Last) with _Right
1517  return (replace(_First - begin(), _Last - _First, _Right));
1518  }
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:1009
iterator begin() _NOEXCEPT
Definition: xstring:1593
_FwdIt _Last
Definition: algorithm:1936
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::replace ( const_iterator  _First,
const_iterator  _Last,
const _Elem *  _Ptr,
size_type  _Count 
)
inline
1522  { // replace [_First, _Last) with [_Ptr, _Ptr + _Count)
1523  return (replace(_First - begin(), _Last - _First, _Ptr, _Count));
1524  }
unsigned int _Count
Definition: xcomplex:668
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:1009
iterator begin() _NOEXCEPT
Definition: xstring:1593
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::replace ( const_iterator  _First,
const_iterator  _Last,
const _Elem *  _Ptr 
)
inline
1528  { // replace [_First, _Last) with [_Ptr, <null>)
1529  return (replace(_First - begin(), _Last - _First, _Ptr));
1530  }
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:1009
iterator begin() _NOEXCEPT
Definition: xstring:1593
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::replace ( const_iterator  _First,
const_iterator  _Last,
size_type  _Count,
_Elem  _Ch 
)
inline
1534  { // replace [_First, _Last) with _Count * _Ch
1535  return (replace(_First - begin(), _Last - _First, _Count, _Ch));
1536  }
unsigned int _Count
Definition: xcomplex:668
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:1009
iterator begin() _NOEXCEPT
Definition: xstring:1593
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits, class _Alloc>
template<class _Iter >
enable_if<_Is_iterator<_Iter>::value, _Myt&>::type basic_string< _Elem, _Traits, _Alloc >::replace ( const_iterator  _First,
const_iterator  _Last,
_Iter  _First2,
_Iter  _Last2 
)
inline
1543  { // replace [_First, _Last) with [_First2, _Last2), input iterators
1544  _Myt _Right(_First2, _Last2);
1545  replace(_First, _Last, _Right);
1546  return (*this);
1547  }
basic_string< _Elem, _Traits, _Alloc > _Myt
Definition: xstring:754
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:1009
_FwdIt _Last
Definition: algorithm:1936
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::replace ( const_iterator  _First,
const_iterator  _Last,
const_pointer  _First2,
const_pointer  _Last2 
)
inline
1551  { // replace [_First, _Last) with [_First2, _Last2), const pointers
1552  if (_First2 == _Last2)
1553  erase(_First - begin(), _Last - _First);
1554  else
1555  replace(_First - begin(), _Last - _First,
1556  &*_First2, _Last2 - _First2);
1557  return (*this);
1558  }
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:1009
_Myt & erase(size_type _Off=0)
Definition: xstring:1339
iterator begin() _NOEXCEPT
Definition: xstring:1593
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::replace ( const_iterator  _First,
const_iterator  _Last,
pointer  _First2,
pointer  _Last2 
)
inline
1562  { // replace [_First, _Last) with [_First2, _Last2), const pointers
1563  if (_First2 == _Last2)
1564  erase(_First - begin(), _Last - _First);
1565  else
1566  replace(_First - begin(), _Last - _First,
1567  &*_First2, _Last2 - _First2);
1568  return (*this);
1569  }
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:1009
_Myt & erase(size_type _Off=0)
Definition: xstring:1339
iterator begin() _NOEXCEPT
Definition: xstring:1593
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::replace ( const_iterator  _First,
const_iterator  _Last,
const_iterator  _First2,
const_iterator  _Last2 
)
inline
1573  { // replace [_First, _Last) with [_First2, _Last2), const_iterators
1574  if (_First2 == _Last2)
1575  erase(_First - begin(), _Last - _First);
1576  else
1577  replace(_First - begin(), _Last - _First,
1578  &*_First2, _Last2 - _First2);
1579  return (*this);
1580  }
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:1009
_Myt & erase(size_type _Off=0)
Definition: xstring:1339
iterator begin() _NOEXCEPT
Definition: xstring:1593
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::replace ( const_iterator  _First,
const_iterator  _Last,
iterator  _First2,
iterator  _Last2 
)
inline
1584  { // replace [_First, _Last) with [_First2, _Last2), const_iterators
1585  if (_First2 == _Last2)
1586  erase(_First - begin(), _Last - _First);
1587  else
1588  replace(_First - begin(), _Last - _First,
1589  &*_First2, _Last2 - _First2);
1590  return (*this);
1591  }
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:1009
_Myt & erase(size_type _Off=0)
Definition: xstring:1339
iterator begin() _NOEXCEPT
Definition: xstring:1593
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits, class _Alloc>
void basic_string< _Elem, _Traits, _Alloc >::reserve ( size_type  _Newcap = 0)
inline
1793  { // determine new minimum length of allocated storage
1794  if (this->_Mysize() <= _Newcap && this->_Myres() != _Newcap)
1795  { // change reservation
1796  size_type _Size = this->_Mysize();
1797  if (_Grow(_Newcap, true))
1798  _Eos(_Size);
1799  }
1800  }
void _Eos(size_type _Newsize)
Definition: xstring:2216
size_type & _Mysize() _NOEXCEPT
Definition: xstring:722
size_type & _Myres() _NOEXCEPT
Definition: xstring:732
_Mybase::size_type size_type
Definition: xstring:762
bool _Grow(size_type _Newsize, bool _Trim=false)
Definition: xstring:2222
_Size
Definition: vcruntime_string.h:36
template<class _Elem, class _Traits, class _Alloc>
void basic_string< _Elem, _Traits, _Alloc >::resize ( size_type  _Newsize)
inline
1775  { // determine new length, padding with null elements as needed
1776  resize(_Newsize, _Elem());
1777  }
void resize(size_type _Newsize)
Definition: xstring:1774
template<class _Elem, class _Traits, class _Alloc>
void basic_string< _Elem, _Traits, _Alloc >::resize ( size_type  _Newsize,
_Elem  _Ch 
)
inline
1780  { // determine new length, padding with _Ch elements as needed
1781  if (_Newsize <= this->_Mysize())
1782  _Eos(_Newsize);
1783  else
1784  append(_Newsize - this->_Mysize(), _Ch);
1785  }
void _Eos(size_type _Newsize)
Definition: xstring:2216
size_type & _Mysize() _NOEXCEPT
Definition: xstring:722
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
_Myt & append(_XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:998
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::rfind ( const _Myt _Right,
size_type  _Off = npos 
) const
inline
1906  { // look for _Right beginning before _Off
1907  return (rfind(_Right._Myptr(), _Off, _Right.size()));
1908  }
size_type rfind(const _Myt &_Right, size_type _Off=npos) const _NOEXCEPT
Definition: xstring:1905
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::rfind ( const _Elem *  _Ptr,
size_type  _Off,
size_type  _Count 
) const
inline
1912  { // look for [_Ptr, _Ptr + _Count) beginning before _Off
1913  _DEBUG_POINTER_IF(_Count != 0, _Ptr);
1914  if (_Count == 0)
1915  return (_Off < this->_Mysize() ? _Off
1916  : this->_Mysize()); // null always matches
1917  if (_Count <= this->_Mysize())
1918  { // room for match, look for it
1919  const _Elem *_Uptr = this->_Myptr() +
1920  (_Off < this->_Mysize() - _Count ? _Off
1921  : this->_Mysize() - _Count);
1922  for (; ; --_Uptr)
1923  if (_Traits::eq(*_Uptr, *_Ptr)
1924  && _Traits::compare(_Uptr, _Ptr, _Count) == 0)
1925  return (_Uptr - this->_Myptr()); // found a match
1926  else if (_Uptr == this->_Myptr())
1927  break; // at beginning, no more chance for match
1928  }
1929 
1930  return (npos); // no match
1931  }
static _PGLOBAL const size_type npos
Definition: xstring:1020
unsigned int _Count
Definition: xcomplex:668
#define _DEBUG_POINTER_IF(test, first)
Definition: xutility:820
size_type & _Mysize() _NOEXCEPT
Definition: xstring:722
value_type * _Myptr()
Definition: xstring:576
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::rfind ( const _Elem *  _Ptr,
size_type  _Off = npos 
) const
inline
1934  { // look for [_Ptr, <null>) beginning before _Off
1935  _DEBUG_POINTER(_Ptr);
1936  return (rfind(_Ptr, _Off, _Traits::length(_Ptr)));
1937  }
size_type rfind(const _Myt &_Right, size_type _Off=npos) const _NOEXCEPT
Definition: xstring:1905
#define _DEBUG_POINTER(first)
Definition: xutility:819
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::rfind ( _Elem  _Ch,
size_type  _Off = npos 
) const
inline
1940  { // look for _Ch before _Off
1941  return (rfind((const _Elem *)&_Ch, _Off, 1));
1942  }
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
size_type rfind(const _Myt &_Right, size_type _Off=npos) const _NOEXCEPT
Definition: xstring:1905
template<class _Elem, class _Traits, class _Alloc>
void basic_string< _Elem, _Traits, _Alloc >::shrink_to_fit ( )
inline
1658  { // reduce capacity
1659  if ((size() | this->_ALLOC_MASK) < capacity())
1660  { // worth shrinking, do it
1661  _Myt _Tmp(*this);
1662  swap(_Tmp);
1663  }
1664  }
basic_string< _Elem, _Traits, _Alloc > _Myt
Definition: xstring:754
void swap(_Myt &_Right) _NOEXCEPT_OP(_Alty
Definition: xstring:1854
size_type size() const _NOEXCEPT
Definition: xstring:1763
size_type capacity() const _NOEXCEPT
Definition: xstring:1787
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::size ( ) const
inline
1764  { // return length of sequence
1765  return (this->_Mysize());
1766  }
size_type & _Mysize() _NOEXCEPT
Definition: xstring:722
template<class _Elem, class _Traits, class _Alloc>
_Myt basic_string< _Elem, _Traits, _Alloc >::substr ( size_type  _Off = 0,
size_type  _Count = npos 
) const
inline
2088  { // return [_Off, _Off + _Count) as new string
2089  return (_Myt(*this, _Off, _Count, get_allocator()));
2090  }
unsigned int _Count
Definition: xcomplex:668
allocator_type get_allocator() const _NOEXCEPT
Definition: xstring:2167
basic_string< _Elem, _Traits, _Alloc > _Myt
Definition: xstring:754
template<class _Elem, class _Traits, class _Alloc>
void basic_string< _Elem, _Traits, _Alloc >::swap ( _Myt _Right)
inline
1857  { // exchange contents with _Right
1858  if (this != &_Right)
1859  { // (maybe) swap allocators, swap control information
1860  _Pocs(this->_Getal(), _Right._Getal());
1861  this->_Swap_all(_Right);
1862  _Swap_bx(_Right);
1863  _STD swap(this->_Mysize(), _Right._Mysize());
1864  _STD swap(this->_Myres(), _Right._Myres());
1865  }
1866  }
void _Swap_bx(_Myt &_Right)
Definition: xstring:1828
_Alty & _Getal() _NOEXCEPT
Definition: xstring:690
size_type & _Mysize() _NOEXCEPT
Definition: xstring:722
void _Swap_all(_Myt &_Right)
Definition: xstring:685
void swap(_Myt &_Right) _NOEXCEPT_OP(_Alty
Definition: xstring:1854
size_type & _Myres() _NOEXCEPT
Definition: xstring:732
void _Pocs(_Alty &_Left, _Alty &_Right, true_type) _NOEXCEPT
Definition: xmemory0:1069
constexpr const _Ty &() _Right
Definition: algorithm:3591

Member Data Documentation

template<class _Elem, class _Traits, class _Alloc>
_PGLOBAL const basic_string< _Elem, _Traits, _Alloc >::size_type basic_string< _Elem, _Traits, _Alloc >::npos
static
Initial value:

The documentation for this class was generated from the following file: