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<!is_empty< _Alloc >::value, _String_base_types< _Elem, _Alloc > > _String_val< _String_base_types< _Elem, _Alloc >::_Val_types > _Container_base0

Public Types

typedef basic_string< _Elem, _Traits, _Alloc_Myt
 
typedef _String_alloc<!is_empty< _Alloc >::value, _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<!is_empty< _Alloc >::value, _String_base_types< _Elem, _Alloc > >
typedef _String_alloc< _Al_has_storage, _String_base_types< _Elem, _Alloc > > _Myt
 
typedef _String_base_types< _Elem, _Alloc >::_Alloc _Alloc
 
typedef _String_base_types< _Elem, _Alloc >::_Alty _Alty
 
- Public Types inherited from _String_val< _String_base_types< _Elem, _Alloc >::_Val_types >
enum  
 
enum  
 
typedef _String_val< _String_base_types< _Elem, _Alloc >::_Val_types > _Myt
 
typedef _String_base_types< _Elem, _Alloc >::_Val_types::value_type value_type
 
typedef _String_base_types< _Elem, _Alloc >::_Val_types::size_type size_type
 
typedef _String_base_types< _Elem, _Alloc >::_Val_types::difference_type difference_type
 
typedef _String_base_types< _Elem, _Alloc >::_Val_types::pointer pointer
 
typedef _String_base_types< _Elem, _Alloc >::_Val_types::const_pointer const_pointer
 
typedef _String_base_types< _Elem, _Alloc >::_Val_types::reference reference
 
typedef _String_base_types< _Elem, _Alloc >::_Val_types::const_reference const_reference
 
typedef _String_iterator< _Mytiterator
 
typedef _String_const_iterator< _Mytconst_iterator
 

Public Member Functions

 basic_string (const _Myt &_Right)
 
 basic_string (const _Myt &_Right, const _Alloc &_Al)
 
 basic_string ()
 
 basic_string (const _Alloc &_Al)
 
 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)
 
template<class _Iter , class = typename enable_if<_Is_iterator<_Iter>::value, void>::type>
 basic_string (_Iter _First, _Iter _Last, const _Alloc &_Al)
 
template<class _Iter >
void _Construct (_Iter _First, _Iter _Last, input_iterator_tag)
 
template<class _Iter >
void _Construct (_Iter _First, _Iter _Last, forward_iterator_tag)
 
 basic_string (const_pointer _First, const_pointer _Last)
 
 basic_string (const_pointer _First, const_pointer _Last, const _Alloc &_Al)
 
 basic_string (const_iterator _First, const_iterator _Last)
 
 basic_string (_Myt &&_Right) _NOEXCEPT
 
 basic_string (_Myt &&_Right, const _Alloc &_Al)
 
_Mytoperator= (_Myt &&_Right) _NOEXCEPT
 
_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)
 
_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)
 
_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)
 
_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)
 
_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
 
_SCL_INSECURE_DEPRECATE 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)
 
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
 
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) 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)
 
 __declspec (noreturn) void _Xlen() const
 
 __declspec (noreturn) void _Xran() const
 
- Public Member Functions inherited from _String_alloc<!is_empty< _Alloc >::value, _String_base_types< _Elem, _Alloc > >
 _String_alloc (const _Alloc &_Al=_Alloc())
 
void _Change_alloc (const _Alty &_Al)
 
void _Swap_alloc (_Myt &_Right)
 
_Alty_Getal ()
 
const _Alty_Getal () const
 
- Public Member Functions inherited from _String_val< _String_base_types< _Elem, _Alloc >::_Val_types >
 _String_val ()
 
value_type_Myptr ()
 
const value_type_Myptr () const
 
- Public Member Functions inherited from _Container_base0
void _Orphan_all ()
 
void _Swap_all (_Container_base0 &)
 

Static Public Member Functions

static size_type _Pdif (const_iterator _P2, const_iterator _P1)
 

Static Public Attributes

static _PGLOBAL const size_type npos
 

Additional Inherited Members

- Public Attributes inherited from _String_alloc<!is_empty< _Alloc >::value, _String_base_types< _Elem, _Alloc > >
_String_base_types< _Elem, _Alloc >::_Alty _Alval
 
- Public Attributes inherited from _String_val< _String_base_types< _Elem, _Alloc >::_Val_types >
union _String_val::_Bxty _Bx
 
size_type _Mysize
 
