ReactOS 0.4.15-dev-8191-gbc6c731
_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*/
24template <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
38private:
39 _CharT _Val;
40};
41
42/*C string wrapper to simulate basic_string*/
43template <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
56private:
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*/
62template <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
76private:
78};
79
80struct __on_left {};
81struct __on_right {};
82
83template <class _CharT, class _Traits, class _Alloc,
84 class _Left, class _Right,
85 class _StorageDirection>
87public:
91 typedef typename _BString::const_reverse_iterator const_reverse_iterator;
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
165 _BString& erase(size_type __pos = 0, size_type __n =_BString::npos) {return _M_get_storage().erase(__pos, __n);}
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
208 size_type find_last_of(const _BString& __s, size_type __pos = _BString::npos) const
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); }
214 size_type find_last_of(_CharT __c, size_type __pos = _BString::npos) const
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
226 size_type find_last_not_of(const _BString& __s, size_type __pos = _BString::npos) const
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); }
232 size_type find_last_not_of(_CharT __c, size_type __pos = _BString::npos) const
233 { return _M_get_storage().find_last_not_of(__c, __pos); }
234
235 _BString substr(size_type __pos = 0, size_type __n = _BString::npos) const
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
290private:
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 */
298template <class _CharT, class _Traits, class _Alloc,
299 class _Lh1, class _Rh1, class _StoreDir1,
300 class _Lh2, class _Rh2, class _StoreDir2>
301inline __bstr_sum<_CharT, _Traits, _Alloc,
307 return __bstr_sum<_CharT, _Traits, _Alloc,
310 __on_right>(__lhs, __rhs);
311}
312
313template <class _CharT, class _Traits, class _Alloc,
314 class _Lh1, class _Rh1, class _StoreDir1,
315 class _Lh2, class _Rh2, class _StoreDir2>
316inline bool _STLP_CALL
319{ return (__lhs.size() == __rhs.size()) && (__lhs._M_get_storage() == __rhs._M_get_storage()); }
320
321template <class _CharT, class _Traits, class _Alloc,
322 class _Lh1, class _Rh1, class _StoreDir1,
323 class _Lh2, class _Rh2, class _StoreDir2>
324inline bool _STLP_CALL
327{ return __lhs._M_get_storage() < __rhs._M_get_storage(); }
328
329#ifdef _STLP_USE_SEPARATE_RELOPS_NAMESPACE
330
331template <class _CharT, class _Traits, class _Alloc,
332 class _Lh1, class _Rh1, class _StoreDir1,
333 class _Lh2, class _Rh2, class _StoreDir2>
334inline bool _STLP_CALL
337{ return !(__lhs == __rhs); }
338
339template <class _CharT, class _Traits, class _Alloc,
340 class _Lh1, class _Rh1, class _StoreDir1,
341 class _Lh2, class _Rh2, class _StoreDir2>
342inline bool _STLP_CALL
345{ return __rhs < __lhs; }
346
347template <class _CharT, class _Traits, class _Alloc,
348 class _Lh1, class _Rh1, class _StoreDir1,
349 class _Lh2, class _Rh2, class _StoreDir2>
350inline bool _STLP_CALL
353{ return !(__rhs < __lhs); }
354
355template <class _CharT, class _Traits, class _Alloc,
356 class _Lh1, class _Rh1, class _StoreDir1,
357 class _Lh2, class _Rh2, class _StoreDir2>
358inline 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
371template <class _CharT, class _Traits, class _Alloc>
375
377 {}
378
379 template <class _Left, class _Right, class _StorageDir>
381 if (!_M_init) {
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
405private:
406 mutable bool _M_init;
408};
409
411
413
414#endif /*_STLP_STRING_SUM_H*/
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
return __n
Definition: _algo.h:75
_STLP_INLINE_LOOP _InputIter const _Tp & __val
Definition: _algobase.h:656
bool _STLP_CALL operator!=(const allocator< _T1 > &, const allocator< _T2 > &) _STLP_NOTHROW
Definition: _alloc.h:384
#define _STLP_CALL
Definition: _bc.h:131
bool _STLP_CALL operator>(const _Bit_iterator_base &__x, const _Bit_iterator_base &__y)
Definition: _bvector.h:158
#define _Alloc
Definition: _bvector.h:330
bool _STLP_CALL operator>=(const _Bit_iterator_base &__x, const _Bit_iterator_base &__y)
Definition: _bvector.h:164
bool _STLP_CALL operator<=(const _Bit_iterator_base &__x, const _Bit_iterator_base &__y)
Definition: _bvector.h:161
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
__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
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
size_type find_first_not_of(_CharT __c, size_type __pos=0) const
Definition: _string_sum.h:223
size_type find_first_not_of(const _BString &__s, size_type __pos=0) const
Definition: _string_sum.h:217
_BString & _M_get_storage(__bstr_sum< _CharT, _Traits, _Alloc, _Lhs, _Rhs, _StorageDir > const &__ref, __on_right const &)
Definition: _string_sum.h:263
_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
size_type find_last_not_of(_CharT __c, size_type __pos=_BString::npos) const
Definition: _string_sum.h:232
bool empty() const
Definition: _string_sum.h:114
int compare(size_type __pos1, size_type __n1, const _CharT *__s) const
Definition: _string_sum.h:247
size_type find_last_of(const _CharT *__s, size_type __pos, size_type __n) const
Definition: _string_sum.h:212
size_type rfind(const _BString &__s, size_type __pos=_BString::npos) const
Definition: _string_sum.h:194
allocator_type get_allocator() const
Definition: _string_sum.h:102
_BString & insert(size_type __pos, const _BString &__s, size_type __beg, size_type __n)
Definition: _string_sum.h:158
__bstr_sum< _CharT, _Traits, _Alloc, _Self, __cstr_wrapper< _CharT >, __on_left > _CStrOnLeft
Definition: _string_sum.h:126
_BString & replace(size_type __pos1, size_type __n1, const _BString &__s, size_type __pos2, size_type __n2)
Definition: _string_sum.h:170
size_type rfind(_CharT __c, size_type __pos=_BString::npos) const
Definition: _string_sum.h:197
_BString & assign(const _CharT *__s)
Definition: _string_sum.h:153
size_type capacity() const
Definition: _string_sum.h:113
_BString & replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
Definition: _string_sum.h:176
const_reverse_iterator rend() const
Definition: _string_sum.h:107
size_type size() const
Definition: _string_sum.h:109
_BString & erase(size_type __pos=0, size_type __n=_BString::npos)
Definition: _string_sum.h:165
size_type find_first_not_of(const _CharT *__s, size_type __pos, size_type __n) const
Definition: _string_sum.h:221
_BString & append(const _BString &__s, size_type __pos, size_type __n)
Definition: _string_sum.h:135
_BStrOnLeft operator+=(const _BString &__s)
Definition: _string_sum.h:124
_BString & _M_get_storage()
Definition: _string_sum.h:254
size_type copy(_CharT *__s, size_type __n, size_type __pos=0) const
Definition: _string_sum.h:179
_Left const & getLhs() const
Definition: _string_sum.h:99
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
size_type find(_CharT __c, size_type __pos=0) const
Definition: _string_sum.h:192
_BString::allocator_type allocator_type
Definition: _string_sum.h:93
_BString & insert(size_type __pos, const _BString &__s)
Definition: _string_sum.h:157
const _CharT * data() const
Definition: _string_sum.h:186
_BString & _M_get_storage(__bstr_sum< _CharT, _Traits, _Alloc, _Lhs, _Rhs, _StorageDir > const &__ref)
Definition: _string_sum.h:268
int compare(const _CharT *__s) const
Definition: _string_sum.h:245
__bstr_sum< _CharT, _Traits, _Alloc, _Self, __bstr_wrapper< _CharT, _Traits, _Alloc >, __on_left > _BStrOnLeft
Definition: _string_sum.h:123
__bstr_sum(_Left const &lhs, _Right const &rhs)
Definition: _string_sum.h:96
int compare(size_type __pos1, size_type __n1, const _CharT *__s, size_type __n2) const
Definition: _string_sum.h:249
int compare(size_type __pos1, size_type __n1, const _Self &__s, size_type __pos2, size_type __n2) const
Definition: _string_sum.h:243
const_reverse_iterator rbegin() const
Definition: _string_sum.h:106
_BString const & _M_get_storage(bool __do_init=true) const
Definition: _string_sum.h:272
const_reference at(size_type __n) const
Definition: _string_sum.h:119
basic_string< _CharT, _Traits, _Alloc > _BString
Definition: _string_sum.h:88
size_type find_last_not_of(const _CharT *__s, size_type __pos=_BString::npos) const
Definition: _string_sum.h:228
int compare(const _BString &__s) const
Definition: _string_sum.h:239
_BString::const_iterator const_iterator
Definition: _string_sum.h:90
size_t max_size() const
Definition: _string_sum.h:112
_BString::const_reference const_reference
Definition: _string_sum.h:89
_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
_BString & assign(const _BString &__s, size_type __pos, size_type __n)
Definition: _string_sum.h:151
size_type length() const
Definition: _string_sum.h:110
void swap(_BString &__s)
Definition: _string_sum.h:182
size_type find_first_of(const _CharT *__s, size_type __pos, size_type __n) const
Definition: _string_sum.h:203
_Left _lhs
Definition: _string_sum.h:291
_BString::size_type size_type
Definition: _string_sum.h:92
size_type find_last_of(const _CharT *__s, size_type __pos=_BString::npos) const
Definition: _string_sum.h:210
_BString & assign(const _CharT *__s, size_type __n)
Definition: _string_sum.h:152
size_type find_last_not_of(const _BString &__s, size_type __pos=_BString::npos) const
Definition: _string_sum.h:226
_Right _rhs
Definition: _string_sum.h:292
_BString & assign(size_type __n, _CharT __c)
Definition: _string_sum.h:154
_BString & replace(size_type __pos, size_type __n1, const _CharT *__s)
Definition: _string_sum.h:174
const_iterator end() const
Definition: _string_sum.h:105
size_type rfind(const _CharT *__s, size_type __pos=_BString::npos) const
Definition: _string_sum.h:195
size_type find_first_of(_CharT __c, size_type __pos=0) const
Definition: _string_sum.h:205
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
size_type find_last_of(_CharT __c, size_type __pos=_BString::npos) const
Definition: _string_sum.h:214
__bstr_sum< _CharT, _Traits, _Alloc, _Self, __char_wrapper< _CharT >, __on_left > _CharOnLeft
Definition: _string_sum.h:129
_BString & assign(const _BString &__s)
Definition: _string_sum.h:150
_BString substr(size_type __pos=0, size_type __n=_BString::npos) const
Definition: _string_sum.h:235
__bstr_sum< _CharT, _Traits, _Alloc, _Left, _Right, _StorageDirection > _Self
Definition: _string_sum.h:94
_BString & insert(size_type __pos, const _CharT *__s, size_type __n)
Definition: _string_sum.h:160
const_reference operator[](size_t __n) const
Definition: _string_sum.h:116
_BString & append(_InputIter __first, _InputIter __last)
Definition: _string_sum.h:146
_BString & append(size_type __n, _CharT __c)
Definition: _string_sum.h:143
_BString & insert(size_type __pos, size_type __n, _CharT __c)
Definition: _string_sum.h:162
_CStrOnLeft append(const _CharT *__s)
Definition: _string_sum.h:137
size_type find_first_not_of(const _CharT *__s, size_type __pos=0) const
Definition: _string_sum.h:219
size_type find(const _CharT *__s, size_type __pos, size_type __n) const
Definition: _string_sum.h:191
size_type find_last_not_of(const _CharT *__s, size_type __pos, size_type __n) const
Definition: _string_sum.h:230
size_type find(const _BString &__s, size_type __pos=0) const
Definition: _string_sum.h:189
int compare(size_type __pos1, size_type __n1, const _Self &__s) const
Definition: _string_sum.h:241
const_iterator begin() const
Definition: _string_sum.h:104
_BString::const_reverse_iterator const_reverse_iterator
Definition: _string_sum.h:91
size_type find_first_of(const _CharT *__s, size_type __pos=0) const
Definition: _string_sum.h:201
_BString & insert(size_type __pos, const _CharT *__s)
Definition: _string_sum.h:161
_CStrOnLeft append(const _CharT *__s, size_type __n)
Definition: _string_sum.h:141
size_type rfind(const _CharT *__s, size_type __pos, size_type __n) const
Definition: _string_sum.h:196
_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 & replace(size_type __pos, size_type __n1, const _CharT *__s, size_type __n2)
Definition: _string_sum.h:172
size_type find_last_of(const _BString &__s, size_type __pos=_BString::npos) const
Definition: _string_sum.h:208
_Right const & getRhs() const
Definition: _string_sum.h:100
_BStrOnLeft append(const _BString &__s)
Definition: _string_sum.h:133
_BString & replace(size_type __pos, size_type __n, const _BString &__s)
Definition: _string_sum.h:168
size_type find_first_of(const _Self &__s, size_type __pos=0) const
Definition: _string.h:976
void swap(_Self &__s)
Definition: _string.h:942
reverse_iterator rend()
Definition: _string.h:392
iterator end()
Definition: _string.h:386
_Self & erase(size_type __pos=0, size_type __n=npos)
Definition: _string.h:788
const_reference at(size_type __n) const
Definition: _string.h:437
_Self & replace(size_type __pos, size_type __n, const _Self &__s)
Definition: _string.h:813
size_type find_first_not_of(const _Self &__s, size_type __pos=0) const
Definition: _string.h:1000
_Base::size_type size_type
Definition: _string.h:138
size_type find_last_not_of(const _Self &__s, size_type __pos=npos) const
Definition: _string.h:1011
_Self substr(size_type __pos=0, size_type __n=npos) const
Definition: _string.h:1022
const _CharT * c_str() const
Definition: _string.h:949
const value_type * const_iterator
Definition: _string.h:142
size_type find(const _Self &__s, size_type __pos=0) const
Definition: _string.h:953
_Self & assign(const _Self &__s)
Definition: _string.h:548
size_type copy(_CharT *__s, size_type __n, size_type __pos=0) const
Definition: _string.h:933
int compare(const _Self &__s) const
Definition: _string.h:1026
reverse_iterator rbegin()
Definition: _string.h:390
size_type rfind(const _Self &__s, size_type __pos=npos) const
Definition: _string.h:966
size_type max_size() const
Definition: _string.h:402
_Self & insert(size_type __pos, const _Self &__s)
Definition: _string.h:608
size_type size() const
Definition: _string.h:400
_Base::allocator_type allocator_type
Definition: _string.h:152
_Self & append(const _CharT *__first, const _CharT *__last)
Definition: _string.h:509
const value_type & const_reference
Definition: _string.h:137
allocator_type get_allocator() const
Definition: _string.h:154
const _CharT * data() const
Definition: _string.h:950
iterator begin()
Definition: _string.h:385
size_type find_last_of(const _Self &__s, size_type __pos=npos) const
Definition: _string.h:988
#define _STLP_MUTABLE(type, x)
Definition: features.h:634
#define _STLP_MOVE_TO_STD_NAMESPACE
Definition: features.h:525
#define __STATIC_CAST(__x, __y)
Definition: features.h:585
#define _STLP_BEGIN_NAMESPACE
Definition: features.h:501
#define _STLP_END_NAMESPACE
Definition: features.h:503
#define _STLP_MOVE_TO_PRIV_NAMESPACE
Definition: features.h:524
#define __c
Definition: schilyio.h:209
#define false
Definition: stdbool.h:37
_BString const & b_str() const
Definition: _string_sum.h:74
__bstr_wrapper(_BString const &__s)
Definition: _string_sum.h:67
_BString const & _BStr
Definition: _string_sum.h:77
basic_string< _CharT, _Traits, _Alloc > _BString
Definition: _string_sum.h:65
size_t size() const
Definition: _string_sum.h:70
const _CharT & const_reference
Definition: _string_sum.h:64
const_reference operator[](size_t __n) const
Definition: _string_sum.h:72
size_t size() const
Definition: _string_sum.h:31
const _CharT & const_reference
Definition: _string_sum.h:26
const_reference operator[](size_t __n) const
Definition: _string_sum.h:33
_CharT getValue() const
Definition: _string_sum.h:30
__char_wrapper(_CharT __val)
Definition: _string_sum.h:28
const_reference operator[](size_t __n) const
Definition: _string_sum.h:54
const _CharT * c_str() const
Definition: _string_sum.h:50
__cstr_wrapper(const _CharT *__cstr, size_t __size)
Definition: _string_sum.h:47
const _CharT * _CStr
Definition: _string_sum.h:57
const _CharT & const_reference
Definition: _string_sum.h:45
size_t size() const
Definition: _string_sum.h:52
_CharT const & operator[](size_t __n) const
Definition: _string_sum.h:402
_BString & _M_get_storage(__bstr_sum< _CharT, _Traits, _Alloc, _Left, _Right, _StorageDir > const &__ref)
Definition: _string_sum.h:396
void _M_Init(__bstr_sum< _CharT, _Traits, _Alloc, _Left, _Right, _StorageDir > const &__ref) const
Definition: _string_sum.h:380
__sum_storage_elem< _CharT, _Traits, _Alloc > _Self
Definition: _string_sum.h:373
basic_string< _CharT, _Traits, _Alloc > _M_storage
Definition: _string_sum.h:407
basic_string< _CharT, _Traits, _Alloc > _BString
Definition: _string_sum.h:374
_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_t size() const
Definition: _string_sum.h:401
__sum_storage_elem(_Alloc __alloc)
Definition: _string_sum.h:376