ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

_string.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 1997-1999
00003  * Silicon Graphics Computer Systems, Inc.
00004  *
00005  * Copyright (c) 1999
00006  * Boris Fomitchev
00007  *
00008  * This material is provided "as is", with absolutely no warranty expressed
00009  * or implied. Any use is at your own risk.
00010  *
00011  * Permission to use or copy this software for any purpose is hereby granted
00012  * without fee, provided the above notices are retained on all copies.
00013  * Permission to modify the code and to distribute modified code is granted,
00014  * provided the above notices are retained, and a notice that the code was
00015  * modified is included with the above copyright notice.
00016  */
00017 
00018 #ifndef _STLP_DBG_STRING_H
00019 #define _STLP_DBG_STRING_H
00020 
00021 #ifndef _STLP_DBG_ITERATOR_H
00022 #  include <stl/debug/_iterator.h>
00023 #endif
00024 
00025 _STLP_BEGIN_NAMESPACE
00026 
00027 #define _STLP_NON_DBG_STRING_NAME _STLP_NON_DBG_NAME(str)
00028 #define _STLP_NON_DBG_STRING _STLP_PRIV _STLP_NON_DBG_STRING_NAME <_CharT, _Traits, _Alloc>
00029 
00030 #if defined (_STLP_DEBUG_USE_DISTINCT_VALUE_TYPE_HELPERS)
00031 template <class _CharT,class _Traits, class _Alloc>
00032 inline _CharT*
00033 value_type(const _STLP_PRIV _DBG_iter_base< _STLP_NON_DBG_STRING >&)
00034 { return (_CharT*)0; }
00035 template <class _CharT, class _Traits, class _Alloc>
00036 inline random_access_iterator_tag
00037 iterator_category(const _STLP_PRIV _DBG_iter_base< _STLP_NON_DBG_STRING >&)
00038 { return random_access_iterator_tag(); }
00039 #endif
00040 
00041 template <class _CharT, class _Traits, class _Alloc>
00042 class basic_string :
00043 #if !defined (__DMC__)
00044                      private
00045 #else
00046                      public
00047 #endif
00048                              _STLP_PRIV __construct_checker<_STLP_NON_DBG_STRING >
00049 #if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND) && !defined (basic_string)
00050                    , public __stlport_class<basic_string<_CharT, _Traits, _Alloc> >
00051 #endif
00052 {
00053 protected:
00054   typedef _STLP_NON_DBG_STRING _Base;
00055   typedef basic_string<_CharT, _Traits, _Alloc> _Self;
00056   typedef _STLP_PRIV __construct_checker<_STLP_NON_DBG_STRING > _ConstructCheck;
00057   typedef typename _IsPOD<_CharT>::_Type _Char_Is_POD;
00058 
00059 public:
00060   __IMPORT_CONTAINER_TYPEDEFS(_Base)
00061   typedef typename _Base::traits_type traits_type;
00062   typedef _STLP_PRIV _DBG_iter<_Base, _STLP_PRIV _DbgTraits<_Nonconst_traits<value_type> > > iterator;
00063   typedef _STLP_PRIV _DBG_iter<_Base, _STLP_PRIV _DbgTraits<_Const_traits<value_type> > > const_iterator;
00064   _STLP_DECLARE_RANDOM_ACCESS_REVERSE_ITERATORS;
00065 
00066 public:                         // Constructor, destructor, assignment.
00067   typedef typename _Base::_Reserve_t _Reserve_t;
00068 
00069 private:
00070   _Base _M_non_dbg_impl;
00071   _STLP_PRIV __owned_list _M_iter_list;
00072 
00073   void _Invalidate_all()
00074   { _M_iter_list._Invalidate_all(); }
00075   void _Compare_Capacity (size_type __old_capacity) {
00076     if (this->capacity() > __old_capacity) {
00077       _Invalidate_all();
00078     }
00079   }
00080   void _Invalidate_iterator(const iterator& __it)
00081   { _STLP_PRIV __invalidate_iterator(&_M_iter_list, __it); }
00082   void _Invalidate_iterators(const iterator& __f, const iterator& __l)
00083   { _STLP_PRIV __invalidate_range(&_M_iter_list, __f, __l); }
00084 
00085 public:
00086 #include <stl/_string_npos.h>
00087 
00088   allocator_type get_allocator() const { return _M_non_dbg_impl.get_allocator(); }
00089 
00090   explicit basic_string(const allocator_type& __a = allocator_type())
00091     : _M_non_dbg_impl(__a), _M_iter_list(&_M_non_dbg_impl) {}
00092 
00093   basic_string(_Reserve_t __r, size_t __n,
00094                const allocator_type& __a = allocator_type())
00095     : _M_non_dbg_impl(__r, __n, __a), _M_iter_list(&_M_non_dbg_impl) {}
00096 
00097   basic_string(const _Self& __s)
00098     : _ConstructCheck(__s),
00099       _M_non_dbg_impl(__s._M_non_dbg_impl), _M_iter_list(&_M_non_dbg_impl) {}
00100 
00101   basic_string(const _Self& __s, size_type __pos, size_type __n = npos,
00102                const allocator_type& __a = allocator_type())
00103     : _M_non_dbg_impl(__s._M_non_dbg_impl, __pos, __n, __a),
00104       _M_iter_list(&_M_non_dbg_impl) {}
00105 
00106   basic_string(const _CharT* __s, size_type __n,
00107                const allocator_type& __a = allocator_type())
00108     : _ConstructCheck(__s), _M_non_dbg_impl(__s, __n, __a),
00109       _M_iter_list(&_M_non_dbg_impl) {}
00110 
00111   basic_string(const _CharT* __s,
00112                const allocator_type& __a = allocator_type())
00113     : _ConstructCheck(__s),
00114       _M_non_dbg_impl(__s, __a), _M_iter_list(&_M_non_dbg_impl) {}
00115 
00116   basic_string(size_type __n, _CharT __c,
00117                const allocator_type& __a = allocator_type())
00118     : _M_non_dbg_impl(__n, __c, __a), _M_iter_list(&_M_non_dbg_impl) {}
00119 
00120 #if !defined (_STLP_NO_MOVE_SEMANTIC)
00121   basic_string(__move_source<_Self> src)
00122     : _M_non_dbg_impl(__move_source<_Base >(src.get()._M_non_dbg_impl)),
00123       _M_iter_list(&_M_non_dbg_impl) {
00124 #  if defined (_STLP_NO_EXTENSIONS) || (_STLP_DEBUG_LEVEL == _STLP_STANDARD_DBG_LEVEL)
00125     src.get()._M_iter_list._Invalidate_all();
00126 #  else
00127     src.get()._M_iter_list._Set_owner(_M_iter_list);
00128 #  endif
00129   }
00130 #endif
00131 
00132 #if !defined (_STLP_MEMBER_TEMPLATES)
00133   basic_string(const _CharT* __f, const _CharT* __l,
00134                const allocator_type& __a = allocator_type())
00135     : _ConstructCheck(__f, __l),
00136       _M_non_dbg_impl(__f, __l, __a), _M_iter_list(&_M_non_dbg_impl) {
00137   }
00138   basic_string(const_iterator __f, const_iterator __l,
00139                const allocator_type & __a = allocator_type())
00140     : _ConstructCheck(__f, __l),
00141       _M_non_dbg_impl(__f._M_iterator, __l._M_iterator, __a), _M_iter_list(&_M_non_dbg_impl) {
00142   }
00143 #else
00144   template <class _InputIterator>
00145   basic_string(_InputIterator __f, _InputIterator __l,
00146                const allocator_type & __a _STLP_ALLOCATOR_TYPE_DFL)
00147     : _ConstructCheck(__f, __l),
00148       _M_non_dbg_impl(_STLP_PRIV _Non_Dbg_iter(__f), _STLP_PRIV _Non_Dbg_iter(__l), __a),
00149       _M_iter_list(&_M_non_dbg_impl) {}
00150 #  if defined (_STLP_NEEDS_EXTRA_TEMPLATE_CONSTRUCTORS)
00151   template <class _InputIterator>
00152   basic_string(_InputIterator __f, _InputIterator __l)
00153     : _ConstructCheck(__f, __l),
00154       _M_non_dbg_impl(_STLP_PRIV _Non_Dbg_iter(__f), _STLP_PRIV _Non_Dbg_iter(__l)),
00155       _M_iter_list(&_M_non_dbg_impl) {}
00156 #  endif
00157 #endif
00158 
00159 private:
00160   // constructor from non-debug version for substr
00161   basic_string (const _Base& __x)
00162     : _M_non_dbg_impl(__x), _M_iter_list(&_M_non_dbg_impl) {}
00163 
00164 public:
00165   _Self& operator=(const _Self& __s) {
00166     if (this != &__s) {
00167       assign(__s);
00168     }
00169     return *this;
00170   }
00171 
00172   _Self& operator=(const _CharT* __s) {
00173     _STLP_FIX_LITERAL_BUG(__s)
00174     _STLP_VERBOSE_ASSERT((__s != 0), _StlMsg_INVALID_ARGUMENT)
00175     return assign(__s);
00176   }
00177 
00178   _Self& operator=(_CharT __c) {
00179     return assign(1, __c);
00180   }
00181 
00182   // Iterators.
00183   iterator begin() { return iterator(&_M_iter_list, _M_non_dbg_impl.begin()); }
00184   const_iterator begin() const { return const_iterator(&_M_iter_list, _M_non_dbg_impl.begin()); }
00185   iterator end() { return iterator(&_M_iter_list, _M_non_dbg_impl.end()); }
00186   const_iterator end() const { return const_iterator(&_M_iter_list, _M_non_dbg_impl.end()); }
00187 
00188   reverse_iterator rbegin()             { return reverse_iterator(end()); }
00189   const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); }
00190   reverse_iterator rend()               { return reverse_iterator(begin()); }
00191   const_reverse_iterator rend() const   { return const_reverse_iterator(begin()); }
00192 
00193   // Size, capacity, etc.
00194   size_type size() const { return _M_non_dbg_impl.size(); }
00195   size_type length() const { return _M_non_dbg_impl.length(); }
00196   size_t max_size() const { return _M_non_dbg_impl.max_size(); }
00197 
00198   void resize(size_type __n, _CharT __c) {
00199     if (__n > capacity())
00200       _Invalidate_all();
00201     else if (__n < size())
00202       _Invalidate_iterators(begin() + __n, end());
00203     _M_non_dbg_impl.resize(__n, __c);
00204   }
00205   void resize(size_type __n) { resize(__n, _STLP_DEFAULT_CONSTRUCTED(_CharT)); }
00206   size_type capacity() const { return _M_non_dbg_impl.capacity(); }
00207 
00208   void reserve(size_type __s = 0) {
00209     if (__s > capacity()) _Invalidate_all();
00210     _M_non_dbg_impl.reserve(__s);
00211   }
00212 
00213   void clear() {
00214     _Invalidate_all();
00215     _M_non_dbg_impl.clear();
00216   }
00217 
00218   bool empty() const { return _M_non_dbg_impl.empty(); }
00219 
00220   const_reference operator[](size_type __n) const {
00221     _STLP_VERBOSE_ASSERT(__n <= this->size(), _StlMsg_OUT_OF_BOUNDS);
00222     return _M_non_dbg_impl[__n];
00223   }
00224 
00225   reference operator[](size_type __n) {
00226     _STLP_VERBOSE_ASSERT(__n < this->size(), _StlMsg_OUT_OF_BOUNDS)
00227     return _M_non_dbg_impl[__n];
00228   }
00229 
00230   const_reference at(size_type __n) const { return _M_non_dbg_impl.at(__n); }
00231   reference at(size_type __n) { return _M_non_dbg_impl.at(__n); }
00232 
00233   // Append, operator+=, push_back.
00234   _Self& operator+=(const _Self& __s) { return append(__s); }
00235   _Self& operator+=(const _CharT* __s) {
00236     _STLP_FIX_LITERAL_BUG(__s)
00237     _STLP_VERBOSE_ASSERT((__s != 0), _StlMsg_INVALID_ARGUMENT)
00238     return append(__s);
00239   }
00240   _Self& operator+=(_CharT __c) { return append(1, __c); }
00241 
00242 #if defined (_STLP_MEMBER_TEMPLATES)
00243   template <class _InputIter>
00244   _Self& append(_InputIter __first, _InputIter __last) {
00245     _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
00246     size_type __old_capacity = capacity();
00247     _M_non_dbg_impl.append(_STLP_PRIV _Non_Dbg_iter(__first), _STLP_PRIV _Non_Dbg_iter(__last));
00248     _Compare_Capacity(__old_capacity);
00249     return *this;
00250   }
00251 #endif
00252 
00253 #if !defined (_STLP_MEMBER_TEMPLATES) || \
00254     !defined (_STLP_NO_METHOD_SPECIALIZATION) && !defined (_STLP_NO_EXTENSIONS)
00255   _Self& append(const _CharT* __f, const _CharT* __l) {
00256     _STLP_FIX_LITERAL_BUG(__f) _STLP_FIX_LITERAL_BUG(__l)
00257     _STLP_DEBUG_CHECK(_STLP_PRIV __check_ptr_range(__f, __l))
00258     size_type __old_capacity = capacity();
00259     _M_non_dbg_impl.append(__f, __l);
00260     _Compare_Capacity(__old_capacity);
00261     return *this;
00262   }
00263 
00264   _Self& append(const_iterator __f, const_iterator __l) {
00265     _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__f, __l))
00266     size_type __old_capacity = capacity();
00267     _M_non_dbg_impl.append(__f._M_iterator, __l._M_iterator);
00268     _Compare_Capacity(__old_capacity);
00269     return *this;
00270   }
00271 #endif
00272 
00273   _Self& append(const _Self& __s) {
00274     size_type __old_capacity = capacity();
00275     _M_non_dbg_impl.append(__s._M_non_dbg_impl);
00276     _Compare_Capacity(__old_capacity);
00277     return *this;
00278   }
00279 
00280   _Self& append(const _Self& __s, size_type __pos, size_type __n) {
00281     size_type __old_capacity = capacity();
00282     _M_non_dbg_impl.append(__s._M_non_dbg_impl, __pos, __n);
00283     _Compare_Capacity(__old_capacity);
00284     return *this;
00285   }
00286 
00287   _Self& append(const _CharT* __s, size_type __n) {
00288     _STLP_FIX_LITERAL_BUG(__s)
00289     _STLP_VERBOSE_ASSERT((__s != 0), _StlMsg_INVALID_ARGUMENT)
00290     size_type __old_capacity = capacity();
00291     _M_non_dbg_impl.append(__s, __n);
00292     _Compare_Capacity(__old_capacity);
00293     return *this;
00294   }
00295 
00296   _Self& append(const _CharT* __s) {
00297     _STLP_FIX_LITERAL_BUG(__s)
00298     _STLP_VERBOSE_ASSERT((__s != 0), _StlMsg_INVALID_ARGUMENT)
00299     size_type __old_capacity = capacity();
00300     _M_non_dbg_impl.append(__s);
00301     _Compare_Capacity(__old_capacity);
00302     return *this;
00303   }
00304 
00305   _Self& append(size_type __n, _CharT __c) {
00306     size_type __old_capacity = this->capacity();
00307     _M_non_dbg_impl.append(__n, __c);
00308     _Compare_Capacity(__old_capacity);
00309     return *this;
00310   }
00311 
00312   void push_back(_CharT __c) {
00313     size_type __old_capacity = this->capacity();
00314     _M_non_dbg_impl.push_back(__c);
00315     _Compare_Capacity(__old_capacity);
00316   }
00317 
00318   void pop_back() {
00319     _Invalidate_iterator(this->end());
00320     _M_non_dbg_impl.pop_back();
00321   }
00322 
00323   // Assign
00324   _Self& assign(const _Self& __s) {
00325     _Invalidate_all();
00326     _M_non_dbg_impl.assign(__s._M_non_dbg_impl);
00327     return *this;
00328   }
00329 
00330   _Self& assign(const _Self& __s, size_type __pos, size_type __n) {
00331     if (__pos < __s.size()) {
00332       _Invalidate_all();
00333     }
00334     _M_non_dbg_impl.assign(__s._M_non_dbg_impl, __pos, __n);
00335     return *this;
00336   }
00337 
00338   _Self& assign(const _CharT* __s, size_type __n) {
00339     _STLP_FIX_LITERAL_BUG(__s)
00340     _STLP_VERBOSE_ASSERT((__s != 0), _StlMsg_INVALID_ARGUMENT)
00341     _Invalidate_all();
00342     _M_non_dbg_impl.assign(__s, __s + __n);
00343     return *this;
00344   }
00345 
00346   _Self& assign(const _CharT* __s) {
00347     _STLP_FIX_LITERAL_BUG(__s)
00348     _STLP_VERBOSE_ASSERT((__s != 0), _StlMsg_INVALID_ARGUMENT)
00349     _Invalidate_all();
00350     _M_non_dbg_impl.assign(__s);
00351     return *this;
00352   }
00353 
00354   _Self& assign(size_type __n, _CharT __c) {
00355     _Invalidate_all();
00356     _M_non_dbg_impl.assign(__n, __c);
00357     return *this;
00358   }
00359 
00360 #if defined(_STLP_MEMBER_TEMPLATES)
00361   template <class _InputIter>
00362   inline _Self& assign(_InputIter __first, _InputIter __last) {
00363     _STLP_FIX_LITERAL_BUG(__first) _STLP_FIX_LITERAL_BUG(__last)
00364     _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
00365     _Invalidate_all();
00366     _M_non_dbg_impl.assign(_STLP_PRIV _Non_Dbg_iter(__first), _STLP_PRIV _Non_Dbg_iter(__last));
00367     return *this;
00368   }
00369 #endif
00370 
00371 #if !defined (_STLP_MEMBER_TEMPLATES) || \
00372     !defined (_STLP_NO_METHOD_SPECIALIZATION) && !defined (_STLP_NO_EXTENSIONS)
00373   _Self& assign(const _CharT* __f, const _CharT* __l) {
00374     _STLP_FIX_LITERAL_BUG(__f) _STLP_FIX_LITERAL_BUG(__l)
00375     _STLP_DEBUG_CHECK(_STLP_PRIV __check_ptr_range(__f, __l))
00376     _Invalidate_all();
00377     _M_non_dbg_impl.assign(__f, __l);
00378     return *this;
00379   }
00380   _Self& assign(const_iterator __f, const_iterator __l) {
00381     _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__f, __l))
00382     _Invalidate_all();
00383     _M_non_dbg_impl.assign(__f._M_iterator, __l._M_iterator);
00384     return *this;
00385   }
00386 #endif
00387 
00388   // Insert
00389   _Self& insert(size_type __pos, const _Self& __s) {
00390     size_type __old_capacity = capacity();
00391     _M_non_dbg_impl.insert(__pos, __s._M_non_dbg_impl);
00392     _Compare_Capacity(__old_capacity);
00393     return *this;
00394   }
00395 
00396   _Self& insert(size_type __pos, const _Self& __s,
00397                 size_type __beg, size_type __n) {
00398     size_type __old_capacity = capacity();
00399     _M_non_dbg_impl.insert(__pos, __s._M_non_dbg_impl, __beg, __n);
00400     _Compare_Capacity(__old_capacity);
00401     return *this;
00402   }
00403 
00404   _Self& insert(size_type __pos, const _CharT* __s, size_type __n) {
00405     _STLP_FIX_LITERAL_BUG(__s)
00406     _STLP_VERBOSE_ASSERT((__s != 0), _StlMsg_INVALID_ARGUMENT)
00407     size_type __old_capacity = capacity();
00408     _M_non_dbg_impl.insert(__pos, __s, __n);
00409     _Compare_Capacity(__old_capacity);
00410     return *this;
00411   }
00412 
00413   _Self& insert(size_type __pos, const _CharT* __s) {
00414     _STLP_FIX_LITERAL_BUG(__s)
00415     _STLP_VERBOSE_ASSERT((__s != 0), _StlMsg_INVALID_ARGUMENT)
00416     return insert(__pos, __s, _Traits::length(__s));
00417   }
00418 
00419   _Self& insert(size_type __pos, size_type __n, _CharT __c) {
00420     size_type __old_capacity = capacity();
00421     _M_non_dbg_impl.insert(__pos, __n, __c);
00422     _Compare_Capacity(__old_capacity);
00423     return *this;
00424   }
00425 
00426   iterator insert(iterator __p, _CharT __c) {
00427     _STLP_DEBUG_CHECK(_STLP_PRIV __check_if_owner(&_M_iter_list,__p))
00428     size_type __old_capacity = capacity();
00429     typename _Base::iterator __ret = _M_non_dbg_impl.insert(__p._M_iterator, __c);
00430     _Compare_Capacity(__old_capacity);
00431     return iterator(&_M_iter_list, __ret);
00432   }
00433 
00434   void insert(iterator __p, size_t __n, _CharT __c) {
00435     _STLP_DEBUG_CHECK(_STLP_PRIV __check_if_owner(&_M_iter_list,__p))
00436     size_type __old_capacity = capacity();
00437     _M_non_dbg_impl.insert(__p._M_iterator, __n, __c);
00438     _Compare_Capacity(__old_capacity);
00439   }
00440 
00441 #if defined (_STLP_MEMBER_TEMPLATES)
00442   template <class _InputIter>
00443   void insert(iterator __p, _InputIter __first, _InputIter __last) {
00444     _STLP_DEBUG_CHECK(_STLP_PRIV __check_if_owner(&_M_iter_list,__p))
00445     _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first,__last))
00446 
00447     size_type __old_capacity = this->capacity();
00448     _M_non_dbg_impl.insert(__p._M_iterator,
00449                            _STLP_PRIV _Non_Dbg_iter(__first), _STLP_PRIV _Non_Dbg_iter(__last));
00450     _Compare_Capacity(__old_capacity);
00451   }
00452 #endif
00453 
00454 #if !defined (_STLP_MEMBER_TEMPLATES)
00455   void insert(iterator __p, const _CharT* __f, const _CharT* __l) {
00456     _STLP_FIX_LITERAL_BUG(__f)_STLP_FIX_LITERAL_BUG(__l)
00457     _STLP_DEBUG_CHECK(_STLP_PRIV __check_if_owner(&_M_iter_list,__p))
00458     _STLP_DEBUG_CHECK(_STLP_PRIV __check_ptr_range(__f,__l))
00459     size_type __old_capacity = capacity();
00460     _M_non_dbg_impl.insert(__p._M_iterator, __f, __l);
00461     _Compare_Capacity(__old_capacity);
00462   }
00463 #endif
00464 
00465 #if !defined (_STLP_MEMBER_TEMPLATES) || !defined (_STLP_NO_METHOD_SPECIALIZATION)
00466   // Those overloads are necessary to check self referencing correctly in non debug
00467   // basic_string implementation
00468   void insert(iterator __p, const_iterator __f, const_iterator __l) {
00469     _STLP_DEBUG_CHECK(_STLP_PRIV __check_if_owner(&_M_iter_list,__p))
00470     _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__f,__l))
00471 #  if (_STLP_DEBUG_LEVEL == _STLP_STANDARD_DBG_LEVEL)
00472     _STLP_STD_DEBUG_CHECK(__check_if_not_owner(&_M_iter_list, __f))
00473 #  endif
00474     size_type __old_capacity = capacity();
00475     _M_non_dbg_impl.insert(__p._M_iterator, __f._M_iterator, __l._M_iterator);
00476     _Compare_Capacity(__old_capacity);
00477   }
00478   void insert(iterator __p, iterator __f, iterator __l) {
00479     _STLP_DEBUG_CHECK(_STLP_PRIV __check_if_owner(&_M_iter_list,__p))
00480     _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__f,__l))
00481 #  if (_STLP_DEBUG_LEVEL == _STLP_STANDARD_DBG_LEVEL)
00482     _STLP_STD_DEBUG_CHECK(__check_if_not_owner(&_M_iter_list, __f))
00483 #  endif
00484     size_type __old_capacity = capacity();
00485     _M_non_dbg_impl.insert(__p._M_iterator, __f._M_iterator, __l._M_iterator);
00486     _Compare_Capacity(__old_capacity);
00487   }
00488 #endif
00489 
00490   // Erase.
00491   _Self& erase(size_type __pos = 0, size_type __n = npos) {
00492     if (__pos < size()) {
00493       _Invalidate_iterators(begin() + __pos, end());
00494     }
00495     _M_non_dbg_impl.erase(__pos, __n);
00496     return *this;
00497   }
00498   iterator erase(iterator __pos) {
00499     _STLP_DEBUG_CHECK(_STLP_PRIV _Dereferenceable(__pos))
00500     _STLP_DEBUG_CHECK(_STLP_PRIV __check_if_owner(&_M_iter_list,__pos))
00501     _Invalidate_iterators(__pos, end());
00502     return iterator(&_M_iter_list, _M_non_dbg_impl.erase(__pos._M_iterator));
00503   }
00504   iterator erase(iterator __f, iterator __l) {
00505     _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__f, __l, begin(), end()))
00506     _Invalidate_iterators(__f, end());
00507     return iterator(&_M_iter_list, _M_non_dbg_impl.erase(__f._M_iterator, __l._M_iterator));
00508   }
00509 
00510   // Substring.
00511   _Self substr(size_type __pos = 0, size_type __n = npos) const
00512   { return _M_non_dbg_impl.substr(__pos, __n); }
00513 
00514   // Replace.  (Conceptually equivalent to erase followed by insert.)
00515   _Self& replace(size_type __pos, size_type __n, const _Self& __s) {
00516     size_type __old_capacity = capacity();
00517     _M_non_dbg_impl.replace(__pos, __n, __s._M_non_dbg_impl);
00518     _Compare_Capacity(__old_capacity);
00519     return *this;
00520   }
00521 
00522   _Self& replace(size_type __pos1, size_type __n1, const _Self& __s,
00523                  size_type __pos2, size_type __n2) {
00524     size_type __old_capacity = capacity();
00525     _M_non_dbg_impl.replace(__pos1, __n1, __s._M_non_dbg_impl, __pos2, __n2);
00526     _Compare_Capacity(__old_capacity);
00527     return *this;
00528   }
00529 
00530   _Self& replace(size_type __pos, size_type __n1, const _CharT* __s, size_type __n2) {
00531     _STLP_FIX_LITERAL_BUG(__s)
00532     _STLP_VERBOSE_ASSERT((__s != 0), _StlMsg_INVALID_ARGUMENT)
00533     size_type __old_capacity = capacity();
00534     _M_non_dbg_impl.replace(__pos, __n1, __s, __n2);
00535     _Compare_Capacity(__old_capacity);
00536     return *this;
00537   }
00538 
00539   _Self& replace(size_type __pos, size_type __n1, const _CharT* __s) {
00540     _STLP_FIX_LITERAL_BUG(__s)
00541     _STLP_VERBOSE_ASSERT((__s != 0), _StlMsg_INVALID_ARGUMENT)
00542     size_type __old_capacity = capacity();
00543     _M_non_dbg_impl.replace(__pos, __n1, __s);
00544     _Compare_Capacity(__old_capacity);
00545     return *this;
00546   }
00547 
00548   _Self& replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c) {
00549     size_type __old_capacity = capacity();
00550     _M_non_dbg_impl.replace(__pos, __n1, __n2, __c);
00551     _Compare_Capacity(__old_capacity);
00552     return *this;
00553   }
00554 
00555   _Self& replace(iterator __f, iterator __l, const _Self& __s) {
00556     _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__f, __l, begin(), end()))
00557     size_type __old_capacity = capacity();
00558     _M_non_dbg_impl.replace(__f._M_iterator, __l._M_iterator, __s._M_non_dbg_impl);
00559     _Compare_Capacity(__old_capacity);
00560     return *this;
00561   }
00562 
00563   _Self& replace(iterator __f, iterator __l, const _CharT* __s, size_type __n) {
00564     _STLP_FIX_LITERAL_BUG(__s)
00565     _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__f, __l, begin(), end()))
00566     _STLP_VERBOSE_ASSERT((__s != 0), _StlMsg_INVALID_ARGUMENT)
00567     size_type __old_capacity = capacity();
00568     _M_non_dbg_impl.replace(__f._M_iterator, __l._M_iterator, __s, __n);
00569     _Compare_Capacity(__old_capacity);
00570     return *this;
00571   }
00572 
00573   _Self& replace(iterator __f, iterator __l, const _CharT* __s) {
00574     _STLP_FIX_LITERAL_BUG(__s)
00575     _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__f, __l, begin(), end()))
00576     _STLP_VERBOSE_ASSERT((__s != 0), _StlMsg_INVALID_ARGUMENT)
00577     size_type __old_capacity = capacity();
00578     _M_non_dbg_impl.replace(__f._M_iterator, __l._M_iterator, __s);
00579     _Compare_Capacity(__old_capacity);
00580     return *this;
00581   }
00582 
00583   _Self& replace(iterator __f, iterator __l, size_type __n, _CharT __c) {
00584     _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__f, __l, begin(), end()))
00585     size_type __old_capacity = capacity();
00586     _M_non_dbg_impl.replace(__f._M_iterator, __l._M_iterator, __n, __c);
00587     _Compare_Capacity(__old_capacity);
00588     return *this;
00589   }
00590 
00591 #if defined (_STLP_MEMBER_TEMPLATES)
00592   template <class _InputIter>
00593   _Self& replace(iterator __first, iterator __last,
00594                  _InputIter __f, _InputIter __l) {
00595     _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last, begin(), end()))
00596     _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__f, __l))
00597 
00598     size_type __old_capacity = capacity();
00599     _M_non_dbg_impl.replace(__first._M_iterator, __last._M_iterator,
00600                             _STLP_PRIV _Non_Dbg_iter(__f), _STLP_PRIV _Non_Dbg_iter(__l));
00601     _Compare_Capacity(__old_capacity);
00602     return *this;
00603   }
00604 #endif
00605 
00606 #if !defined (_STLP_MEMBER_TEMPLATES)
00607   _Self& replace(iterator __first, iterator __last,
00608                  const _CharT* __f, const _CharT* __l) {
00609     _STLP_FIX_LITERAL_BUG(__f)_STLP_FIX_LITERAL_BUG(__l)
00610     _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last, begin(), end()))
00611     _STLP_DEBUG_CHECK(_STLP_PRIV __check_ptr_range(__f, __l))
00612     size_type __old_capacity = capacity();
00613     _M_non_dbg_impl.replace(__first._M_iterator, __last._M_iterator, __f, __l);
00614     _Compare_Capacity(__old_capacity);
00615     return *this;
00616   }
00617 #endif
00618 
00619 #if !defined (_STLP_MEMBER_TEMPLATES) || !defined (_STLP_NO_METHOD_SPECIALIZATION)
00620   _Self& replace(iterator __first, iterator __last,
00621                  const_iterator __f, const_iterator __l) {
00622     _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last, begin(), end()))
00623     _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__f, __l))
00624     size_type __old_capacity = capacity();
00625     _M_non_dbg_impl.replace(__first._M_iterator, __last._M_iterator,
00626                             __f._M_iterator, __l._M_iterator);
00627     _Compare_Capacity(__old_capacity);
00628     return *this;
00629   }
00630   _Self& replace(iterator __first, iterator __last,
00631                  iterator __f, iterator __l) {
00632     _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last, begin(), end()))
00633     _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__f, __l))
00634     size_type __old_capacity = capacity();
00635     _M_non_dbg_impl.replace(__first._M_iterator, __last._M_iterator,
00636                             __f._M_iterator, __l._M_iterator);
00637     _Compare_Capacity(__old_capacity);
00638     return *this;
00639   }
00640 #endif
00641 
00642   // Other modifier member functions.
00643   void swap(_Self& __s) {
00644     _M_iter_list._Swap_owners(__s._M_iter_list);
00645     _M_non_dbg_impl.swap(__s._M_non_dbg_impl);
00646   }
00647 #if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND) && !defined (_STLP_FUNCTION_TMPL_PARTIAL_ORDER)
00648   void _M_swap_workaround(_Self& __x) { swap(__x); }
00649 #endif
00650 
00651   int compare(const _Self& __s) const
00652   { return _M_non_dbg_impl.compare(__s._M_non_dbg_impl); }
00653   int compare(size_type __pos, size_type __n, const _Self& __s) const
00654   { return _M_non_dbg_impl.compare(__pos, __n, __s._M_non_dbg_impl); }
00655   int compare(size_type __pos1, size_type __n1, const _Self& __s,
00656               size_type __pos2, size_type __n2) const
00657   { return _M_non_dbg_impl.compare(__pos1, __n1, __s._M_non_dbg_impl, __pos2, __n2); }
00658   int compare(const _CharT* __s) const {
00659     _STLP_FIX_LITERAL_BUG(__s)
00660     return _M_non_dbg_impl.compare(__s);
00661   }
00662   int compare(size_type __pos, size_type __n, const _CharT* __s) const {
00663     _STLP_FIX_LITERAL_BUG(__s)
00664     return _M_non_dbg_impl.compare(__pos, __n, __s);
00665   }
00666   int compare(size_type __pos1, size_type __n1, const _CharT* __s,
00667               size_type __n2) const {
00668     _STLP_FIX_LITERAL_BUG(__s)
00669     return _M_non_dbg_impl.compare(__pos1, __n1, __s, __n2);
00670   }
00671 
00672   // Helper functions for compare.
00673   static int _STLP_CALL _M_compare(const _CharT* __f1, const _CharT* __l1,
00674                                    const _CharT* __f2, const _CharT* __l2)
00675   { return _Base::_M_compare(__f1, __l1, __f2, __l2); }
00676   static int _STLP_CALL _M_compare(const_iterator __f1, const_iterator __l1,
00677                                    const _CharT* __f2, const _CharT* __l2)
00678   { return _Base::_M_compare(__f1._M_iterator, __l1._M_iterator, __f2, __l2); }
00679   static int _STLP_CALL _M_compare(const _CharT* __f1, const _CharT* __l1,
00680                                    const_iterator __f2, const_iterator __l2)
00681   { return _Base::_M_compare(__f1, __l1, __f2._M_iterator, __l2._M_iterator); }
00682   static int _STLP_CALL _M_compare(const_iterator __f1, const_iterator __l1,
00683                                    const_iterator __f2, const_iterator __l2)
00684   { return _Base::_M_compare(__f1._M_iterator, __l1._M_iterator, __f2._M_iterator, __l2._M_iterator); }
00685 
00686   const _CharT* c_str() const { return _M_non_dbg_impl.c_str(); }
00687   const _CharT* data()  const { return _M_non_dbg_impl.data(); }
00688 
00689   size_type copy(_CharT* __s, size_type __n, size_type __pos = 0) const
00690   { return _M_non_dbg_impl.copy(__s, __n, __pos); }
00691 
00692   // find.
00693   size_type find(const _Self& __s, size_type __pos = 0) const
00694   { return _M_non_dbg_impl.find(__s._M_non_dbg_impl, __pos); }
00695   size_type find(const _CharT* __s, size_type __pos = 0) const {
00696     _STLP_FIX_LITERAL_BUG(__s)
00697     _STLP_VERBOSE_ASSERT((__s != 0), _StlMsg_INVALID_ARGUMENT)
00698     return _M_non_dbg_impl.find(__s, __pos);
00699   }
00700   size_type find(const _CharT* __s, size_type __pos, size_type __n) const {
00701     _STLP_FIX_LITERAL_BUG(__s)
00702     _STLP_VERBOSE_ASSERT((__s != 0), _StlMsg_INVALID_ARGUMENT)
00703     return _M_non_dbg_impl.find(__s, __pos, __n);
00704   }
00705   // WIE: Versant schema compiler 5.2.2 ICE workaround
00706   size_type find(_CharT __c) const { return find(__c, 0); }
00707   size_type find(_CharT __c, size_type __pos /* = 0 */) const
00708   { return _M_non_dbg_impl.find(__c, __pos); }
00709 
00710   // rfind.
00711   size_type rfind(const _Self& __s, size_type __pos = npos) const
00712   { return _M_non_dbg_impl.rfind(__s._M_non_dbg_impl, __pos); }
00713   size_type rfind(const _CharT* __s, size_type __pos = npos) const {
00714     _STLP_FIX_LITERAL_BUG(__s)
00715     _STLP_VERBOSE_ASSERT((__s != 0), _StlMsg_INVALID_ARGUMENT)
00716     return _M_non_dbg_impl.rfind(__s, __pos);
00717   }
00718   size_type rfind(const _CharT* __s, size_type __pos, size_type __n) const {
00719     _STLP_FIX_LITERAL_BUG(__s)
00720     _STLP_VERBOSE_ASSERT((__s != 0), _StlMsg_INVALID_ARGUMENT)
00721     return _M_non_dbg_impl.rfind(__s, __pos, __n);
00722   }
00723   size_type rfind(_CharT __c, size_type __pos = npos) const
00724   { return _M_non_dbg_impl.rfind(__c, __pos); }
00725 
00726   // find_first_of
00727   size_type find_first_of(const _Self& __s, size_type __pos = 0) const
00728   { return _M_non_dbg_impl.find_first_of(__s._M_non_dbg_impl, __pos); }
00729   size_type find_first_of(const _CharT* __s, size_type __pos = 0) const {
00730     _STLP_FIX_LITERAL_BUG(__s)
00731     _STLP_VERBOSE_ASSERT((__s != 0), _StlMsg_INVALID_ARGUMENT)
00732     return _M_non_dbg_impl.find_first_of(__s, __pos);
00733   }
00734   size_type find_first_of(const _CharT* __s, size_type __pos, size_type __n) const {
00735     _STLP_FIX_LITERAL_BUG(__s)
00736     _STLP_VERBOSE_ASSERT((__s != 0), _StlMsg_INVALID_ARGUMENT)
00737     return _M_non_dbg_impl.find_first_of(__s, __pos, __n);
00738   }
00739   size_type find_first_of(_CharT __c, size_type __pos = 0) const
00740   { return _M_non_dbg_impl.find_first_of(__c, __pos); }
00741 
00742   // find_last_of
00743   size_type find_last_of(const _Self& __s, size_type __pos = npos) const
00744   { return _M_non_dbg_impl.find_last_of(__s._M_non_dbg_impl, __pos); }
00745   size_type find_last_of(const _CharT* __s, size_type __pos = npos) const {
00746     _STLP_FIX_LITERAL_BUG(__s)
00747     _STLP_VERBOSE_ASSERT((__s != 0), _StlMsg_INVALID_ARGUMENT)
00748     return _M_non_dbg_impl.find_last_of(__s, __pos);
00749   }
00750   size_type find_last_of(const _CharT* __s, size_type __pos, size_type __n) const {
00751     _STLP_FIX_LITERAL_BUG(__s)
00752     _STLP_VERBOSE_ASSERT((__s != 0), _StlMsg_INVALID_ARGUMENT)
00753     return _M_non_dbg_impl.find_last_of(__s, __pos, __n);
00754   }
00755   size_type find_last_of(_CharT __c, size_type __pos = npos) const
00756   { return _M_non_dbg_impl.rfind(__c, __pos); }
00757 
00758   // find_first_not_of
00759   size_type find_first_not_of(const _Self& __s, size_type __pos = 0) const
00760   { return _M_non_dbg_impl.find_first_not_of(__s._M_non_dbg_impl, __pos); }
00761   size_type find_first_not_of(const _CharT* __s, size_type __pos = 0) const {
00762     _STLP_FIX_LITERAL_BUG(__s)
00763     _STLP_VERBOSE_ASSERT((__s != 0), _StlMsg_INVALID_ARGUMENT)
00764     return _M_non_dbg_impl.find_first_not_of(__s, __pos);
00765   }
00766   size_type find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const {
00767     _STLP_FIX_LITERAL_BUG(__s)
00768     _STLP_VERBOSE_ASSERT((__s != 0), _StlMsg_INVALID_ARGUMENT)
00769     return _M_non_dbg_impl.find_first_not_of(__s, __pos, __n);
00770   }
00771   size_type find_first_not_of(_CharT __c, size_type __pos = 0) const
00772   { return _M_non_dbg_impl.find_first_not_of(__c, __pos); }
00773 
00774   // find_last_not_of
00775   size_type find_last_not_of(const _Self& __s, size_type __pos = npos) const
00776   { return _M_non_dbg_impl.find_last_not_of(__s._M_non_dbg_impl, __pos); }
00777   size_type find_last_not_of(const _CharT* __s, size_type __pos = npos) const {
00778     _STLP_FIX_LITERAL_BUG(__s)
00779     _STLP_VERBOSE_ASSERT((__s != 0), _StlMsg_INVALID_ARGUMENT)
00780     return _M_non_dbg_impl.find_last_not_of(__s, __pos);
00781   }
00782   size_type find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const {
00783     _STLP_FIX_LITERAL_BUG(__s)
00784     _STLP_VERBOSE_ASSERT((__s != 0), _StlMsg_INVALID_ARGUMENT)
00785     return _M_non_dbg_impl.find_last_not_of(__s, __pos, __n);
00786   }
00787   size_type find_last_not_of(_CharT __c, size_type __pos = npos) const
00788   { return _M_non_dbg_impl.find_last_not_of(__c, __pos); }
00789 
00790 #if defined (_STLP_USE_TEMPLATE_EXPRESSION)
00791 #  include <stl/debug/_string_sum_methods.h>
00792 #endif
00793 };
00794 
00795 // This is a hook to instantiate STLport exports in a designated DLL
00796 #if defined (_STLP_USE_TEMPLATE_EXPORT) && !defined (_STLP_USE_MSVC6_MEM_T_BUG_WORKAROUND)
00797 _STLP_MOVE_TO_PRIV_NAMESPACE
00798 _STLP_EXPORT_TEMPLATE_CLASS __construct_checker<_STLP_NON_DBG_STRING_NAME <char, char_traits<char>, allocator<char> > >;
00799 _STLP_MOVE_TO_STD_NAMESPACE
00800 _STLP_EXPORT_TEMPLATE_CLASS basic_string<char, char_traits<char>, allocator<char> >;
00801 #  if defined (_STLP_HAS_WCHAR_T)
00802 _STLP_MOVE_TO_PRIV_NAMESPACE
00803 _STLP_EXPORT_TEMPLATE_CLASS __construct_checker<_STLP_NON_DBG_STRING_NAME <wchar_t, char_traits<wchar_t>, allocator<wchar_t> > >;
00804 _STLP_MOVE_TO_STD_NAMESPACE
00805 _STLP_EXPORT_TEMPLATE_CLASS basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >;
00806 #  endif
00807 #endif
00808 
00809 #undef _STLP_NON_DBG_STRING
00810 #undef _STLP_NON_DBG_STRING_NAME
00811 
00812 #if defined (__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ == 96)
00813 template <class _CharT, class _Traits, class _Alloc>
00814 const size_t basic_string<_CharT, _Traits, _Alloc>::npos = ~(size_t) 0;
00815 #endif
00816 
00817 #if defined (basic_string)
00818 _STLP_MOVE_TO_STD_NAMESPACE
00819 #undef basic_string
00820 #endif
00821 
00822 _STLP_END_NAMESPACE
00823 
00824 #endif /* _STLP_DBG_STRING */
00825 
00826 // Local Variables:
00827 // mode:C++
00828 // End:

Generated on Sun May 27 2012 04:29:36 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.