ReactOS  0.4.14-dev-49-gfb4591c
_string_sum.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2003
3  * Francois Dumont
4  *
5  * This material is provided "as is", with absolutely no warranty expressed
6  * or implied. Any use is at your own risk.
7  *
8  * Permission to use or copy this software for any purpose is hereby granted
9  * without fee, provided the above notices are retained on all copies.
10  * Permission to modify the code and to distribute modified code is granted,
11  * provided the above notices are retained, and a notice that the code was
12  * modified is included with the above copyright notice.
13  *
14  */
15 
16 #ifndef _STLP_STRING_SUM_H
17 #define _STLP_STRING_SUM_H
18 
20 
22 
23 /*char wrapper to simulate basic_string*/
24 template <class _CharT>
26  typedef const _CharT& const_reference;
27 
29 
30  _CharT getValue() const { return _Val; }
31  size_t size() const { return 1; }
32 
34  //To avoid a check on __n we use this strange implementation
35  return (&_Val)[__n];
36  }
37 
38 private:
39  _CharT _Val;
40 };
41 
42 /*C string wrapper to simulate basic_string*/
43 template <class _CharT>
45  typedef const _CharT& const_reference;
46 
47  __cstr_wrapper(const _CharT *__cstr, size_t __size) :
48  _CStr(__cstr), _Size(__size) {}
49 
50  const _CharT* c_str() const { return _CStr; }
51 
52  size_t size() const { return _Size; }
53 
54  const_reference operator[] (size_t __n) const { return _CStr[__n]; }
55 
56 private:
57  const _CharT *_CStr;
58  size_t _Size;
59 };
60 
61 /*basic_string wrapper to ensure that we only store a reference to the original string and not copy it*/
62 template <class _CharT, class _Traits, class _Alloc>
64  typedef const _CharT& const_reference;
66 
67  __bstr_wrapper (_BString const& __s) :
68  _BStr(__s) {}
69 
70  size_t size() const { return _BStr.size(); }
71 
72  const_reference operator[] (size_t __n) const { return _BStr[__n]; }
73 
74  _BString const& b_str() const { return _BStr; }
75 
76 private:
77  _BString const& _BStr;
78 };
79 
80 struct __on_left {};
81 struct __on_right {};
82 
83 template <class _CharT, class _Traits, class _Alloc,
84  class _Left, class _Right,
85  class _StorageDirection>
86 class __bstr_sum {
87 public:
91  typedef typename _BString::const_reverse_iterator const_reverse_iterator;
92  typedef typename _BString::size_type size_type;
95 
96  __bstr_sum (_Left const& lhs, _Right const& rhs) :
97  _lhs(lhs), _rhs(rhs) {}
98 
99  _Left const& getLhs() const { return _lhs; }
100  _Right const& getRhs() const { return _rhs; }
101 
103 
104  const_iterator begin() const { return _M_get_storage().begin(); }
105  const_iterator end() const { return _M_get_storage().end(); }
108 
109  size_type size() const { return _lhs.size() + _rhs.size(); }
110  size_type length() const { return size(); }
111 
112  size_t max_size() const { return _M_get_storage().max_size(); }
113  size_type capacity() const { return size(); }
114  bool empty() const { return size() == 0; }
115 
117  { return (__n < _lhs.size())?_lhs[__n]:_rhs[__n - _lhs.size()]; }
118 
120  { return _M_get_storage().at(__n); }
121 
122  //operator +=
124  _BStrOnLeft operator += (const _BString& __s) { return append(__s); }
125 
127  _CStrOnLeft operator += (const _CharT* __s) { return append(__s); }
128 
130  _CharOnLeft operator += (_CharT __c) { return _CharOnLeft(*this, __c); }
131 
132  //append
134  { return _BStrOnLeft(*this, __s); }
136  { return _M_get_storage().append(__s, __pos, __n); }
137  _CStrOnLeft append(const _CharT* __s) {
138  const size_type __n = _Traits::length(__s);
139  return _CStrOnLeft(*this, __cstr_wrapper<_CharT>(__s, __n));
140  }
141  _CStrOnLeft append(const _CharT* __s, size_type __n)
142  { return _CStrOnLeft(*this, __cstr_wrapper<_CharT>(__s, __n)); }
144  {return _M_get_storage().append(__n, __c);}
145  template <class _InputIter>
146  _BString& append(_InputIter __first, _InputIter __last)
147  {return _M_get_storage().append(__first, __last);}
148 
149  //assign
150  _BString& assign(const _BString& __s) {return _M_get_storage().assign(__s);}
151  _BString& assign(const _BString& __s, size_type __pos, size_type __n) {return _M_get_storage().assign(__s, __pos, __n);}
152  _BString& assign(const _CharT* __s, size_type __n) {return _M_get_storage().assign(__s, __n);}
153  _BString& assign(const _CharT* __s) {return _M_get_storage().assign(__s); }
155 
156  //insert
157  _BString& insert(size_type __pos, const _BString& __s) {return _M_get_storage().insert(__pos, __s);}
159  {return _M_get_storage().insert(__pos, __s, __beg, __n);}
160  _BString& insert(size_type __pos, const _CharT* __s, size_type __n) {return _M_get_storage().insert(__pos, __s, __n);}
161  _BString& insert(size_type __pos, const _CharT* __s) {return _M_get_storage().insert(__pos, __s);}
162  _BString& insert(size_type __pos, size_type __n, _CharT __c) {return _M_get_storage().insert(__pos, __n, __c);}
163 
164  //erase
166 
167  //replace
169  {return _M_get_storage().replace(__pos, __n, __s);}
170  _BString& replace(size_type __pos1, size_type __n1, const _BString& __s, size_type __pos2, size_type __n2)
171  {return _M_get_storage().replace(__pos1, __n1, __s, __pos2, __n2);}
172  _BString& replace(size_type __pos, size_type __n1, const _CharT* __s, size_type __n2)
173  {return _M_get_storage().replace(__pos, __n1, __s, __n2);}
174  _BString& replace(size_type __pos, size_type __n1, const _CharT* __s)
175  {return _M_get_storage().replace(__pos, __n1, __s);}
176  _BString& replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
177  {return _M_get_storage().replace(__pos, __n1, __n2, __c);}
178 
179  size_type copy(_CharT* __s, size_type __n, size_type __pos = 0) const
180  {return _M_get_storage().copy(__s, __n, __pos);}
181 
182  void swap(_BString& __s)
183  {_M_get_storage().swap(__s);}
184 
185  const _CharT* c_str() const { return _M_get_storage().c_str(); }
186  const _CharT* data() const { return _M_get_storage().data(); }
187 
188  //find family
189  size_type find(const _BString& __s, size_type __pos = 0) const { return _M_get_storage().find(__s, __pos); }
190  size_type find(const _CharT* __s, size_type __pos = 0) const { return _M_get_storage().find(__s, __pos); }
191  size_type find(const _CharT* __s, size_type __pos, size_type __n) const { return _M_get_storage().find(__s, __pos, __n); }
192  size_type find(_CharT __c, size_type __pos = 0) const { return _M_get_storage().find(__c, __pos); }
193 
194  size_type rfind(const _BString& __s, size_type __pos = _BString::npos) const { return _M_get_storage().rfind(__s, __pos); }
195  size_type rfind(const _CharT* __s, size_type __pos = _BString::npos) const { return _M_get_storage().rfind(__s, __pos); }
196  size_type rfind(const _CharT* __s, size_type __pos, size_type __n) const { return _M_get_storage().rfind(__s, __pos, __n); }
197  size_type rfind(_CharT __c, size_type __pos = _BString::npos) const { return _M_get_storage().rfind(__c, __pos); }
198 
199  size_type find_first_of(const _BString& __s, size_type __pos = 0) const
200  { return _M_get_storage().find_first_of(__s, __pos); }
201  size_type find_first_of(const _CharT* __s, size_type __pos = 0) const
202  { return _M_get_storage().find_first_of(__s, __pos); }
203  size_type find_first_of(const _CharT* __s, size_type __pos, size_type __n) const
204  { return _M_get_storage().find_first_of(__s, __pos, __n); }
205  size_type find_first_of(_CharT __c, size_type __pos = 0) const
206  { return _M_get_storage().find(__c, __pos); }
207 
209  { return _M_get_storage().find_last_of(__s, __pos); }
210  size_type find_last_of(const _CharT* __s, size_type __pos = _BString::npos) const
211  { return _M_get_storage().find_last_of(__s, __pos); }
212  size_type find_last_of(const _CharT* __s, size_type __pos, size_type __n) const
213  { return _M_get_storage().find_last_of(__s, __pos, __n); }
215  { return _M_get_storage().rfind(__c, __pos); }
216 
217  size_type find_first_not_of(const _BString& __s, size_type __pos = 0) const
218  { return _M_get_storage().find_first_not_of(__s, __pos); }
219  size_type find_first_not_of(const _CharT* __s, size_type __pos = 0) const
220  { return _M_get_storage().find_first_not_of(__s, __pos); }
221  size_type find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const
222  { return _M_get_storage().find_first_not_of(__s, __pos, __n); }
223  size_type find_first_not_of(_CharT __c, size_type __pos = 0) const
224  { return _M_get_storage().find_first_not_of(__c, __pos); }
225 
227  { return _M_get_storage().find_last_not_of(__s, __pos); }
228  size_type find_last_not_of(const _CharT* __s, size_type __pos =_BString:: npos) const
229  { return _M_get_storage().find_last_not_of(__s, __pos); }
230  size_type find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const
231  { return _M_get_storage().find_last_not_of(__s, __pos, __n); }
233  { return _M_get_storage().find_last_not_of(__c, __pos); }
234 
236  { return _M_get_storage().substr(__pos, __n); }
237 
238  //compare
239  int compare(const _BString& __s) const
240  { return _M_get_storage().compare(__s); }
241  int compare(size_type __pos1, size_type __n1, const _Self& __s) const
242  { return _M_get_storage().compare(__pos1, __n1, __s); }
243  int compare(size_type __pos1, size_type __n1, const _Self& __s, size_type __pos2, size_type __n2) const
244  { return _M_get_storage().compare(__pos1, __n1, __s, __pos2, __n2); }
245  int compare(const _CharT* __s) const
246  { return _M_get_storage().compare(__s); }
247  int compare(size_type __pos1, size_type __n1, const _CharT* __s) const
248  { return _M_get_storage().compare(__pos1, __n1, __s); }
249  int compare(size_type __pos1, size_type __n1, const _CharT* __s, size_type __n2) const
250  { return _M_get_storage().compare(__pos1, __n1, __s, __n2); }
251 
252  //Returns the underlying basic_string representation of the template expression
253  //The non const method will always initialise it.
255  { return _rhs._M_get_storage(*this, _StorageDirection()); }
256 
257  template <class _Lhs, class _Rhs, class _StorageDir>
259  __on_left const& /*StorageDir*/)
260  { return _lhs._M_get_storage(__ref); }
261 
262  template <class _Lhs, class _Rhs, class _StorageDir>
264  __on_right const& /*StorageDir*/)
265  { return _rhs._M_get_storage(__ref); }
266 
267  template <class _Lhs, class _Rhs, class _StorageDir>
269  { return _M_get_storage(__ref, _StorageDirection()); }
270 
271  //The const method can be invoked without initialising the basic_string so avoiding dynamic allocation.
272  _BString const& _M_get_storage(bool __do_init = true) const
273  { return _M_get_storage(*this, __do_init, _StorageDirection()); }
274 
275  template <class _Lhs, class _Rhs, class _StorageDir>
277  bool __do_init, __on_left const& /*StorageDir*/) const
278  { return _lhs._M_get_storage(__ref, __do_init); }
279 
280  template <class _Lhs, class _Rhs, class _StorageDir>
282  bool __do_init, __on_right const& /*StorageDir*/) const
283  { return _rhs._M_get_storage(__ref, __do_init); }
284 
285  template <class _Lhs, class _Rhs, class _StorageDir>
287  bool __do_init) const
288  { return _M_get_storage(__ref, __do_init, _StorageDirection()); }
289 
290 private:
291  _Left _lhs;
292  _Right _rhs;
293 };
294 
295 /*
296  * For this operator we choose to use the right part as the storage part
297  */
298 template <class _CharT, class _Traits, class _Alloc,
299  class _Lh1, class _Rh1, class _StoreDir1,
300  class _Lh2, class _Rh2, class _StoreDir2>
301 inline __bstr_sum<_CharT, _Traits, _Alloc,
307  return __bstr_sum<_CharT, _Traits, _Alloc,
310  __on_right>(__lhs, __rhs);
311 }
312 
313 template <class _CharT, class _Traits, class _Alloc,
314  class _Lh1, class _Rh1, class _StoreDir1,
315  class _Lh2, class _Rh2, class _StoreDir2>
316 inline bool _STLP_CALL
319 { return (__lhs.size() == __rhs.size()) && (__lhs._M_get_storage() == __rhs._M_get_storage()); }
320 
321 template <class _CharT, class _Traits, class _Alloc,
322  class _Lh1, class _Rh1, class _StoreDir1,
323  class _Lh2, class _Rh2, class _StoreDir2>
324 inline bool _STLP_CALL
327 { return __lhs._M_get_storage() < __rhs._M_get_storage(); }
328 
329 #ifdef _STLP_USE_SEPARATE_RELOPS_NAMESPACE
330 
331 template <class _CharT, class _Traits, class _Alloc,
332  class _Lh1, class _Rh1, class _StoreDir1,
333  class _Lh2, class _Rh2, class _StoreDir2>
334 inline bool _STLP_CALL
337 { return !(__lhs == __rhs); }
338 
339 template <class _CharT, class _Traits, class _Alloc,
340  class _Lh1, class _Rh1, class _StoreDir1,
341  class _Lh2, class _Rh2, class _StoreDir2>
342 inline bool _STLP_CALL
345 { return __rhs < __lhs; }
346 
347 template <class _CharT, class _Traits, class _Alloc,
348  class _Lh1, class _Rh1, class _StoreDir1,
349  class _Lh2, class _Rh2, class _StoreDir2>
350 inline bool _STLP_CALL
353 { return !(__rhs < __lhs); }
354 
355 template <class _CharT, class _Traits, class _Alloc,
356  class _Lh1, class _Rh1, class _StoreDir1,
357  class _Lh2, class _Rh2, class _StoreDir2>
358 inline bool _STLP_CALL
361 { return !(__lhs < __rhs); }
362 
363 #endif /* _STLP_USE_SEPARATE_RELOPS_NAMESPACE */
364 
365 
366 /*
367  * This class will be used to simulate a temporary string that is required for
368  * a call to the c_str method on the __bstr_sum class.
369  */
370 
371 template <class _CharT, class _Traits, class _Alloc>
375 
377  {}
378 
379  template <class _Left, class _Right, class _StorageDir>
381  if (!_M_init) {
382  _STLP_MUTABLE(_Self, _M_storage) = __ref;
383  _STLP_MUTABLE(_Self, _M_init) = true;
384  }
385  }
386 
387  template <class _Left, class _Right, class _StorageDir>
389  bool __do_init) const {
390  if (__do_init) {
391  _M_Init(__ref);
392  }
393  return _M_storage;
394  }
395  template <class _Left, class _Right, class _StorageDir>
397  _M_Init(__ref);
398  return _M_storage;
399  }
400 
401  size_t size() const { return 0; }
402  _CharT const& operator[](size_t __n) const
403  { return __STATIC_CAST(_CharT*, 0)[__n]; }
404 
405 private:
406  mutable bool _M_init;
408 };
409 
411 
413 
414 #endif /*_STLP_STRING_SUM_H*/
_BString & erase(size_type __pos=0, size_type __n=_BString::npos)
Definition: _string_sum.h:165
_BString::const_reverse_iterator const_reverse_iterator
Definition: _string_sum.h:91
basic_string< _CharT, _Traits, _Alloc > _M_storage
Definition: _string_sum.h:407
int compare(const _BString &__s) const
Definition: _string_sum.h:239
__bstr_sum< _CharT, _Traits, _Alloc, _Left, _Right, _StorageDirection > _Self
Definition: _string_sum.h:94
size_type find_first_of(const _BString &__s, size_type __pos=0) const
Definition: _string_sum.h:199
const _CharT * c_str() const
Definition: _string_sum.h:185
const _CharT * _CStr
Definition: _string_sum.h:57
return __n
Definition: _algo.h:75
void _M_Init(__bstr_sum< _CharT, _Traits, _Alloc, _Left, _Right, _StorageDir > const &__ref) const
Definition: _string_sum.h:380
const _CharT & const_reference
Definition: _string_sum.h:64
_Right const & getRhs() const
Definition: _string_sum.h:100
const_reference operator[](size_t __n) const
Definition: _string_sum.h:54
#define _Alloc
Definition: _bvector.h:330
size_type size() const
Definition: _string_sum.h:109
#define __STATIC_CAST(__x, __y)
Definition: features.h:585
bool _STLP_CALL operator==(const __bstr_sum< _CharT, _Traits, _Alloc, _Lh1, _Rh1, _StoreDir1 > &__lhs, const __bstr_sum< _CharT, _Traits, _Alloc, _Lh2, _Rh2, _StoreDir2 > &__rhs)
Definition: _string_sum.h:317
size_type find_last_not_of(_CharT __c, size_type __pos=_BString::npos) const
Definition: _string_sum.h:232
__bstr_sum(_Left const &lhs, _Right const &rhs)
Definition: _string_sum.h:96
size_type find(const _Self &__s, size_type __pos=0) const
Definition: _string.h:953
size_type capacity() const
Definition: _string_sum.h:113
_BString & insert(size_type __pos, const _CharT *__s)
Definition: _string_sum.h:161
_BString & assign(const _BString &__s, size_type __pos, size_type __n)
Definition: _string_sum.h:151
static const size_t npos
Definition: _string_npos.h:26
int compare(size_type __pos1, size_type __n1, const _CharT *__s, size_type __n2) const
Definition: _string_sum.h:249
__sum_storage_elem(_Alloc __alloc)
Definition: _string_sum.h:376
__bstr_sum< _CharT, _Traits, _Alloc, _Self, __char_wrapper< _CharT >, __on_left > _CharOnLeft
Definition: _string_sum.h:129
_BString & replace(size_type __pos, size_type __n1, const _CharT *__s)
Definition: _string_sum.h:174
size_type find_first_not_of(_CharT __c, size_type __pos=0) const
Definition: _string_sum.h:223
iterator begin()
Definition: _string.h:385
const _CharT * data() const
Definition: _string.h:950
_BString & replace(size_type __pos1, size_type __n1, const _BString &__s, size_type __pos2, size_type __n2)
Definition: _string_sum.h:170
__bstr_sum< _CharT, _Traits, _Alloc, _Self, __bstr_wrapper< _CharT, _Traits, _Alloc >, __on_left > _BStrOnLeft
Definition: _string_sum.h:123
basic_string< _CharT, _Traits, _Alloc > _BString
Definition: _string_sum.h:374
size_t size() const
Definition: _string_sum.h:52
int compare(size_type __pos1, size_type __n1, const _Self &__s) const
Definition: _string_sum.h:241
_BString & _M_get_storage(__bstr_sum< _CharT, _Traits, _Alloc, _Lhs, _Rhs, _StorageDir > const &__ref, __on_right const &)
Definition: _string_sum.h:263
const_iterator end() const
Definition: _string_sum.h:105
_BString & replace(size_type __pos, size_type __n, const _BString &__s)
Definition: _string_sum.h:168
allocator_type get_allocator() const
Definition: _string.h:154
_BString & _M_get_storage()
Definition: _string_sum.h:254
#define __c
Definition: schilyio.h:209
const_reference at(size_type __n) const
Definition: _string_sum.h:119
_BString const & b_str() const
Definition: _string_sum.h:74
size_type rfind(const _BString &__s, size_type __pos=_BString::npos) const
Definition: _string_sum.h:194
size_type find(const _CharT *__s, size_type __pos, size_type __n) const
Definition: _string_sum.h:191
#define _STLP_MOVE_TO_PRIV_NAMESPACE
Definition: features.h:524
_BString & append(size_type __n, _CharT __c)
Definition: _string_sum.h:143
_BString & insert(size_type __pos, const _CharT *__s, size_type __n)
Definition: _string_sum.h:160
_Self & replace(size_type __pos, size_type __n, const _Self &__s)
Definition: _string.h:813
_CStrOnLeft append(const _CharT *__s, size_type __n)
Definition: _string_sum.h:141
const _CharT & const_reference
Definition: _string_sum.h:45
_BString const & _M_get_storage(__bstr_sum< _CharT, _Traits, _Alloc, _Left, _Right, _StorageDir > const &__ref, bool __do_init) const
Definition: _string_sum.h:388
size_type find_last_of(const _CharT *__s, size_type __pos, size_type __n) const
Definition: _string_sum.h:212
size_type size() const
Definition: _string.h:400
_BString & insert(size_type __pos, const _BString &__s, size_type __beg, size_type __n)
Definition: _string_sum.h:158
const_iterator begin() const
Definition: _string_sum.h:104
_BStrOnLeft operator+=(const _BString &__s)
Definition: _string_sum.h:124
size_t size() const
Definition: _string_sum.h:401
void swap(_BString &__s)
Definition: _string_sum.h:182
const _CharT * data() const
Definition: _string_sum.h:186
iterator end()
Definition: _string.h:386
size_type find_last_of(const _BString &__s, size_type __pos=_BString::npos) const
Definition: _string_sum.h:208
const_reference operator[](size_t __n) const
Definition: _string_sum.h:33
_BString & append(const _BString &__s, size_type __pos, size_type __n)
Definition: _string_sum.h:135
const _CharT * c_str() const
Definition: _string.h:949
__bstr_sum< _CharT, _Traits, _Alloc, __bstr_sum< _CharT, _Traits, _Alloc, _Lh1, _Rh1, _StoreDir1 >, __bstr_sum< _CharT, _Traits, _Alloc, _Lh2, _Rh2, _StoreDir2 >, __on_right > _STLP_CALL operator+(const __bstr_sum< _CharT, _Traits, _Alloc, _Lh1, _Rh1, _StoreDir1 > &__lhs, const __bstr_sum< _CharT, _Traits, _Alloc, _Lh2, _Rh2, _StoreDir2 > &__rhs)
Definition: _string_sum.h:305
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_MUTABLE(type, x)
Definition: features.h:634
size_type find_last_not_of(const _CharT *__s, size_type __pos=_BString::npos) const
Definition: _string_sum.h:228
_BString const & _BStr
Definition: _string_sum.h:77
basic_string< _CharT, _Traits, _Alloc > _BString
Definition: _string_sum.h:65
_Base::size_type size_type
Definition: _string.h:138
_BString const & _M_get_storage(__bstr_sum< _CharT, _Traits, _Alloc, _Lhs, _Rhs, _StorageDir > const &__ref, bool __do_init, __on_left const &) const
Definition: _string_sum.h:276
_BString::size_type size_type
Definition: _string_sum.h:92
_BString & insert(size_type __pos, size_type __n, _CharT __c)
Definition: _string_sum.h:162
#define _STLP_MOVE_TO_STD_NAMESPACE
Definition: features.h:525
size_type find_last_of(_CharT __c, size_type __pos=_BString::npos) const
Definition: _string_sum.h:214
bool operator !=(const SortClass &lhs, const SortClass &rhs)
Definition: SortClass.h:70
int compare(size_type __pos1, size_type __n1, const _CharT *__s) const
Definition: _string_sum.h:247
size_type find_last_not_of(const _BString &__s, size_type __pos=_BString::npos) const
Definition: _string_sum.h:226
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
size_t size() const
Definition: _string_sum.h:70
void swap(_Self &__s)
Definition: _string.h:942
_Left _lhs
Definition: _string_sum.h:291
_STLP_INLINE_LOOP _InputIter const _Tp & __val
Definition: _algobase.h:656
const_reference operator[](size_t __n) const
Definition: _string_sum.h:116
_BString const & _M_get_storage(__bstr_sum< _CharT, _Traits, _Alloc, _Lhs, _Rhs, _StorageDir > const &__ref, bool __do_init, __on_right const &) const
Definition: _string_sum.h:281
reverse_iterator rend()
Definition: _string.h:392
_Self & assign(const _Self &__s)
Definition: _string.h:548
_CharT getValue() const
Definition: _string_sum.h:30
int compare(const _CharT *__s) const
Definition: _string_sum.h:245
bool _STLP_CALL operator<=(const _Bit_iterator_base &__x, const _Bit_iterator_base &__y)
Definition: _bvector.h:161
_Self & append(const _CharT *__first, const _CharT *__last)
Definition: _string.h:509
size_type find_first_not_of(const _Self &__s, size_type __pos=0) const
Definition: _string.h:1000
_BStrOnLeft append(const _BString &__s)
Definition: _string_sum.h:133
_BString::const_reference const_reference
Definition: _string_sum.h:89
_BString & _M_get_storage(__bstr_sum< _CharT, _Traits, _Alloc, _Lhs, _Rhs, _StorageDir > const &__ref)
Definition: _string_sum.h:268
size_type find_last_not_of(const _Self &__s, size_type __pos=npos) const
Definition: _string.h:1011
reverse_iterator rbegin()
Definition: _string.h:390
_Self substr(size_type __pos=0, size_type __n=npos) const
Definition: _string.h:1022
__cstr_wrapper(const _CharT *__cstr, size_t __size)
Definition: _string_sum.h:47
size_type rfind(const _Self &__s, size_type __pos=npos) const
Definition: _string.h:966
_BString::const_iterator const_iterator
Definition: _string_sum.h:90
const _CharT * c_str() const
Definition: _string_sum.h:50
int compare(const _Self &__s) const
Definition: _string.h:1026
_BString const & _M_get_storage(bool __do_init=true) const
Definition: _string_sum.h:272
#define false
Definition: stdbool.h:38
_BString & _M_get_storage(__bstr_sum< _CharT, _Traits, _Alloc, _Left, _Right, _StorageDir > const &__ref)
Definition: _string_sum.h:396
bool empty() const
Definition: _string_sum.h:114
size_type find_last_of(const _CharT *__s, size_type __pos=_BString::npos) const
Definition: _string_sum.h:210
_BString & assign(size_type __n, _CharT __c)
Definition: _string_sum.h:154
size_type find_first_not_of(const _CharT *__s, size_type __pos=0) const
Definition: _string_sum.h:219
size_type find(const _BString &__s, size_type __pos=0) const
Definition: _string_sum.h:189
_BString substr(size_type __pos=0, size_type __n=_BString::npos) const
Definition: _string_sum.h:235
size_type find_first_of(const _Self &__s, size_type __pos=0) const
Definition: _string.h:976
size_type find_first_of(const _CharT *__s, size_type __pos, size_type __n) const
Definition: _string_sum.h:203
__char_wrapper(_CharT __val)
Definition: _string_sum.h:28
int compare(size_type __pos1, size_type __n1, const _Self &__s, size_type __pos2, size_type __n2) const
Definition: _string_sum.h:243
size_t size() const
Definition: _string_sum.h:31
size_type find_first_of(_CharT __c, size_type __pos=0) const
Definition: _string_sum.h:205
_BString const & _M_get_storage(__bstr_sum< _CharT, _Traits, _Alloc, _Lhs, _Rhs, _StorageDir > const &__ref, bool __do_init) const
Definition: _string_sum.h:286
_BString & assign(const _CharT *__s)
Definition: _string_sum.h:153
_BString & assign(const _CharT *__s, size_type __n)
Definition: _string_sum.h:152
size_type find(_CharT __c, size_type __pos=0) const
Definition: _string_sum.h:192
size_type rfind(const _CharT *__s, size_type __pos=_BString::npos) const
Definition: _string_sum.h:195
size_type find_first_of(const _CharT *__s, size_type __pos=0) const
Definition: _string_sum.h:201
__sum_storage_elem< _CharT, _Traits, _Alloc > _Self
Definition: _string_sum.h:373
size_type find_first_not_of(const _BString &__s, size_type __pos=0) const
Definition: _string_sum.h:217
size_type rfind(_CharT __c, size_type __pos=_BString::npos) const
Definition: _string_sum.h:197
_BString & append(_InputIter __first, _InputIter __last)
Definition: _string_sum.h:146
#define _STLP_END_NAMESPACE
Definition: features.h:503
size_type find(const _CharT *__s, size_type __pos=0) const
Definition: _string_sum.h:190
_BString & _M_get_storage(__bstr_sum< _CharT, _Traits, _Alloc, _Lhs, _Rhs, _StorageDir > const &__ref, __on_left const &)
Definition: _string_sum.h:258
basic_string< _CharT, _Traits, _Alloc > _BString
Definition: _string_sum.h:88
size_t max_size() const
Definition: _string_sum.h:112
_BString & assign(const _BString &__s)
Definition: _string_sum.h:150
_BString & replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
Definition: _string_sum.h:176
_Base::allocator_type allocator_type
Definition: _string.h:152
size_type copy(_CharT *__s, size_type __n, size_type __pos=0) const
Definition: _string.h:933
const_reference at(size_type __n) const
Definition: _string.h:437
_CharT const & operator[](size_t __n) const
Definition: _string_sum.h:402
_BString & replace(size_type __pos, size_type __n1, const _CharT *__s, size_type __n2)
Definition: _string_sum.h:172
const_reverse_iterator rbegin() const
Definition: _string_sum.h:106
#define _STLP_BEGIN_NAMESPACE
Definition: features.h:501
_BString & insert(size_type __pos, const _BString &__s)
Definition: _string_sum.h:157
size_type copy(_CharT *__s, size_type __n, size_type __pos=0) const
Definition: _string_sum.h:179
size_type find_last_of(const _Self &__s, size_type __pos=npos) const
Definition: _string.h:988
_Self & insert(size_type __pos, const _Self &__s)
Definition: _string.h:608
__bstr_sum< _CharT, _Traits, _Alloc, _Self, __cstr_wrapper< _CharT >, __on_left > _CStrOnLeft
Definition: _string_sum.h:126
size_type length() const
Definition: _string_sum.h:110
#define _STLP_CALL
Definition: _bc.h:131
const_reverse_iterator rend() const
Definition: _string_sum.h:107
_Self & erase(size_type __pos=0, size_type __n=npos)
Definition: _string.h:788
size_type rfind(const _CharT *__s, size_type __pos, size_type __n) const
Definition: _string_sum.h:196
_Left const & getLhs() const
Definition: _string_sum.h:99
_Right _rhs
Definition: _string_sum.h:292
size_type max_size() const
Definition: _string.h:402
const _CharT & const_reference
Definition: _string_sum.h:26
bool _STLP_CALL operator<(const __bstr_sum< _CharT, _Traits, _Alloc, _Lh1, _Rh1, _StoreDir1 > &__lhs, const __bstr_sum< _CharT, _Traits, _Alloc, _Lh2, _Rh2, _StoreDir2 > &__rhs)
Definition: _string_sum.h:325
_BString::allocator_type allocator_type
Definition: _string_sum.h:93
allocator_type get_allocator() const
Definition: _string_sum.h:102
const_reference operator[](size_t __n) const
Definition: _string_sum.h:72
size_type find_last_not_of(const _CharT *__s, size_type __pos, size_type __n) const
Definition: _string_sum.h:230
__bstr_wrapper(_BString const &__s)
Definition: _string_sum.h:67
size_type find_first_not_of(const _CharT *__s, size_type __pos, size_type __n) const
Definition: _string_sum.h:221
const value_type * const_iterator
Definition: _string.h:142
const value_type & const_reference
Definition: _string.h:137
_CStrOnLeft append(const _CharT *__s)
Definition: _string_sum.h:137