size_type _Myres
 

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<!is_empty<_Alloc>::value, _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
721  : _Mybase(_Right._Getal().select_on_container_copy_construction())
722 
723 
724  { // construct by copying _Right
725  _Tidy();
726  assign(_Right, 0, npos);
727  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2270
static _PGLOBAL const size_type npos
Definition: xstring:994
_String_alloc<!is_empty< _Alloc >::value, _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:699
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:919
const _Ty & _Right
Definition: algorithm:4087
template<class _Elem, class _Traits, class _Alloc>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( const _Myt _Right,
const _Alloc _Al 
)
inline
730  : _Mybase(_Al)
731  { // construct by copying with allocator
732  _Tidy();
733  assign(_Right, 0, npos);
734  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2270
static _PGLOBAL const size_type npos
Definition: xstring:994
_String_alloc<!is_empty< _Alloc >::value, _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:699
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:919
const _Ty & _Right
Definition: algorithm:4087
template<class _Elem, class _Traits, class _Alloc>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( )
inline
737  : _Mybase()
738  { // construct empty string
739  _Tidy();
740  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2270
_String_alloc<!is_empty< _Alloc >::value, _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:699
template<class _Elem, class _Traits, class _Alloc>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( const _Alloc _Al)
inlineexplicit
743  : _Mybase(_Al)
744  { // construct empty string with allocator
745  _Tidy();
746  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2270
_String_alloc<!is_empty< _Alloc >::value, _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:699
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
750  : _Mybase(_Right._Getal())
751  { // construct from _Right [_Roff, _Roff + _Count)
752  _Tidy();
753  assign(_Right, _Roff, _Count);
754  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2270
_String_alloc<!is_empty< _Alloc >::value, _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:699
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:919
_Diff _Count
Definition: algorithm:1941
const _Ty & _Right
Definition: algorithm:4087
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
758  : _Mybase(_Al)
759  { // construct from _Right [_Roff, _Roff + _Count) with allocator
760  _Tidy();
761  assign(_Right, _Roff, _Count);
762  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2270
_String_alloc<!is_empty< _Alloc >::value, _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:699
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:919
_Diff _Count
Definition: algorithm:1941
const _Ty & _Right
Definition: algorithm:4087
template<class _Elem, class _Traits, class _Alloc>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( const _Elem *  _Ptr,
size_type  _Count 
)
inline
765  : _Mybase()
766  { // construct from [_Ptr, _Ptr + _Count)
767  _Tidy();
768  assign(_Ptr, _Count);
769  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2270
_String_alloc<!is_empty< _Alloc >::value, _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:699
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:919
_Diff _Count
Definition: algorithm:1941
template<class _Elem, class _Traits, class _Alloc>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( const _Elem *  _Ptr,
size_type  _Count,
const _Alloc _Al 
)
inline
772  : _Mybase(_Al)
773  { // construct from [_Ptr, _Ptr + _Count) with allocator
774  _Tidy();
775  assign(_Ptr, _Count);
776  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2270
_String_alloc<!is_empty< _Alloc >::value, _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:699
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:919
_Diff _Count
Definition: algorithm:1941
template<class _Elem, class _Traits, class _Alloc>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( const _Elem *  _Ptr)
inline
779  : _Mybase()
780  { // construct from [_Ptr, <null>)
781  _Tidy();
782  assign(_Ptr);
783  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2270
_String_alloc<!is_empty< _Alloc >::value, _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:699
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:919
template<class _Elem, class _Traits, class _Alloc>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( const _Elem *  _Ptr,
const _Alloc _Al 
)
inline
786  : _Mybase(_Al)
787  { // construct from [_Ptr, <null>) with allocator
788  _Tidy();
789  assign(_Ptr);
790  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2270
_String_alloc<!is_empty< _Alloc >::value, _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:699
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:919
template<class _Elem, class _Traits, class _Alloc>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( size_type  _Count,
_Elem  _Ch 
)
inline
793  : _Mybase()
794  { // construct from _Count * _Ch
795  _Tidy();
796  assign(_Count, _Ch);
797  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2270
_String_alloc<!is_empty< _Alloc >::value, _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:699
_In_ size_t _In_ unsigned int _Ch
Definition: mbstring.h:161
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:919
_Diff _Count
Definition: algorithm:1941
template<class _Elem, class _Traits, class _Alloc>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( size_type  _Count,
_Elem  _Ch,
const _Alloc _Al 
)
inline
800  : _Mybase(_Al)
801  { // construct from _Count * _Ch with allocator
802  _Tidy();
803  assign(_Count, _Ch);
804  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2270
_String_alloc<!is_empty< _Alloc >::value, _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:699
_In_ size_t _In_ unsigned int _Ch
Definition: mbstring.h:161
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:919
_Diff _Count
Definition: algorithm:1941
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 
)
inline
810  : _Mybase()
811  { // construct from [_First, _Last)
812  _Tidy();
813  _Construct(_First, _Last, _Iter_cat(_First));
814  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2270
_String_alloc<!is_empty< _Alloc >::value, _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:699
iterator_traits< _Iter >::iterator_category _Iter_cat(const _Iter &)
Definition: xutility:404
void _Construct(_Iter _First, _Iter _Last, input_iterator_tag)
Definition: xstring:827
_FwdIt _Last
Definition: algorithm:1936
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 
)
inline
820  : _Mybase(_Al)
821  { // construct from [_First, _Last) with allocator
822  _Tidy();
823  _Construct(_First, _Last, _Iter_cat(_First));
824  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2270
_String_alloc<!is_empty< _Alloc >::value, _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:699
iterator_traits< _Iter >::iterator_category _Iter_cat(const _Iter &)
Definition: xutility:404
void _Construct(_Iter _First, _Iter _Last, input_iterator_tag)
Definition: xstring:827
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits, class _Alloc>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( const_pointer  _First,
const_pointer  _Last 
)
inline
858  : _Mybase()
859  { // construct from [_First, _Last), const pointers
860  _DEBUG_RANGE(_First, _Last);
861  _Tidy();
862  if (_First != _Last)
863  assign(&*_First, _Last - _First);
864  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2270
#define _DEBUG_RANGE(first, last)
Definition: xutility:467
_String_alloc<!is_empty< _Alloc >::value, _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:699
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:919
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits, class _Alloc>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( const_pointer  _First,
const_pointer  _Last,
const _Alloc _Al 
)
inline
868  : _Mybase(_Al)
869  { // construct from [_First, _Last), const pointers
870  _DEBUG_RANGE(_First, _Last);
871  _Tidy();
872  if (_First != _Last)
873  assign(&*_First, _Last - _First);
874  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2270
#define _DEBUG_RANGE(first, last)
Definition: xutility:467
_String_alloc<!is_empty< _Alloc >::value, _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:699
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:919
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits, class _Alloc>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( const_iterator  _First,
const_iterator  _Last 
)
inline
877  : _Mybase()
878  { // construct from [_First, _Last), const_iterators
879  _DEBUG_RANGE(_First, _Last);
880  _Tidy();
881  if (_First != _Last)
882  assign(&*_First, _Last - _First);
883  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2270
#define _DEBUG_RANGE(first, last)
Definition: xutility:467
_String_alloc<!is_empty< _Alloc >::value, _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:699
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:919
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits, class _Alloc>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( _Myt &&  _Right)
inline
886  : _Mybase(_Right._Getal())
887  { // construct by moving _Right
888  _Tidy();
889  _Assign_rv(_STD forward<_Myt>(_Right));
890  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2270
_String_alloc<!is_empty< _Alloc >::value, _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:699
void _Assign_rv(_Myt &&_Right)
Definition: xstring:934
const _Ty & _Right
Definition: algorithm:4087
template<class _Elem, class _Traits, class _Alloc>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( _Myt &&  _Right,
const _Alloc _Al 
)
inline
893  : _Mybase(_Al)
894  { // construct by moving _Right, allocator
895  if (this->_Getal() != _Right._Getal())
896  assign(_Right.begin(), _Right.end());
897  else
898  _Assign_rv(_STD forward<_Myt>(_Right));
899  }
_String_alloc<!is_empty< _Alloc >::value, _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:699
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:919
void _Assign_rv(_Myt &&_Right)
Definition: xstring:934
const _Ty & _Right
Definition: algorithm:4087
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
951  : _Mybase(_Al)
952  { // construct from initializer_list
953  _Tidy();
954  assign(_Ilist.begin(), _Ilist.end());
955  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2270
_String_alloc<!is_empty< _Alloc >::value, _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:699
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:919
template<class _Elem, class _Traits, class _Alloc>
basic_string< _Elem, _Traits, _Alloc >::~basic_string ( )
inline
990  { // destroy the string
991  _Tidy(true);
992  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2270

Member Function Documentation

template<class _Elem, class _Traits, class _Alloc>
basic_string< _Elem, _Traits, _Alloc >::__declspec ( noreturn  ) const
inline
2289  { // report a length_error
2290  _Xlength_error("string too long");
2291  }
template<class _Elem, class _Traits, class _Alloc>
basic_string< _Elem, _Traits, _Alloc >::__declspec ( noreturn  ) const
inline
2294  { // report an out_of_range error
2295  _Xout_of_range("invalid string position");
2296  }
template<class _Elem, class _Traits, class _Alloc>
void basic_string< _Elem, _Traits, _Alloc >::_Assign_rv ( _Myt &&  _Right)
inline
935  { // assign by moving _Right
936  if (_Right._Myres < this->_BUF_SIZE)
937  _Traits::move(this->_Bx._Buf, _Right._Bx._Buf,
938  _Right._Mysize + 1);
939  else
940  { // copy pointer
941  this->_Getal().construct(&this->_Bx._Ptr, _Right._Bx._Ptr);
942  _Right._Bx._Ptr = pointer();
943  }
944  this->_Mysize = _Right._Mysize;
945  this->_Myres = _Right._Myres;
946  _Right._Tidy();
947  }
_OutIt move(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2447
pointer _Ptr
Definition: xstring:526
_Mybase::pointer pointer
Definition: xstring:708
const _Ty & _Right
Definition: algorithm:4087
value_type _Buf[_BUF_SIZE]
Definition: xstring:525
template<class _Elem, class _Traits, class _Alloc>
void basic_string< _Elem, _Traits, _Alloc >::_Chassign ( size_type  _Off,
size_type  _Count,
_Elem  _Ch 
)
inline
2193  { // assign _Count copies of _Ch beginning at _Off
2194  if (_Count == 1)
2195  _Traits::assign(*(this->_Myptr() + _Off), _Ch);
2196  else
2197  _Traits::assign(this->_Myptr() + _Off, _Count, _Ch);
2198  }
_In_ size_t _In_ unsigned int _Ch
Definition: mbstring.h:161
_Diff _Count
Definition: algorithm:1941
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
829  { // initialize from [_First, _Last), input iterators
830  _TRY_BEGIN
831  for (; _First != _Last; ++_First)
832  append((size_type)1, (_Elem)*_First);
833  _CATCH_ALL
834  _Tidy(true);
835  _RERAISE;
836  _CATCH_END
837  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2270
#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:706
_Myt & append(_XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:972
#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
842  { // initialize from [_First, _Last), forward iterators
843  _DEBUG_RANGE(_First, _Last);
844  size_type _Count = 0;
845  _Distance(_First, _Last, _Count);
846  reserve(_Count);
847 
848  _TRY_BEGIN
849  for (; _First != _Last; ++_First)
850  append((size_type)1, (_Elem)*_First);
851  _CATCH_ALL
852  _Tidy(true);
853  _RERAISE;
854  _CATCH_END
855  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2270
#define _DEBUG_RANGE(first, last)
Definition: xutility:467
void _Distance(_InIt _First, _InIt _Last, _Diff &_Off)
Definition: xutility:764
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
#define _CATCH_ALL
Definition: xstddef:62
void reserve(size_type _Newcap=0)
Definition: xstring:1781
_Diff _Count
Definition: algorithm:1941
_Mybase::size_type size_type
Definition: xstring:706
_Myt & append(_XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:972
#define _RERAISE
Definition: xstddef:74
_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
2201  { // copy _Oldlen elements to newly allocated buffer
2202  size_type _Newres = _Newsize | this->_ALLOC_MASK;
2203  if (max_size() < _Newres)
2204  _Newres = _Newsize; // undo roundup if too big
2205  else if (this->_Myres / 2 <= _Newres / 3)
2206  ;
2207  else if (this->_Myres <= max_size() - this->_Myres / 2)
2208  _Newres = this->_Myres
2209  + this->_Myres / 2; // grow exponentially if possible
2210  else
2211  _Newres = max_size(); // settle for max_size()
2212 
2213  _Elem *_Ptr;
2214  _TRY_BEGIN
2215  _Ptr = this->_Getal().allocate(_Newres + 1);
2216  _CATCH_ALL
2217  _Newres = _Newsize; // allocation failed, undo roundup and retry
2218  _TRY_BEGIN
2219  _Ptr = this->_Getal().allocate(_Newres + 1);
2220  _CATCH_ALL
2221  _Tidy(true); // failed again, discard storage and reraise
2222  _RERAISE;
2223  _CATCH_END
2224  _CATCH_END
2225 
2226  if (0 < _Oldlen)
2227  _Traits::copy(_Ptr, this->_Myptr(),
2228  _Oldlen); // copy existing elements
2229  _Tidy(true);
2230  this->_Getal().construct(&this->_Bx._Ptr, _Ptr);
2231  this->_Myres = _Newres;
2232  _Eos(_Oldlen);
2233  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2270
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2072
void _Eos(size_type _Newsize)
Definition: xstring:2235
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
pointer _Ptr
Definition: xstring:526
#define _CATCH_ALL
Definition: xstddef:62
size_type max_size() const _NOEXCEPT
Definition: xstring:1757
_Mybase::size_type size_type
Definition: xstring:706
#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
1816  { // copy [_Off, _Off + _Count) to [_Dest, _Dest + _Count)
1817  #if _ITERATOR_DEBUG_LEVEL == 2
1818  if (_Count != 0)
1819  _DEBUG_POINTER(_Dest);
1820  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1821 
1822  if (this->_Mysize < _Off)
1823  _Xran(); // _Off off end
1824  if (this->_Mysize - _Off < _Count)
1825  _Count = this->_Mysize - _Off;
1826  _Traits::_Copy_s(_Dest, _Dest_size, this->_Myptr() + _Off, _Count);
1827  return (_Count);
1828  }
#define _DEBUG_POINTER(first)
Definition: xutility:465
_Diff _Count
Definition: algorithm:1941
template<class _Elem, class _Traits, class _Alloc>
void basic_string< _Elem, _Traits, _Alloc >::_Eos ( size_type  _Newsize)
inline
2236  { // set new length and null terminator
2237  _Traits::assign(this->_Myptr()[this->_Mysize = _Newsize], _Elem());
2238  }
template<class _Elem, class _Traits, class _Alloc>
bool basic_string< _Elem, _Traits, _Alloc >::_Grow ( size_type  _Newsize,
bool  _Trim = false 
)
inline
2242  { // ensure buffer is big enough, trim to size if _Trim is true
2243  if (max_size() < _Newsize)
2244  _Xlen(); // result too long
2245  if (this->_Myres < _Newsize)
2246  _Copy(_Newsize, this->_Mysize); // reallocate to grow
2247  else if (_Trim && _Newsize < this->_BUF_SIZE)
2248  _Tidy(true, // copy and deallocate if trimming to small string
2249  _Newsize < this->_Mysize ? _Newsize : this->_Mysize);
2250  else if (_Newsize == 0)
2251  _Eos(0); // new size is zero, just null terminate
2252  return (0 < _Newsize); // return true only if more work to do
2253  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2270
void _Eos(size_type _Newsize)
Definition: xstring:2235
void _Copy(size_type _Newsize, size_type _Oldlen)
Definition: xstring:2200
size_type max_size() const _NOEXCEPT
Definition: xstring:1757
template<class _Elem, class _Traits, class _Alloc>
bool basic_string< _Elem, _Traits, _Alloc >::_Inside ( const _Elem *  _Ptr)
inline
2256  { // test if _Ptr points inside string
2257  if (_Ptr == 0 || _Ptr < this->_Myptr()
2258  || this->_Myptr() + this->_Mysize <= _Ptr)
2259  return (false); // don't ask
2260  else
2261  return (true);
2262  }
template<class _Elem, class _Traits, class _Alloc>
static size_type basic_string< _Elem, _Traits, _Alloc >::_Pdif ( const_iterator  _P2,
const_iterator  _P1 
)
inlinestatic
2266  { // compute safe iterator difference
2267  return (_STRING_ITER_BASE(_P2) == 0 ? 0 : _P2 - _P1);
2268  }
#define _STRING_ITER_BASE(it)
Definition: xstring:23
template<class _Elem, class _Traits, class _Alloc>
void basic_string< _Elem, _Traits, _Alloc >::_Swap_bx ( _Myt _Right)
inline
1831  { // exchange _Bx with _Right._Bx
1832  if (this->_BUF_SIZE <= this->_Myres)
1833  if (this->_BUF_SIZE <= _Right._Myres)
1834  _Swap_adl(this->_Bx._Ptr, _Right._Bx._Ptr);
1835  else
1836  { // swap large with small
1837  pointer _Ptr = this->_Bx._Ptr;
1838  this->_Getal().destroy(&this->_Bx._Ptr);
1839  _Traits::copy(this->_Bx._Buf,
1840  _Right._Bx._Buf, _Right._Mysize + 1);
1841  this->_Getal().construct(&_Right._Bx._Ptr, _Ptr);
1842  }
1843  else
1844  if (_Right._Myres < this->_BUF_SIZE)
1845  _STD swap(this->_Bx._Buf, _Right._Bx._Buf);
1846  else
1847  { // swap small with large
1848  pointer _Ptr = _Right._Bx._Ptr;
1849  this->_Getal().destroy(&_Right._Bx._Ptr);
1850  _Traits::copy(_Right._Bx._Buf,
1851  this->_Bx._Buf, this->_Mysize + 1);
1852  this->_Getal().construct(&this->_Bx._Ptr, _Ptr);
1853  }
1854  }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2072
pointer _Ptr
Definition: xstring:526
void swap(_Myt &_Right)
Definition: xstring:1856
_Mybase::pointer pointer
Definition: xstring:708
const _Ty & _Right
Definition: algorithm:4087
value_type _Buf[_BUF_SIZE]
Definition: xstring:525
template<class _Elem, class _Traits, class _Alloc>
void basic_string< _Elem, _Traits, _Alloc >::_Tidy ( bool  _Built = false,
size_type  _Newsize = 0 
)
inline
2272  { // initialize buffer, deallocating any storage
2273  if (!_Built)
2274  ;
2275  else if (this->_BUF_SIZE <= this->_Myres)
2276  { // copy any leftovers to small buffer and deallocate
2277  pointer _Ptr = this->_Bx._Ptr;
2278  this->_Getal().destroy(&this->_Bx._Ptr);
2279  if (0 < _Newsize)
2280  _Traits::copy(this->_Bx._Buf,
2281  _STD addressof(*_Ptr), _Newsize);
2282  this->_Getal().deallocate(_Ptr, this->_Myres + 1);
2283  }
2284  this->_Myres = this->_BUF_SIZE - 1;
2285  _Eos(_Newsize);
2286  }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2072
void _Eos(size_type _Newsize)
Definition: xstring:2235
pointer _Ptr
Definition: xstring:526
_Mybase::pointer pointer
Definition: xstring:708
_Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:91
value_type _Buf[_BUF_SIZE]
Definition: xstring:525
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::append ( _XSTD initializer_list< _Elem >  _Ilist)
inline
973  { // append initializer_list
974  return (append(_Ilist.begin(), _Ilist.end()));
975  }
_Myt & append(_XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:972
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::append ( const _Myt _Right)
inline
1038  { // append _Right
1039  return (append(_Right, 0, npos));
1040  }
static _PGLOBAL const size_type npos
Definition: xstring:994
_Myt & append(_XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:972
const _Ty & _Right
Definition: algorithm:4087
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::append ( const _Myt _Right,
size_type  _Roff,
size_type  _Count 
)
inline
1044  { // append _Right [_Roff, _Roff + _Count)
1045  if (_Right.size() < _Roff)
1046  _Xran(); // _Roff off end
1047  size_type _Num = _Right.size() - _Roff;
1048  if (_Num < _Count)
1049  _Count = _Num; // trim _Count to size
1050  if (npos - this->_Mysize <= _Count)
1051  _Xlen(); // result too long
1052 
1053  if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
1054  { // make room and append new stuff
1055  _Traits::copy(this->_Myptr() + this->_Mysize,
1056  _Right._Myptr() + _Roff, _Count);
1057  _Eos(_Num);
1058  }
1059  return (*this);
1060  }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2072
void _Eos(size_type _Newsize)
Definition: xstring:2235
static _PGLOBAL const size_type npos
Definition: xstring:994
_Diff _Count
Definition: algorithm:1941
_Mybase::size_type size_type
Definition: xstring:706
bool _Grow(size_type _Newsize, bool _Trim=false)
Definition: xstring:2240
const _Ty & _Right
Definition: algorithm:4087
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::append ( const _Elem *  _Ptr,
size_type  _Count 
)
inline
1063  { // append [_Ptr, _Ptr + _Count)
1064  #if _ITERATOR_DEBUG_LEVEL == 2
1065  if (_Count != 0)
1066  _DEBUG_POINTER(_Ptr);
1067  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1068 
1069  if (_Inside(_Ptr))
1070  return (append(*this,
1071  _Ptr - this->_Myptr(), _Count)); // substring
1072  if (npos - this->_Mysize <= _Count)
1073  _Xlen(); // result too long
1074 
1075  size_type _Num;
1076  if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
1077  { // make room and append new stuff
1078  _Traits::copy(this->_Myptr() + this->_Mysize, _Ptr, _Count);
1079  _Eos(_Num);
1080  }
1081  return (*this);
1082  }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2072
void _Eos(size_type _Newsize)
Definition: xstring:2235
static _PGLOBAL const size_type npos
Definition: xstring:994
#define _DEBUG_POINTER(first)
Definition: xutility:465
bool _Inside(const _Elem *_Ptr)
Definition: xstring:2255
_Diff _Count
Definition: algorithm:1941
_Mybase::size_type size_type
Definition: xstring:706
bool _Grow(size_type _Newsize, bool _Trim=false)
Definition: xstring:2240
_Myt & append(_XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:972
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::append ( const _Elem *  _Ptr)
inline
1085  { // append [_Ptr, <null>)
1086  _DEBUG_POINTER(_Ptr);
1087  return (append(_Ptr, _Traits::length(_Ptr)));
1088  }
#define _DEBUG_POINTER(first)
Definition: xutility:465
_Myt & append(_XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:972
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::append ( size_type  _Count,
_Elem  _Ch 
)
inline
1091  { // append _Count * _Ch
1092  if (npos - this->_Mysize <= _Count)
1093  _Xlen(); // result too long
1094 
1095  size_type _Num;
1096  if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
1097  { // make room and append new stuff using assign
1098  _Chassign(this->_Mysize, _Count, _Ch);
1099  _Eos(_Num);
1100  }
1101  return (*this);
1102  }
void _Eos(size_type _Newsize)
Definition: xstring:2235
static _PGLOBAL const size_type npos
Definition: xstring:994
void _Chassign(size_type _Off, size_type _Count, _Elem _Ch)
Definition: xstring:2192
_In_ size_t _In_ unsigned int _Ch
Definition: mbstring.h:161
_Diff _Count
Definition: algorithm:1941
_Mybase::size_type size_type
Definition: xstring:706
bool _Grow(size_type _Newsize, bool _Trim=false)
Definition: xstring:2240
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
1108  { // append [_First, _Last), input iterators
1109  return (replace(end(), end(), _First, _Last));
1110  }
iterator end() _NOEXCEPT
Definition: xstring:1608
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:983
_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
1113  { // append [_First, _Last), const pointers
1114  return (replace(end(), end(), _First, _Last));
1115  }
iterator end() _NOEXCEPT
Definition: xstring:1608
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:983
_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
1118  { // append [_First, _Last), const_iterators
1119  return (replace(end(), end(), _First, _Last));
1120  }
iterator end() _NOEXCEPT
Definition: xstring:1608
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:983
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::assign ( _Myt &&  _Right)
inline
920  { // assign by moving _Right
921  if (this == &_Right)
922  ;
923  else if (get_allocator() != _Right.get_allocator()
924  && this->_BUF_SIZE <= _Right._Myres)
925  *this = _Right;
926  else
927  { // not same, clear this and steal from _Right
928  _Tidy(true);
929  _Assign_rv(_STD forward<_Myt>(_Right));
930  }
931  return (*this);
932  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2270
allocator_type get_allocator() const _NOEXCEPT
Definition: xstring:2187
void _Assign_rv(_Myt &&_Right)
Definition: xstring:934
const _Ty & _Right
Definition: algorithm:4087
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::assign ( _XSTD initializer_list< _Elem >  _Ilist)
inline
968  { // assign initializer_list
969  return (assign(_Ilist.begin(), _Ilist.end()));
970  }
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:919
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::assign ( const _Myt _Right)
inline
1123  { // assign _Right
1124  return (assign(_Right, 0, npos));
1125  }
static _PGLOBAL const size_type npos
Definition: xstring:994
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:919
const _Ty & _Right
Definition: algorithm:4087
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::assign ( const _Myt _Right,
size_type  _Roff,
size_type  _Count 
)
inline
1129  { // assign _Right [_Roff, _Roff + _Count)
1130  if (_Right.size() < _Roff)
1131  _Xran(); // _Roff off end
1132  size_type _Num = _Right.size() - _Roff;
1133  if (_Count < _Num)
1134  _Num = _Count; // trim _Num to size
1135 
1136  if (this == &_Right)
1137  erase((size_type)(_Roff + _Num)), erase(0, _Roff); // substring
1138  else if (_Grow(_Num))
1139  { // make room and assign new stuff
1140  _Traits::copy(this->_Myptr(),
1141  _Right._Myptr() + _Roff, _Num);
1142  _Eos(_Num);
1143  }
1144  return (*this);
1145  }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2072
void _Eos(size_type _Newsize)
Definition: xstring:2235
_Myt & erase(size_type _Off=0)
Definition: xstring:1333
_Diff _Count
Definition: algorithm:1941
_Mybase::size_type size_type
Definition: xstring:706
bool _Grow(size_type _Newsize, bool _Trim=false)
Definition: xstring:2240
const _Ty & _Right
Definition: algorithm:4087
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::assign ( const _Elem *  _Ptr,
size_type  _Count 
)
inline
1148  { // assign [_Ptr, _Ptr + _Count)
1149  #if _ITERATOR_DEBUG_LEVEL == 2
1150  if (_Count != 0)
1151  _DEBUG_POINTER(_Ptr);
1152  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1153 
1154  if (_Inside(_Ptr))
1155  return (assign(*this,
1156  _Ptr - this->_Myptr(), _Count)); // substring
1157 
1158  if (_Grow(_Count))
1159  { // make room and assign new stuff
1160  _Traits::copy(this->_Myptr(), _Ptr, _Count);
1161  _Eos(_Count);
1162  }
1163  return (*this);
1164  }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2072
void _Eos(size_type _Newsize)
Definition: xstring:2235
#define _DEBUG_POINTER(first)
Definition: xutility:465
bool _Inside(const _Elem *_Ptr)
Definition: xstring:2255
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:919
_Diff _Count
Definition: algorithm:1941
bool _Grow(size_type _Newsize, bool _Trim=false)
Definition: xstring:2240
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::assign ( const _Elem *  _Ptr)
inline
1167  { // assign [_Ptr, <null>)
1168  _DEBUG_POINTER(_Ptr);
1169  return (assign(_Ptr, _Traits::length(_Ptr)));
1170  }
#define _DEBUG_POINTER(first)
Definition: xutility:465
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:919
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::assign ( size_type  _Count,
_Elem  _Ch 
)
inline
1173  { // assign _Count * _Ch
1174  if (_Count == npos)
1175  _Xlen(); // result too long
1176 
1177  if (_Grow(_Count))
1178  { // make room and assign new stuff
1179  _Chassign(0, _Count, _Ch);
1180  _Eos(_Count);
1181  }
1182  return (*this);
1183  }
void _Eos(size_type _Newsize)
Definition: xstring:2235
static _PGLOBAL const size_type npos
Definition: xstring:994
void _Chassign(size_type _Off, size_type _Count, _Elem _Ch)
Definition: xstring:2192
_In_ size_t _In_ unsigned int _Ch
Definition: mbstring.h:161
_Diff _Count
Definition: algorithm:1941
bool _Grow(size_type _Newsize, bool _Trim=false)
Definition: xstring:2240
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
1189  { // assign [_First, _Last), input iterators
1190  return (replace(begin(), end(), _First, _Last));
1191  }
iterator end() _NOEXCEPT
Definition: xstring:1608
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:983
iterator begin() _NOEXCEPT
Definition: xstring:1598
_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
1194  { // assign [_First, _Last), const pointers
1195  return (replace(begin(), end(), _First, _Last));
1196  }
iterator end() _NOEXCEPT
Definition: xstring:1608
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:983
iterator begin() _NOEXCEPT
Definition: xstring:1598
_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
1199  { // assign [_First, _Last), const_iterators
1200  return (replace(begin(), end(), _First, _Last));
1201  }
iterator end() _NOEXCEPT
Definition: xstring:1608
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:983
iterator begin() _NOEXCEPT
Definition: xstring:1598
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits, class _Alloc>
reference basic_string< _Elem, _Traits, _Alloc >::at ( size_type  _Off)
inline
1668  { // subscript mutable sequence with checking
1669  if (this->_Mysize <= _Off)
1670  _Xran(); // _Off off end
1671  return (this->_Myptr()[_Off]);
1672  }
template<class _Elem, class _Traits, class _Alloc>
const_reference basic_string< _Elem, _Traits, _Alloc >::at ( size_type  _Off) const
inline
1675  { // subscript nonmutable sequence with checking
1676  if (this->_Mysize <= _Off)
1677  _Xran(); // _Off off end
1678  return (this->_Myptr()[_Off]);
1679  }
template<class _Elem, class _Traits, class _Alloc>
reference basic_string< _Elem, _Traits, _Alloc >::back ( )
inline
1728  { // return last element of mutable sequence
1729  return (*(end() - 1));
1730  }
iterator end() _NOEXCEPT
Definition: xstring:1608
template<class _Elem, class _Traits, class _Alloc>
const_reference basic_string< _Elem, _Traits, _Alloc >::back ( ) const
inline
1733  { // return last element of nonmutable sequence
1734  return (*(end() - 1));
1735  }
iterator end() _NOEXCEPT
Definition: xstring:1608
template<class _Elem, class _Traits, class _Alloc>
iterator basic_string< _Elem, _Traits, _Alloc >::begin ( )
inline
1599  { // return iterator for beginning of mutable sequence
1600  return (_STRING_ITERATOR(this->_Myptr()));
1601  }
#define _STRING_ITERATOR(ptr)
Definition: xstring:25
template<class _Elem, class _Traits, class _Alloc>
const_iterator basic_string< _Elem, _Traits, _Alloc >::begin ( ) const
inline
1604  { // return iterator for beginning of nonmutable sequence
1605  return (_STRING_CONST_ITERATOR(this->_Myptr()));
1606  }
#define _STRING_CONST_ITERATOR(ptr)
Definition: xstring:24
template<class _Elem, class _Traits, class _Alloc>
const _Elem* basic_string< _Elem, _Traits, _Alloc >::c_str ( ) const
inline
1738  { // return pointer to null-terminated nonmutable array
1739  return (this->_Myptr());
1740  }
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::capacity ( ) const
inline
1777  { // return current length of allocated storage
1778  return (this->_Myres);
1779  }
template<class _Elem, class _Traits, class _Alloc>
const_iterator basic_string< _Elem, _Traits, _Alloc >::cbegin ( ) const
inline
1639  { // return iterator for beginning of nonmutable sequence
1640  return (((const _Myt *)this)->begin());
1641  }
basic_string< _Elem, _Traits, _Alloc > _Myt
Definition: xstring:697
iterator begin() _NOEXCEPT
Definition: xstring:1598
template<class _Elem, class _Traits, class _Alloc>
const_iterator basic_string< _Elem, _Traits, _Alloc >::cend ( ) const
inline
1644  { // return iterator for end of nonmutable sequence
1645  return (((const _Myt *)this)->end());
1646  }
basic_string< _Elem, _Traits, _Alloc > _Myt
Definition: xstring:697
iterator end() _NOEXCEPT
Definition: xstring:1608
template<class _Elem, class _Traits, class _Alloc>
void basic_string< _Elem, _Traits, _Alloc >::clear ( )
inline
1373  { // erase all
1374  _Eos(0);
1375  }
void _Eos(size_type _Newsize)
Definition: xstring:2235
template<class _Elem, class _Traits, class _Alloc>
int basic_string< _Elem, _Traits, _Alloc >::compare ( const _Myt _Right) const
inline
2135  { // compare [0, _Mysize) with _Right
2136  return (compare(0, this->_Mysize, _Right._Myptr(), _Right.size()));
2137  }
int compare(const _Myt &_Right) const _NOEXCEPT
Definition: xstring:2134
const _Ty & _Right
Definition: algorithm:4087
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
2141  { // compare [_Off, _Off + _N0) with _Right
2142  return (compare(_Off, _N0, _Right, 0, npos));
2143  }
int compare(const _Myt &_Right) const _NOEXCEPT
Definition: xstring:2134
static _PGLOBAL const size_type npos
Definition: xstring:994
const _Ty & _Right
Definition: algorithm:4087
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 
) const
inline
2148  { // compare [_Off, _Off + _N0) with _Right [_Roff, _Roff + _Count)
2149  if (_Right.size() < _Roff)
2150  _Xran(); // _Off off end
2151  if (_Right._Mysize - _Roff < _Count)
2152  _Count = _Right._Mysize - _Roff; // trim _Count to size
2153  return (compare(_Off, _N0, _Right._Myptr() + _Roff, _Count));
2154  }
int compare(const _Myt &_Right) const _NOEXCEPT
Definition: xstring:2134
_Diff _Count
Definition: algorithm:1941
const _Ty & _Right
Definition: algorithm:4087
template<class _Elem, class _Traits, class _Alloc>
int basic_string< _Elem, _Traits, _Alloc >::compare ( const _Elem *  _Ptr) const
inline
2157  { // compare [0, _Mysize) with [_Ptr, <null>)
2158  _DEBUG_POINTER(_Ptr);
2159  return (compare(0, this->_Mysize, _Ptr, _Traits::length(_Ptr)));
2160  }
int compare(const _Myt &_Right) const _NOEXCEPT
Definition: xstring:2134
#define _DEBUG_POINTER(first)
Definition: xutility:465
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
2163  { // compare [_Off, _Off + _N0) with [_Ptr, <null>)
2164  _DEBUG_POINTER(_Ptr);
2165  return (compare(_Off, _N0, _Ptr, _Traits::length(_Ptr)));
2166  }
int compare(const _Myt &_Right) const _NOEXCEPT
Definition: xstring:2134
#define _DEBUG_POINTER(first)
Definition: xutility:465
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
2170  { // compare [_Off, _Off + _N0) with [_Ptr, _Ptr + _Count)
2171  #if _ITERATOR_DEBUG_LEVEL == 2
2172  if (_Count != 0)
2173  _DEBUG_POINTER(_Ptr);
2174  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
2175 
2176  if (this->_Mysize < _Off)
2177  _Xran(); // _Off off end
2178  if (this->_Mysize - _Off < _N0)
2179  _N0 = this->_Mysize - _Off; // trim _N0 to size
2180 
2181  size_type _Ans = _Traits::compare(this->_Myptr() + _Off, _Ptr,
2182  _N0 < _Count ? _N0 : _Count);
2183  return (_Ans != 0 ? (int)_Ans : _N0 < _Count ? -1
2184  : _N0 == _Count ? 0 : +1);
2185  }
#define _DEBUG_POINTER(first)
Definition: xutility:465
_Diff _Count
Definition: algorithm:1941
_Mybase::size_type size_type
Definition: xstring:706
template<class _Elem, class _Traits, class _Alloc>
_SCL_INSECURE_DEPRECATE size_type basic_string< _Elem, _Traits, _Alloc >::copy ( _Elem *  _Ptr,
size_type  _Count,
size_type  _Off = 0 
) const
inline
1800  { // copy [_Off, _Off + _Count) to [_Ptr, _Ptr + _Count)
1801  #if _ITERATOR_DEBUG_LEVEL == 2
1802  if (_Count != 0)
1803  _DEBUG_POINTER(_Ptr);
1804  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1805 
1806  if (this->_Mysize < _Off)
1807  _Xran(); // _Off off end
1808  if (this->_Mysize - _Off < _Count)
1809  _Count = this->_Mysize - _Off;
1810  _Traits::copy(_Ptr, this->_Myptr() + _Off, _Count);
1811  return (_Count);
1812  }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2072
#define _DEBUG_POINTER(first)
Definition: xutility:465
_Diff _Count
Definition: algorithm:1941
template<class _Elem, class _Traits, class _Alloc>
const_reverse_iterator basic_string< _Elem, _Traits, _Alloc >::crbegin ( ) const
inline
1649  { // return iterator for beginning of reversed nonmutable sequence
1650  return (((const _Myt *)this)->rbegin());
1651  }
reverse_iterator rbegin() _NOEXCEPT
Definition: xstring:1618
basic_string< _Elem, _Traits, _Alloc > _Myt
Definition: xstring:697
template<class _Elem, class _Traits, class _Alloc>
const_reverse_iterator basic_string< _Elem, _Traits, _Alloc >::crend ( ) const
inline
1654  { // return iterator for end of reversed nonmutable sequence
1655  return (((const _Myt *)this)->rend());
1656  }
basic_string< _Elem, _Traits, _Alloc > _Myt
Definition: xstring:697
reverse_iterator rend() _NOEXCEPT
Definition: xstring:1628
template<class _Elem, class _Traits, class _Alloc>
const _Elem* basic_string< _Elem, _Traits, _Alloc >::data ( ) const
inline
1743  { // return pointer to nonmutable array
1744  return (c_str());
1745  }
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1737
template<class _Elem, class _Traits, class _Alloc>
bool basic_string< _Elem, _Traits, _Alloc >::empty ( ) const
inline
1792  { // test if sequence is empty
1793  return (this->_Mysize == 0);
1794  }
template<class _Elem, class _Traits, class _Alloc>
iterator basic_string< _Elem, _Traits, _Alloc >::end ( )
inline
1609  { // return iterator for end of mutable sequence
1610  return (_STRING_ITERATOR(this->_Myptr() + this->_Mysize));
1611  }
#define _STRING_ITERATOR(ptr)
Definition: xstring:25
template<class _Elem, class _Traits, class _Alloc>
const_iterator basic_string< _Elem, _Traits, _Alloc >::end ( ) const
inline
1614  { // return iterator for end of nonmutable sequence
1615  return (_STRING_CONST_ITERATOR(this->_Myptr() + this->_Mysize));
1616  }
#define _STRING_CONST_ITERATOR(ptr)
Definition: xstring:24
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::erase ( size_type  _Off = 0)
inline
1334  { // erase elements [_Off, ...)
1335  if (this->_Mysize < _Off)
1336  _Xran(); // _Off off end
1337  _Eos(_Off);
1338  return (*this);
1339  }
void _Eos(size_type _Newsize)
Definition: xstring:2235
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::erase ( size_type  _Off,
size_type  _Count 
)
inline
1342  { // erase elements [_Off, _Off + _Count)
1343  if (this->_Mysize < _Off)
1344  _Xran(); // _Off off end
1345  if (this->_Mysize - _Off <= _Count)
1346  _Eos(_Off); // erase elements [_Off, ...)
1347  else if (0 < _Count)
1348  { // move elements down
1349  value_type *_Ptr = this->_Myptr() + _Off;
1350  size_type _Newsize = this->_Mysize - _Count;
1351  _Traits::move(_Ptr, _Ptr + _Count, _Newsize - _Off);
1352  _Eos(_Newsize);
1353  }
1354  return (*this);
1355  }
void _Eos(size_type _Newsize)
Definition: xstring:2235
_Mybase::value_type value_type
Definition: xstring:705
_OutIt move(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2447
_Diff _Count
Definition: algorithm:1941
_Mybase::size_type size_type
Definition: xstring:706
template<class _Elem, class _Traits, class _Alloc>
iterator basic_string< _Elem, _Traits, _Alloc >::erase ( const_iterator  _Where)
inline
1358  { // erase element at _Where
1359  size_type _Count = _Pdif(_Where, begin());
1360  erase(_Count, 1);
1361  return (_STRING_ITERATOR(this->_Myptr() + _Count));
1362  }
#define _STRING_ITERATOR(ptr)
Definition: xstring:25
_Myt & erase(size_type _Off=0)
Definition: xstring:1333
iterator begin() _NOEXCEPT
Definition: xstring:1598
_Diff _Count
Definition: algorithm:1941
_Mybase::size_type size_type
Definition: xstring:706
static size_type _Pdif(const_iterator _P2, const_iterator _P1)
Definition: xstring:2264
template<class _Elem, class _Traits, class _Alloc>
iterator basic_string< _Elem, _Traits, _Alloc >::erase ( const_iterator  _First,
const_iterator  _Last 
)
inline
1365  { // erase substring [_First, _Last)
1366  _DEBUG_RANGE(_First, _Last);
1367  size_type _Count = _Pdif(_First, begin());
1368  erase(_Count, _Pdif(_Last, _First));
1369  return (_STRING_ITERATOR(this->_Myptr() + _Count));
1370  }
#define _DEBUG_RANGE(first, last)
Definition: xutility:467
#define _STRING_ITERATOR(ptr)
Definition: xstring:25
_Myt & erase(size_type _Off=0)
Definition: xstring:1333
iterator begin() _NOEXCEPT
Definition: xstring:1598
_Diff _Count
Definition: algorithm:1941
_Mybase::size_type size_type
Definition: xstring:706
_FwdIt _Last
Definition: algorithm:1936
static size_type _Pdif(const_iterator _P2, const_iterator _P1)
Definition: xstring:2264
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::find ( const _Myt _Right,
size_type  _Off = 0 
) const
inline
1887  { // look for _Right beginning at or after _Off
1888  return (find(_Right._Myptr(), _Off, _Right.size()));
1889  }
size_type find(const _Myt &_Right, size_type _Off=0) const _NOEXCEPT
Definition: xstring:1886
const _Ty & _Right
Definition: algorithm:4087
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
1893  { // look for [_Ptr, _Ptr + _Count) beginning at or after _Off
1894  #if _ITERATOR_DEBUG_LEVEL == 2
1895  if (_Count != 0)
1896  _DEBUG_POINTER(_Ptr);
1897  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1898 
1899  if (_Count == 0 && _Off <= this->_Mysize)
1900  return (_Off); // null string always matches (if inside string)
1901 
1902  size_type _Nm;
1903  if (_Off < this->_Mysize && _Count <= (_Nm = this->_Mysize - _Off))
1904  { // room for match, look for it
1905  const _Elem *_Uptr, *_Vptr;
1906  for (_Nm -= _Count - 1, _Vptr = this->_Myptr() + _Off;
1907  (_Uptr = _Traits::find(_Vptr, _Nm, *_Ptr)) != 0;
1908  _Nm -= _Uptr - _Vptr + 1, _Vptr = _Uptr + 1)
1909  if (_Traits::compare(_Uptr, _Ptr, _Count) == 0)
1910  return (_Uptr - this->_Myptr()); // found a match
1911  }
1912 
1913  return (npos); // no match
1914  }
static _PGLOBAL const size_type npos
Definition: xstring:994
#define _DEBUG_POINTER(first)
Definition: xutility:465
_Diff _Count
Definition: algorithm:1941
_Mybase::size_type size_type
Definition: xstring:706
_InIt find(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3050
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::find ( const _Elem *  _Ptr,
size_type  _Off = 0 
) const
inline
1917  { // look for [_Ptr, <null>) beginning at or after _Off
1918  _DEBUG_POINTER(_Ptr);
1919  return (find(_Ptr, _Off, _Traits::length(_Ptr)));
1920  }
size_type find(const _Myt &_Right, size_type _Off=0) const _NOEXCEPT
Definition: xstring:1886
#define _DEBUG_POINTER(first)
Definition: xutility:465
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::find ( _Elem  _Ch,
size_type  _Off = 0 
) const
inline
1923  { // look for _Ch at or after _Off
1924  return (find((const _Elem *)&_Ch, _Off, 1));
1925  }
size_type find(const _Myt &_Right, size_type _Off=0) const _NOEXCEPT
Definition: xstring:1886
_In_ size_t _In_ unsigned int _Ch
Definition: mbstring.h:161
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
2052  { // look for none of _Right at or after _Off
2053  return (find_first_not_of(_Right._Myptr(), _Off,
2054  _Right.size()));
2055  }
size_type find_first_not_of(const _Myt &_Right, size_type _Off=0) const _NOEXCEPT
Definition: xstring:2050
const _Ty & _Right
Definition: algorithm:4087
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
2059  { // look for none of [_Ptr, _Ptr + _Count) at or after _Off
2060  #if _ITERATOR_DEBUG_LEVEL == 2
2061  if (_Count != 0)
2062  _DEBUG_POINTER(_Ptr);
2063  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
2064 
2065  if (_Off < this->_Mysize)
2066  { // room for match, look for it
2067  const _Elem *const _Vptr = this->_Myptr() + this->_Mysize;
2068  for (const _Elem *_Uptr = this->_Myptr() + _Off;
2069  _Uptr < _Vptr; ++_Uptr)
2070  if (_Traits::find(_Ptr, _Count, *_Uptr) == 0)
2071  return (_Uptr - this->_Myptr());
2072  }
2073  return (npos);
2074  }
static _PGLOBAL const size_type npos
Definition: xstring:994
#define _DEBUG_POINTER(first)
Definition: xutility:465
_Diff _Count
Definition: algorithm:1941
_InIt find(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3050
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
2078  { // look for one of [_Ptr, <null>) at or after _Off
2079  _DEBUG_POINTER(_Ptr);
2080  return (find_first_not_of(_Ptr, _Off, _Traits::length(_Ptr)));
2081  }
size_type find_first_not_of(const _Myt &_Right, size_type _Off=0) const _NOEXCEPT
Definition: xstring:2050
#define _DEBUG_POINTER(first)
Definition: xutility:465
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
2085  { // look for non _Ch at or after _Off
2086  return (find_first_not_of((const _Elem *)&_Ch, _Off, 1));
2087  }
size_type find_first_not_of(const _Myt &_Right, size_type _Off=0) const _NOEXCEPT
Definition: xstring:2050
_In_ size_t _In_ unsigned int _Ch
Definition: mbstring.h:161
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
1972  { // look for one of _Right at or after _Off
1973  return (find_first_of(_Right._Myptr(), _Off, _Right.size()));
1974  }
size_type find_first_of(const _Myt &_Right, size_type _Off=0) const _NOEXCEPT
Definition: xstring:1970
const _Ty & _Right
Definition: algorithm:4087
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
1978  { // look for one of [_Ptr, _Ptr + _Count) at or after _Off
1979  #if _ITERATOR_DEBUG_LEVEL == 2
1980  if (_Count != 0)
1981  _DEBUG_POINTER(_Ptr);
1982  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1983 
1984  if (0 < _Count && _Off < this->_Mysize)
1985  { // room for match, look for it
1986  const _Elem *const _Vptr = this->_Myptr() + this->_Mysize;
1987  for (const _Elem *_Uptr = this->_Myptr() + _Off;
1988  _Uptr < _Vptr; ++_Uptr)
1989  if (_Traits::find(_Ptr, _Count, *_Uptr) != 0)
1990  return (_Uptr - this->_Myptr()); // found a match
1991  }
1992 
1993  return (npos); // no match
1994  }
static _PGLOBAL const size_type npos
Definition: xstring:994
#define _DEBUG_POINTER(first)
Definition: xutility:465
_Diff _Count
Definition: algorithm:1941
_InIt find(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3050
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
1998  { // look for one of [_Ptr, <null>) at or after _Off
1999  _DEBUG_POINTER(_Ptr);
2000  return (find_first_of(_Ptr, _Off, _Traits::length(_Ptr)));
2001  }
size_type find_first_of(const _Myt &_Right, size_type _Off=0) const _NOEXCEPT
Definition: xstring:1970
#define _DEBUG_POINTER(first)
Definition: xutility:465
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
2005  { // look for _Ch at or after _Off
2006  return (find((const _Elem *)&_Ch, _Off, 1));
2007  }
size_type find(const _Myt &_Right, size_type _Off=0) const _NOEXCEPT
Definition: xstring:1886
_In_ size_t _In_ unsigned int _Ch
Definition: mbstring.h:161
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
2091  { // look for none of _Right before _Off
2092  return (find_last_not_of(_Right._Myptr(), _Off, _Right.size()));
2093  }
size_type find_last_not_of(const _Myt &_Right, size_type _Off=npos) const _NOEXCEPT
Definition: xstring:2089
const _Ty & _Right
Definition: algorithm:4087
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
2097  { // look for none of [_Ptr, _Ptr + _Count) before _Off
2098  #if _ITERATOR_DEBUG_LEVEL == 2
2099  if (_Count != 0)
2100  _DEBUG_POINTER(_Ptr);
2101  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
2102 
2103  if (0 < this->_Mysize)
2104  { // worth searching, do it
2105  const _Elem *_Uptr = this->_Myptr()
2106  + (_Off < this->_Mysize ? _Off : this->_Mysize - 1);
2107  for (; ; --_Uptr)
2108  if (_Traits::find(_Ptr, _Count, *_Uptr) == 0)
2109  return (_Uptr - this->_Myptr());
2110  else if (_Uptr == this->_Myptr())
2111  break;
2112  }
2113  return (npos);
2114  }
static _PGLOBAL const size_type npos
Definition: xstring:994
#define _DEBUG_POINTER(first)
Definition: xutility:465
_Diff _Count
Definition: algorithm:1941
_InIt find(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3050
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
2118  { // look for none of [_Ptr, <null>) before _Off
2119  _DEBUG_POINTER(_Ptr);
2120  return (find_last_not_of(_Ptr, _Off, _Traits::length(_Ptr)));
2121  }
size_type find_last_not_of(const _Myt &_Right, size_type _Off=npos) const _NOEXCEPT
Definition: xstring:2089
#define _DEBUG_POINTER(first)
Definition: xutility:465
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
2125  { // look for non _Ch before _Off
2126  return (find_last_not_of((const _Elem *)&_Ch, _Off, 1));
2127  }
size_type find_last_not_of(const _Myt &_Right, size_type _Off=npos) const _NOEXCEPT
Definition: xstring:2089
_In_ size_t _In_ unsigned int _Ch
Definition: mbstring.h:161
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
2011  { // look for one of _Right before _Off
2012  return (find_last_of(_Right._Myptr(), _Off, _Right.size()));
2013  }
size_type find_last_of(const _Myt &_Right, size_type _Off=npos) const _NOEXCEPT
Definition: xstring:2009
const _Ty & _Right
Definition: algorithm:4087
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
2017  { // look for one of [_Ptr, _Ptr + _Count) before _Off
2018  #if _ITERATOR_DEBUG_LEVEL == 2
2019  if (_Count != 0)
2020  _DEBUG_POINTER(_Ptr);
2021  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
2022 
2023  if (0 < _Count && 0 < this->_Mysize)
2024  { // worth searching, do it
2025  const _Elem *_Uptr = this->_Myptr()
2026  + (_Off < this->_Mysize ? _Off : this->_Mysize - 1);
2027  for (; ; --_Uptr)
2028  if (_Traits::find(_Ptr, _Count, *_Uptr) != 0)
2029  return (_Uptr - this->_Myptr()); // found a match
2030  else if (_Uptr == this->_Myptr())
2031  break; // at beginning, no more chance for match
2032  }
2033 
2034  return (npos); // no match
2035  }
static _PGLOBAL const size_type npos
Definition: xstring:994
#define _DEBUG_POINTER(first)
Definition: xutility:465
_Diff _Count
Definition: algorithm:1941
_InIt find(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3050
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
2039  { // look for one of [_Ptr, <null>) before _Off
2040  _DEBUG_POINTER(_Ptr);
2041  return (find_last_of(_Ptr, _Off, _Traits::length(_Ptr)));
2042  }
size_type find_last_of(const _Myt &_Right, size_type _Off=npos) const _NOEXCEPT
Definition: xstring:2009
#define _DEBUG_POINTER(first)
Definition: xutility:465
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
2046  { // look for _Ch before _Off
2047  return (rfind((const _Elem *)&_Ch, _Off, 1));
2048  }
size_type rfind(const _Myt &_Right, size_type _Off=npos) const _NOEXCEPT
Definition: xstring:1927
_In_ size_t _In_ unsigned int _Ch
Definition: mbstring.h:161
template<class _Elem, class _Traits, class _Alloc>
reference basic_string< _Elem, _Traits, _Alloc >::front ( )
inline
1718  { // return first element of mutable sequence
1719  return (*begin());
1720  }
iterator begin() _NOEXCEPT
Definition: xstring:1598
template<class _Elem, class _Traits, class _Alloc>
const_reference basic_string< _Elem, _Traits, _Alloc >::front ( ) const
inline
1723  { // return first element of nonmutable sequence
1724  return (*begin());
1725  }
iterator begin() _NOEXCEPT
Definition: xstring:1598
template<class _Elem, class _Traits, class _Alloc>
allocator_type basic_string< _Elem, _Traits, _Alloc >::get_allocator ( ) const
inline
2188  { // return allocator object for values
2189  return (this->_Getal());
2190  }
template<class _Elem, class _Traits, class _Alloc>
iterator basic_string< _Elem, _Traits, _Alloc >::insert ( const_iterator  _Where,
_XSTD initializer_list< _Elem >  _Ilist 
)
inline
979  { // insert initializer_list
980  return (insert(_Where, _Ilist.begin(), _Ilist.end()));
981  }
iterator insert(const_iterator _Where, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:977
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::insert ( size_type  _Off,
const _Myt _Right 
)
inline
1204  { // insert _Right at _Off
1205  return (insert(_Off, _Right, 0, npos));
1206  }
static _PGLOBAL const size_type npos
Definition: xstring:994
iterator insert(const_iterator _Where, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:977
const _Ty & _Right
Definition: algorithm:4087
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 
)
inline
1210  { // insert _Right [_Roff, _Roff + _Count) at _Off
1211  if (this->_Mysize < _Off || _Right.size() < _Roff)
1212  _Xran(); // _Off or _Roff off end
1213  size_type _Num = _Right.size() - _Roff;
1214  if (_Num < _Count)
1215  _Count = _Num; // trim _Count to size
1216  if (npos - this->_Mysize <= _Count)
1217  _Xlen(); // result too long
1218 
1219  if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
1220  { // make room and insert new stuff
1221  _Traits::move(this->_Myptr() + _Off + _Count,
1222  this->_Myptr() + _Off,
1223  this->_Mysize - _Off); // empty out hole
1224  if (this == &_Right)
1225  _Traits::move(this->_Myptr() + _Off,
1226  this->_Myptr() + (_Off < _Roff ? _Roff + _Count : _Roff),
1227  _Count); // substring
1228  else
1229  _Traits::copy(this->_Myptr() + _Off,
1230  _Right._Myptr() + _Roff, _Count); // fill hole
1231  _Eos(_Num);
1232  }
1233  return (*this);
1234  }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2072
void _Eos(size_type _Newsize)
Definition: xstring:2235
static _PGLOBAL const size_type npos
Definition: xstring:994
_OutIt move(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2447
_Diff _Count
Definition: algorithm:1941
_Mybase::size_type size_type
Definition: xstring:706
bool _Grow(size_type _Newsize, bool _Trim=false)
Definition: xstring:2240
const _Ty & _Right
Definition: algorithm:4087
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::insert ( size_type  _Off,
const _Elem *  _Ptr,
size_type  _Count 
)
inline
1238  { // insert [_Ptr, _Ptr + _Count) at _Off
1239  #if _ITERATOR_DEBUG_LEVEL == 2
1240  if (_Count != 0)
1241  _DEBUG_POINTER(_Ptr);
1242  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1243 
1244  if (_Inside(_Ptr))
1245  return (insert(_Off, *this,
1246  _Ptr - this->_Myptr(), _Count)); // substring
1247  if (this->_Mysize < _Off)
1248  _Xran(); // _Off off end
1249  if (npos - this->_Mysize <= _Count)
1250  _Xlen(); // result too long
1251  size_type _Num;
1252  if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
1253  { // make room and insert new stuff
1254  _Traits::move(this->_Myptr() + _Off + _Count,
1255  this->_Myptr() + _Off,
1256  this->_Mysize - _Off); // empty out hole
1257  _Traits::copy(this->_Myptr() + _Off, _Ptr, _Count); // fill hole
1258  _Eos(_Num);
1259  }
1260  return (*this);
1261  }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2072
void _Eos(size_type _Newsize)
Definition: xstring:2235
static _PGLOBAL const size_type npos
Definition: xstring:994
_OutIt move(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2447
iterator insert(const_iterator _Where, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:977
#define _DEBUG_POINTER(first)
Definition: xutility:465
bool _Inside(const _Elem *_Ptr)
Definition: xstring:2255
_Diff _Count
Definition: algorithm:1941
_Mybase::size_type size_type
Definition: xstring:706
bool _Grow(size_type _Newsize, bool _Trim=false)
Definition: xstring:2240
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::insert ( size_type  _Off,
const _Elem *  _Ptr 
)
inline
1264  { // insert [_Ptr, <null>) at _Off
1265  _DEBUG_POINTER(_Ptr);
1266  return (insert(_Off, _Ptr, _Traits::length(_Ptr)));
1267  }
iterator insert(const_iterator _Where, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:977
#define _DEBUG_POINTER(first)
Definition: xutility:465
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::insert ( size_type  _Off,
size_type  _Count,
_Elem  _Ch 
)
inline
1271  { // insert _Count * _Ch at _Off
1272  if (this->_Mysize < _Off)
1273  _Xran(); // _Off off end
1274  if (npos - this->_Mysize <= _Count)
1275  _Xlen(); // result too long
1276  size_type _Num;
1277  if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
1278  { // make room and insert new stuff
1279  _Traits::move(this->_Myptr() + _Off + _Count,
1280  this->_Myptr() + _Off,
1281  this->_Mysize - _Off); // empty out hole
1282  _Chassign(_Off, _Count, _Ch); // fill hole
1283  _Eos(_Num);
1284  }
1285  return (*this);
1286  }
void _Eos(size_type _Newsize)
Definition: xstring:2235
static _PGLOBAL const size_type npos
Definition: xstring:994
_OutIt move(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2447
void _Chassign(size_type _Off, size_type _Count, _Elem _Ch)
Definition: xstring:2192
_In_ size_t _In_ unsigned int _Ch
Definition: mbstring.h:161
_Diff _Count
Definition: algorithm:1941
_Mybase::size_type size_type
Definition: xstring:706
bool _Grow(size_type _Newsize, bool _Trim=false)
Definition: xstring:2240
template<class _Elem, class _Traits, class _Alloc>
iterator basic_string< _Elem, _Traits, _Alloc >::insert ( const_iterator  _Where)
inline
1289  { // insert <null> at _Where
1290  return (insert(_Where, _Elem()));
1291  }
iterator insert(const_iterator _Where, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:977
template<class _Elem, class _Traits, class _Alloc>
iterator basic_string< _Elem, _Traits, _Alloc >::insert ( const_iterator  _Where,
_Elem  _Ch 
)
inline
1294  { // insert _Ch at _Where
1295  size_type _Off = _Pdif(_Where, begin());
1296  insert(_Off, 1, _Ch);
1297  return (begin() + _Off);
1298  }
iterator insert(const_iterator _Where, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:977
_In_ size_t _In_ unsigned int _Ch
Definition: mbstring.h:161
iterator begin() _NOEXCEPT
Definition: xstring:1598
_Mybase::size_type size_type
Definition: xstring:706
static size_type _Pdif(const_iterator _P2, const_iterator _P1)
Definition: xstring:2264
template<class _Elem, class _Traits, class _Alloc>
iterator basic_string< _Elem, _Traits, _Alloc >::insert ( const_iterator  _Where,
size_type  _Count,
_Elem  _Ch 
)
inline
1301  { // insert _Count * _Elem at _Where
1302  size_type _Off = _Pdif(_Where, begin());
1303  insert(_Off, _Count, _Ch);
1304  return (begin() + _Off);
1305  }
iterator insert(const_iterator _Where, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:977
_In_ size_t _In_ unsigned int _Ch
Definition: mbstring.h:161
iterator begin() _NOEXCEPT
Definition: xstring:1598
_Diff _Count
Definition: algorithm:1941
_Mybase::size_type size_type
Definition: xstring:706
static size_type _Pdif(const_iterator _P2, const_iterator _P1)
Definition: xstring:2264
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
1311  { // insert [_First, _Last) at _Where, input iterators
1312  size_type _Off = _Pdif(_Where, begin());
1313  replace(_Where, _Where, _First, _Last);
1314  return (begin() + _Off);
1315  }
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:983
iterator begin() _NOEXCEPT
Definition: xstring:1598
_Mybase::size_type size_type
Definition: xstring:706
_FwdIt _Last
Definition: algorithm:1936
static size_type _Pdif(const_iterator _P2, const_iterator _P1)
Definition: xstring:2264
template<class _Elem, class _Traits, class _Alloc>
iterator basic_string< _Elem, _Traits, _Alloc >::insert ( const_iterator  _Where,
const_pointer  _First,
const_pointer  _Last 
)
inline
1319  { // insert [_First, _Last) at _Where, const pointers
1320  size_type _Off = _Pdif(_Where, begin());
1321  replace(_Where, _Where, _First, _Last);
1322  return (begin() + _Off);
1323  }
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:983
iterator begin() _NOEXCEPT
Definition: xstring:1598
_Mybase::size_type size_type
Definition: xstring:706
_FwdIt _Last
Definition: algorithm:1936
static size_type _Pdif(const_iterator _P2, const_iterator _P1)
Definition: xstring:2264
template<class _Elem, class _Traits, class _Alloc>
iterator basic_string< _Elem, _Traits, _Alloc >::insert ( const_iterator  _Where,
const_iterator  _First,
const_iterator  _Last 
)
inline
1327  { // insert [_First, _Last) at _Where, const_iterators
1328  size_type _Off = _Pdif(_Where, begin());
1329  replace(_Where, _Where, _First, _Last);
1330  return (begin() + _Off);
1331  }
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:983
iterator begin() _NOEXCEPT
Definition: xstring:1598
_Mybase::size_type size_type
Definition: xstring:706
_FwdIt _Last
Definition: algorithm:1936
static size_type _Pdif(const_iterator _P2, const_iterator _P1)
Definition: xstring:2264
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::length ( ) const
inline
1748  { // return length of sequence
1749  return (this->_Mysize);
1750  }
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::max_size ( ) const
inline
1758  { // return maximum possible length of sequence
1759  size_type _Num = this->_Getal().max_size();
1760  return (_Num <= 1 ? 1 : _Num - 1);
1761  }
_Mybase::size_type size_type
Definition: xstring:706
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::operator+= ( _XSTD initializer_list< _Elem >  _Ilist)
inline
963  { // append initializer_list
964  return (append(_Ilist.begin(), _Ilist.end()));
965  }
_Myt & append(_XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:972
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::operator+= ( const _Myt _Right)
inline
1023  { // append _Right
1024  return (append(_Right));
1025  }
_Myt & append(_XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:972
const _Ty & _Right
Definition: algorithm:4087
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::operator+= ( const _Elem *  _Ptr)
inline
1028  { // append [_Ptr, <null>)
1029  return (append(_Ptr));
1030  }
_Myt & append(_XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:972
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::operator+= ( _Elem  _Ch)
inline
1033  { // append 1 * _Ch
1034  return (append((size_type)1, _Ch));
1035  }
_In_ size_t _In_ unsigned int _Ch
Definition: mbstring.h:161
_Mybase::size_type size_type
Definition: xstring:706
_Myt & append(_XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:972
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::operator= ( _Myt &&  _Right)
inline
902  { // assign by moving _Right
903  if (this != &_Right)
904  { // different, assign it
905  _Tidy(true);
906 
907  if (_Alty::propagate_on_container_move_assignment::value
908  && this->_Getal() != _Right._Getal())
909  this->_Change_alloc(_Right._Getal());
910 
911  if (this->_Getal() != _Right._Getal())
912  assign(_Right.begin(), _Right.end());
913  else
914  _Assign_rv(_STD forward<_Myt>(_Right));
915  }
916  return (*this);
917  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2270
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:919
void _Assign_rv(_Myt &&_Right)
Definition: xstring:934
const _Ty & _Right
Definition: algorithm:4087
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::operator= ( _XSTD initializer_list< _Elem >  _Ilist)
inline
958  { // assign initializer_list
959  return (assign(_Ilist.begin(), _Ilist.end()));
960  }
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:919
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::operator= ( const _Myt _Right)
inline
997  { // assign _Right
998  if (this != &_Right)
999  { // different, assign it
1000  if (this->_Getal() != _Right._Getal()
1001  && _Alty::propagate_on_container_copy_assignment::value)
1002  { // change allocator before copying
1003  _Tidy(true);
1004  this->_Change_alloc(_Right._Getal());
1005  }
1006 
1007  assign(_Right);
1008  }
1009  return (*this);
1010  }
void _Tidy(bool _Built=false, size_type _Newsize=0)
Definition: xstring:2270
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:919
const _Ty & _Right
Definition: algorithm:4087
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::operator= ( const _Elem *  _Ptr)
inline
1013  { // assign [_Ptr, <null>)
1014  return (assign(_Ptr));
1015  }
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:919
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::operator= ( _Elem  _Ch)
inline
1018  { // assign 1 * _Ch
1019  return (assign(1, _Ch));
1020  }
_In_ size_t _In_ unsigned int _Ch
Definition: mbstring.h:161
_Myt & assign(_Myt &&_Right) _NOEXCEPT
Definition: xstring:919
template<class _Elem, class _Traits, class _Alloc>
reference basic_string< _Elem, _Traits, _Alloc >::operator[] ( size_type  _Off)
inline
1682  { // subscript mutable sequence
1683  #if _ITERATOR_DEBUG_LEVEL == 2
1684  if (this->_Mysize < _Off) // sic
1685  _DEBUG_ERROR("string subscript out of range");
1686 
1687  #elif _ITERATOR_DEBUG_LEVEL == 1
1688  _SCL_SECURE_VALIDATE_RANGE(_Off <= this->_Mysize); // sic
1689  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1690 
1691  return (this->_Myptr()[_Off]);
1692  }
#define _SCL_SECURE_VALIDATE_RANGE(cond)
Definition: yvals.h:347
#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
1695  { // subscript nonmutable sequence
1696  #if _ITERATOR_DEBUG_LEVEL == 2
1697  if (this->_Mysize < _Off) // sic
1698  _DEBUG_ERROR("string subscript out of range");
1699 
1700  #elif _ITERATOR_DEBUG_LEVEL == 1
1701  _SCL_SECURE_VALIDATE_RANGE(_Off <= this->_Mysize); // sic
1702  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1703 
1704  return (this->_Myptr()[_Off]);
1705  }
#define _SCL_SECURE_VALIDATE_RANGE(cond)
Definition: yvals.h:347
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
template<class _Elem, class _Traits, class _Alloc>
void basic_string< _Elem, _Traits, _Alloc >::pop_back ( )
inline
1713  { // erase element at end
1714  erase(this->_Mysize - 1); // throws if _Mysize == 0
1715  }
_Myt & erase(size_type _Off=0)
Definition: xstring:1333
template<class _Elem, class _Traits, class _Alloc>
void basic_string< _Elem, _Traits, _Alloc >::push_back ( _Elem  _Ch)
inline
1708  { // insert element at end
1709  insert(end(), _Ch);
1710  }
iterator end() _NOEXCEPT
Definition: xstring:1608
iterator insert(const_iterator _Where, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:977
_In_ size_t _In_ unsigned int _Ch
Definition: mbstring.h:161
template<class _Elem, class _Traits, class _Alloc>
reverse_iterator basic_string< _Elem, _Traits, _Alloc >::rbegin ( )
inline
1619  { // return iterator for beginning of reversed mutable sequence
1620  return (reverse_iterator(end()));
1621  }
_STD reverse_iterator< iterator > reverse_iterator
Definition: xstring:716
iterator end() _NOEXCEPT
Definition: xstring:1608
template<class _Elem, class _Traits, class _Alloc>
const_reverse_iterator basic_string< _Elem, _Traits, _Alloc >::rbegin ( ) const
inline
1624  { // return iterator for beginning of reversed nonmutable sequence
1625  return (const_reverse_iterator(end()));
1626  }
_STD reverse_iterator< const_iterator > const_reverse_iterator
Definition: xstring:717
iterator end() _NOEXCEPT
Definition: xstring:1608
template<class _Elem, class _Traits, class _Alloc>
reverse_iterator basic_string< _Elem, _Traits, _Alloc >::rend ( )
inline
1629  { // return iterator for end of reversed mutable sequence
1630  return (reverse_iterator(begin()));
1631  }
_STD reverse_iterator< iterator > reverse_iterator
Definition: xstring:716
iterator begin() _NOEXCEPT
Definition: xstring:1598
template<class _Elem, class _Traits, class _Alloc>
const_reverse_iterator basic_string< _Elem, _Traits, _Alloc >::rend ( ) const
inline
1634  { // return iterator for end of reversed nonmutable sequence
1635  return (const_reverse_iterator(begin()));
1636  }
_STD reverse_iterator< const_iterator > const_reverse_iterator
Definition: xstring:717
iterator begin() _NOEXCEPT
Definition: xstring:1598
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
985  { // replace with initializer_list
986  return (replace(_First, _Last, _Ilist.begin(), _Ilist.end()));
987  }
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:983
_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
1378  { // replace [_Off, _Off + _N0) with _Right
1379  return (replace(_Off, _N0, _Right, 0, npos));
1380  }
static _PGLOBAL const size_type npos
Definition: xstring:994
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:983
const _Ty & _Right
Definition: algorithm:4087
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 
)
inline
1384  { // replace [_Off, _Off + _N0) with _Right [_Roff, _Roff + _Count)
1385  if (this->_Mysize < _Off || _Right.size() < _Roff)
1386  _Xran(); // _Off or _Roff off end
1387  if (this->_Mysize - _Off < _N0)
1388  _N0 = this->_Mysize - _Off; // trim _N0 to size
1389  size_type _Num = _Right.size() - _Roff;
1390  if (_Num < _Count)
1391  _Count = _Num; // trim _Count to size
1392  if (npos - _Count <= this->_Mysize - _N0)
1393  _Xlen(); // result too long
1394 
1395  size_type _Nm = this->_Mysize - _N0 - _Off; // length of kept tail
1396  size_type _Newsize = this->_Mysize + _Count - _N0;
1397  if (this->_Mysize < _Newsize)
1398  _Grow(_Newsize);
1399 
1400  if (this != &_Right)
1401  { // no overlap, just move down and copy in new stuff
1402  _Traits::move(this->_Myptr() + _Off + _Count,
1403  this->_Myptr() + _Off + _N0, _Nm); // empty hole
1404  _Traits::copy(this->_Myptr() + _Off,
1405  _Right._Myptr() + _Roff, _Count); // fill hole
1406  }
1407  else if (_Count <= _N0)
1408  { // hole doesn't get larger, just copy in substring
1409  _Traits::move(this->_Myptr() + _Off,
1410  this->_Myptr() + _Roff, _Count); // fill hole
1411  _Traits::move(this->_Myptr() + _Off + _Count,
1412  this->_Myptr() + _Off + _N0, _Nm); // move tail down
1413  }
1414  else if (_Roff <= _Off)
1415  { // hole gets larger, substring begins before hole
1416  _Traits::move(this->_Myptr() + _Off + _Count,
1417  this->_Myptr() + _Off + _N0, _Nm); // move tail down
1418  _Traits::move(this->_Myptr() + _Off,
1419  this->_Myptr() + _Roff, _Count); // fill hole
1420  }
1421  else if (_Off + _N0 <= _Roff)
1422  { // hole gets larger, substring begins after 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 - _N0),
1427  _Count); // fill hole
1428  }
1429  else
1430  { // hole gets larger, substring begins in hole
1431  _Traits::move(this->_Myptr() + _Off,
1432  this->_Myptr() + _Roff, _N0); // fill old hole
1433  _Traits::move(this->_Myptr() + _Off + _Count,
1434  this->_Myptr() + _Off + _N0, _Nm); // move tail down
1435  _Traits::move(this->_Myptr() + _Off + _N0,
1436  this->_Myptr() + _Roff + _Count,
1437  _Count - _N0); // fill rest of new hole
1438  }
1439 
1440  _Eos(_Newsize);
1441  return (*this);
1442  }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2072
void _Eos(size_type _Newsize)
Definition: xstring:2235
static _PGLOBAL const size_type npos
Definition: xstring:994
_OutIt move(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2447
_Diff _Count
Definition: algorithm:1941
_Mybase::size_type size_type
Definition: xstring:706
bool _Grow(size_type _Newsize, bool _Trim=false)
Definition: xstring:2240
const _Ty & _Right
Definition: algorithm:4087
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
1446  { // replace [_Off, _Off + _N0) with [_Ptr, _Ptr + _Count)
1447  #if _ITERATOR_DEBUG_LEVEL == 2
1448  if (_Count != 0)
1449  _DEBUG_POINTER(_Ptr);
1450  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1451 
1452  if (_Inside(_Ptr))
1453  return (replace(_Off, _N0, *this,
1454  _Ptr - this->_Myptr(),
1455  _Count)); // substring, replace carefully
1456  if (this->_Mysize < _Off)
1457  _Xran(); // _Off off end
1458  if (this->_Mysize - _Off < _N0)
1459  _N0 = this->_Mysize - _Off; // trim _N0 to size
1460  if (npos - _Count <= this->_Mysize - _N0)
1461  _Xlen(); // result too long
1462  size_type _Nm = this->_Mysize - _N0 - _Off;
1463 
1464  if (_Count < _N0)
1465  _Traits::move(this->_Myptr() + _Off + _Count,
1466  this->_Myptr() + _Off + _N0,
1467  _Nm); // smaller hole, move tail up
1468  size_type _Num;
1469  if ((0 < _Count || 0 < _N0)
1470  && _Grow(_Num = this->_Mysize + _Count - _N0))
1471  { // make room and rearrange
1472  if (_N0 < _Count)
1473  _Traits::move(this->_Myptr() + _Off + _Count,
1474  this->_Myptr() + _Off + _N0, _Nm); // move tail down
1475  _Traits::copy(this->_Myptr() + _Off, _Ptr, _Count); // fill hole
1476  _Eos(_Num);
1477  }
1478  return (*this);
1479  }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2072
void _Eos(size_type _Newsize)
Definition: xstring:2235
static _PGLOBAL const size_type npos
Definition: xstring:994
_OutIt move(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2447
#define _DEBUG_POINTER(first)
Definition: xutility:465
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:983
bool _Inside(const _Elem *_Ptr)
Definition: xstring:2255
_Diff _Count
Definition: algorithm:1941
_Mybase::size_type size_type
Definition: xstring:706
bool _Grow(size_type _Newsize, bool _Trim=false)
Definition: xstring:2240
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::replace ( size_type  _Off,
size_type  _N0,
const _Elem *  _Ptr 
)
inline
1482  { // replace [_Off, _Off + _N0) with [_Ptr, <null>)
1483  _DEBUG_POINTER(_Ptr);
1484  return (replace(_Off, _N0, _Ptr, _Traits::length(_Ptr)));
1485  }
#define _DEBUG_POINTER(first)
Definition: xutility:465
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:983
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
1489  { // replace [_Off, _Off + _N0) with _Count * _Ch
1490  if (this->_Mysize < _Off)
1491  _Xran(); // _Off off end
1492  if (this->_Mysize - _Off < _N0)
1493  _N0 = this->_Mysize - _Off; // trim _N0 to size
1494  if (npos - _Count <= this->_Mysize - _N0)
1495  _Xlen(); // result too long
1496  size_type _Nm = this->_Mysize - _N0 - _Off;
1497 
1498  if (_Count < _N0)
1499  _Traits::move(this->_Myptr() + _Off + _Count,
1500  this->_Myptr() + _Off + _N0,
1501  _Nm); // smaller hole, move tail up
1502  size_type _Num;
1503  if ((0 < _Count || 0 < _N0)
1504  && _Grow(_Num = this->_Mysize + _Count - _N0))
1505  { // make room and rearrange
1506  if (_N0 < _Count)
1507  _Traits::move(this->_Myptr() + _Off + _Count,
1508  this->_Myptr() + _Off + _N0, _Nm); // move tail down
1509  _Chassign(_Off, _Count, _Ch); // fill hole
1510  _Eos(_Num);
1511  }
1512  return (*this);
1513  }
void _Eos(size_type _Newsize)
Definition: xstring:2235
static _PGLOBAL const size_type npos
Definition: xstring:994
_OutIt move(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2447
void _Chassign(size_type _Off, size_type _Count, _Elem _Ch)
Definition: xstring:2192
_In_ size_t _In_ unsigned int _Ch
Definition: mbstring.h:161
_Diff _Count
Definition: algorithm:1941
_Mybase::size_type size_type
Definition: xstring:706
bool _Grow(size_type _Newsize, bool _Trim=false)
Definition: xstring:2240
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::replace ( const_iterator  _First,
const_iterator  _Last,
const _Myt _Right 
)
inline
1517  { // replace [_First, _Last) with _Right
1518  return (replace(
1519  _Pdif(_First, begin()), _Pdif(_Last, _First), _Right));
1520  }
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:983
iterator begin() _NOEXCEPT
Definition: xstring:1598
_FwdIt _Last
Definition: algorithm:1936
static size_type _Pdif(const_iterator _P2, const_iterator _P1)
Definition: xstring:2264
const _Ty & _Right
Definition: algorithm:4087
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
1524  { // replace [_First, _Last) with [_Ptr, _Ptr + _Count)
1525  return (replace(
1526  _Pdif(_First, begin()), _Pdif(_Last, _First), _Ptr, _Count));
1527  }
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:983
iterator begin() _NOEXCEPT
Definition: xstring:1598
_Diff _Count
Definition: algorithm:1941
_FwdIt _Last
Definition: algorithm:1936
static size_type _Pdif(const_iterator _P2, const_iterator _P1)
Definition: xstring:2264
template<class _Elem, class _Traits, class _Alloc>
_Myt& basic_string< _Elem, _Traits, _Alloc >::replace ( const_iterator  _First,
const_iterator  _Last,
const _Elem *  _Ptr 
)
inline
1531  { // replace [_First, _Last) with [_Ptr, <null>)
1532  return (replace(
1533  _Pdif(_First, begin()), _Pdif(_Last, _First), _Ptr));
1534  }
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:983
iterator begin() _NOEXCEPT
Definition: xstring:1598
_FwdIt _Last
Definition: algorithm:1936
static size_type _Pdif(const_iterator _P2, const_iterator _P1)
Definition: xstring:2264
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
1538  { // replace [_First, _Last) with _Count * _Ch
1539  return (replace(
1540  _Pdif(_First, begin()), _Pdif(_Last, _First), _Count, _Ch));
1541  }
_In_ size_t _In_ unsigned int _Ch
Definition: mbstring.h:161
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:983
iterator begin() _NOEXCEPT
Definition: xstring:1598
_Diff _Count
Definition: algorithm:1941
_FwdIt _Last
Definition: algorithm:1936
static size_type _Pdif(const_iterator _P2, const_iterator _P1)
Definition: xstring:2264
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
1548  { // replace [_First, _Last) with [_First2, _Last2), input iterators
1549  _Myt _Right(_First2, _Last2);
1550  replace(_First, _Last, _Right);
1551  return (*this);
1552  }
basic_string< _Elem, _Traits, _Alloc > _Myt
Definition: xstring:697
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:983
_FwdIt _Last
Definition: algorithm:1936
const _Ty & _Right
Definition: algorithm:4087
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
1556  { // replace [_First, _Last) with [_First2, _Last2), const pointers
1557  if (_First2 == _Last2)
1558  erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
1559  else
1560  replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
1561  &*_First2, _Last2 - _First2);
1562  return (*this);
1563  }
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:983
_Myt & erase(size_type _Off=0)
Definition: xstring:1333
iterator begin() _NOEXCEPT
Definition: xstring:1598
_FwdIt _Last
Definition: algorithm:1936
static size_type _Pdif(const_iterator _P2, const_iterator _P1)
Definition: xstring:2264
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
1567  { // replace [_First, _Last) with [_First2, _Last2), const pointers
1568  if (_First2 == _Last2)
1569  erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
1570  else
1571  replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
1572  &*_First2, _Last2 - _First2);
1573  return (*this);
1574  }
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:983
_Myt & erase(size_type _Off=0)
Definition: xstring:1333
iterator begin() _NOEXCEPT
Definition: xstring:1598
_FwdIt _Last
Definition: algorithm:1936
static size_type _Pdif(const_iterator _P2, const_iterator _P1)
Definition: xstring:2264
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
1578  { // replace [_First, _Last) with [_First2, _Last2), const_iterators
1579  if (_First2 == _Last2)
1580  erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
1581  else
1582  replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
1583  &*_First2, _Last2 - _First2);
1584  return (*this);
1585  }
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:983
_Myt & erase(size_type _Off=0)
Definition: xstring:1333
iterator begin() _NOEXCEPT
Definition: xstring:1598
_FwdIt _Last
Definition: algorithm:1936
static size_type _Pdif(const_iterator _P2, const_iterator _P1)
Definition: xstring:2264
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
1589  { // replace [_First, _Last) with [_First2, _Last2), const_iterators
1590  if (_First2 == _Last2)
1591  erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
1592  else
1593  replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
1594  &*_First2, _Last2 - _First2);
1595  return (*this);
1596  }
_Myt & replace(const_iterator _First, const_iterator _Last, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:983
_Myt & erase(size_type _Off=0)
Definition: xstring:1333
iterator begin() _NOEXCEPT
Definition: xstring:1598
_FwdIt _Last
Definition: algorithm:1936
static size_type _Pdif(const_iterator _P2, const_iterator _P1)
Definition: xstring:2264
template<class _Elem, class _Traits, class _Alloc>
void basic_string< _Elem, _Traits, _Alloc >::reserve ( size_type  _Newcap = 0)
inline
1782  { // determine new minimum length of allocated storage
1783  if (this->_Mysize <= _Newcap && this->_Myres != _Newcap)
1784  { // change reservation
1785  size_type _Size = this->_Mysize;
1786  if (_Grow(_Newcap, true))
1787  _Eos(_Size);
1788  }
1789  }
void _Eos(size_type _Newsize)
Definition: xstring:2235
_Mybase::size_type size_type
Definition: xstring:706
bool _Grow(size_type _Newsize, bool _Trim=false)
Definition: xstring:2240
_Check_return_ _In_ long _Size
Definition: io.h:325
template<class _Elem, class _Traits, class _Alloc>
void basic_string< _Elem, _Traits, _Alloc >::resize ( size_type  _Newsize)
inline
1764  { // determine new length, padding with null elements as needed
1765  resize(_Newsize, _Elem());
1766  }
void resize(size_type _Newsize)
Definition: xstring:1763
template<class _Elem, class _Traits, class _Alloc>
void basic_string< _Elem, _Traits, _Alloc >::resize ( size_type  _Newsize,
_Elem  _Ch 
)
inline
1769  { // determine new length, padding with _Ch elements as needed
1770  if (_Newsize <= this->_Mysize)
1771  _Eos(_Newsize);
1772  else
1773  append(_Newsize - this->_Mysize, _Ch);
1774  }
void _Eos(size_type _Newsize)
Definition: xstring:2235
_In_ size_t _In_ unsigned int _Ch
Definition: mbstring.h:161
_Myt & append(_XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:972
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::rfind ( const _Myt _Right,
size_type  _Off = npos 
) const
inline
1928  { // look for _Right beginning before _Off
1929  return (rfind(_Right._Myptr(), _Off, _Right.size()));
1930  }
size_type rfind(const _Myt &_Right, size_type _Off=npos) const _NOEXCEPT
Definition: xstring:1927
const _Ty & _Right
Definition: algorithm:4087
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
1934  { // look for [_Ptr, _Ptr + _Count) beginning before _Off
1935  #if _ITERATOR_DEBUG_LEVEL == 2
1936  if (_Count != 0)
1937  _DEBUG_POINTER(_Ptr);
1938  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1939 
1940  if (_Count == 0)
1941  return (_Off < this->_Mysize ? _Off
1942  : this->_Mysize); // null always matches
1943  if (_Count <= this->_Mysize)
1944  { // room for match, look for it
1945  const _Elem *_Uptr = this->_Myptr() +
1946  (_Off < this->_Mysize - _Count ? _Off
1947  : this->_Mysize - _Count);
1948  for (; ; --_Uptr)
1949  if (_Traits::eq(*_Uptr, *_Ptr)
1950  && _Traits::compare(_Uptr, _Ptr, _Count) == 0)
1951  return (_Uptr - this->_Myptr()); // found a match
1952  else if (_Uptr == this->_Myptr())
1953  break; // at beginning, no more chance for match
1954  }
1955 
1956  return (npos); // no match
1957  }
static _PGLOBAL const size_type npos
Definition: xstring:994
#define _DEBUG_POINTER(first)
Definition: xutility:465
_Diff _Count
Definition: algorithm:1941
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::rfind ( const _Elem *  _Ptr,
size_type  _Off = npos 
) const
inline
1960  { // look for [_Ptr, <null>) beginning before _Off
1961  _DEBUG_POINTER(_Ptr);
1962  return (rfind(_Ptr, _Off, _Traits::length(_Ptr)));
1963  }
size_type rfind(const _Myt &_Right, size_type _Off=npos) const _NOEXCEPT
Definition: xstring:1927
#define _DEBUG_POINTER(first)
Definition: xutility:465
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::rfind ( _Elem  _Ch,
size_type  _Off = npos 
) const
inline
1966  { // look for _Ch before _Off
1967  return (rfind((const _Elem *)&_Ch, _Off, 1));
1968  }
size_type rfind(const _Myt &_Right, size_type _Off=npos) const _NOEXCEPT
Definition: xstring:1927
_In_ size_t _In_ unsigned int _Ch
Definition: mbstring.h:161
template<class _Elem, class _Traits, class _Alloc>
void basic_string< _Elem, _Traits, _Alloc >::shrink_to_fit ( )
inline
1659  { // reduce capacity
1660  if ((size() | this->_ALLOC_MASK) < capacity())
1661  { // worth shrinking, do it
1662  _Myt _Tmp(*this);
1663  swap(_Tmp);
1664  }
1665  }
basic_string< _Elem, _Traits, _Alloc > _Myt
Definition: xstring:697
void swap(_Myt &_Right)
Definition: xstring:1856
size_type size() const _NOEXCEPT
Definition: xstring:1752
size_type capacity() const _NOEXCEPT
Definition: xstring:1776
template<class _Elem, class _Traits, class _Alloc>
size_type basic_string< _Elem, _Traits, _Alloc >::size ( ) const
inline
1753  { // return length of sequence
1754  return (this->_Mysize);
1755  }
template<class _Elem, class _Traits, class _Alloc>
_Myt basic_string< _Elem, _Traits, _Alloc >::substr ( size_type  _Off = 0,
size_type  _Count = npos 
) const
inline
2130  { // return [_Off, _Off + _Count) as new string
2131  return (_Myt(*this, _Off, _Count, get_allocator()));
2132  }
allocator_type get_allocator() const _NOEXCEPT
Definition: xstring:2187
basic_string< _Elem, _Traits, _Alloc > _Myt
Definition: xstring:697
_Diff _Count
Definition: algorithm:1941
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  ; // same object, do nothing
1860  else if (this->_Getal() == _Right._Getal())
1861  { // same allocator, swap control information
1862  this->_Swap_all(_Right);
1863  _Swap_bx(_Right);
1864  _STD swap(this->_Mysize, _Right._Mysize);
1865  _STD swap(this->_Myres, _Right._Myres);
1866  }
1867 
1868  else if (_Alty::propagate_on_container_swap::value)
1869  { // swap allocators and control information
1870  this->_Swap_alloc(_Right);
1871  _Swap_bx(_Right);
1872  _STD swap(this->_Bx, _Right._Bx); // pointer bitwise copyable?
1873  _STD swap(this->_Mysize, _Right._Mysize);
1874  _STD swap(this->_Myres, _Right._Myres);
1875  }
1876 
1877  else
1878  { // different allocator, do multiple assigns
1879  _Myt _Tmp = *this;
1880 
1881  *this = _Right;
1882  _Right = _Tmp;
1883  }
1884  }
void _Swap_bx(_Myt &_Right)
Definition: xstring:1830
basic_string< _Elem, _Traits, _Alloc > _Myt
Definition: xstring:697
void swap(_Myt &_Right)
Definition: xstring:1856
void _Swap_all(_Container_base0 &)
Definition: xutility:46
const _Ty & _Right
Definition: algorithm:4087

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: