ReactOS  0.4.14-dev-323-g6fe6a88
_string_sum_methods.h File Reference

Go to the source code of this file.

Functions

template<class _Left , class _Right , class _StorageDir >
 basic_string (_STLP_PRIV __bstr_sum< _CharT, _Traits, _Alloc, _Left, _Right, _StorageDir > const &__s)
 
template<class _Left , class _Right , class _StorageDir >
 basic_string (_STLP_PRIV __bstr_sum< _CharT, _Traits, _Alloc, _Left, _Right, _StorageDir > const &__s, size_type __pos, size_type __n=npos, const allocator_type &__a=allocator_type())
 
_CharT * _M_append_fast (_STLP_PRIV __char_wrapper< _CharT > __c, _CharT *__buf)
 
_CharT * _M_append_fast (_CharT const *__s, size_type __s_size, _CharT *__buf)
 
_CharT * _M_append_fast (_STLP_PRIV __cstr_wrapper< _CharT > const &__s, _CharT *__buf)
 
_CharT * _M_append_fast (_STLP_PRIV __bstr_wrapper< _CharT, _Traits, _Alloc > __s, _CharT *__buf)
 
_CharT * _M_append_fast (_Self const &__s, _CharT *__buf)
 
_CharT * _M_append_fast (_STLP_PRIV __sum_storage_elem< _CharT, _Traits, _Alloc > const &, _CharT *__buf)
 
template<class _Left , class _Right , class _StorageDir >
_CharT * _M_append_fast (_STLP_PRIV __bstr_sum< _CharT, _Traits, _Alloc, _Left, _Right, _StorageDir > const &__s, _CharT *__buf)
 
_CharT * _M_append_fast_pos (_STLP_PRIV __char_wrapper< _CharT > __c, _CharT *__buf, size_type, size_type __n)
 
_CharT * _M_append_fast_pos (_CharT const *__s, size_type __s_size, _CharT *__buf, size_type __pos, size_type __n)
 
_CharT * _M_append_fast_pos (_STLP_PRIV __cstr_wrapper< _CharT > const &__s, _CharT *__buf, size_type __pos, size_type __n)
 
_CharT * _M_append_fast_pos (_STLP_PRIV __bstr_wrapper< _CharT, _Traits, _Alloc > __s, _CharT *__buf, size_type __pos, size_type __n)
 
_CharT * _M_append_fast_pos (_Self const &__s, _CharT *__buf, size_type __pos, size_type __n)
 
_CharT * _M_append_fast_pos (_STLP_PRIV __sum_storage_elem< _CharT, _Traits, _Alloc > const &, _CharT *__buf, size_type, size_type)
 
template<class _Left , class _Right , class _StorageDir >
_CharT * _M_append_fast_pos (_STLP_PRIV __bstr_sum< _CharT, _Traits, _Alloc, _Left, _Right, _StorageDir > const &__s, _CharT *__buf, size_type __pos, size_type __n)
 
template<class _Left , class _Right , class _StorageDir >
_Self & _M_append_sum (_STLP_PRIV __bstr_sum< _CharT, _Traits, _Alloc, _Left, _Right, _StorageDir > const &__s)
 
template<class _Left , class _Right , class _StorageDir >
_Self & _M_append_sum_pos (_STLP_PRIV __bstr_sum< _CharT, _Traits, _Alloc, _Left, _Right, _StorageDir > const &__s, size_type __pos, size_type __n)
 
template<class _Left , class _Right , class _StorageDir >
void _M_append_sum_no_overflow (_STLP_PRIV __bstr_sum< _CharT, _Traits, _Alloc, _Left, _Right, _StorageDir > const &__s, size_type __pos, size_type __n)
 

Function Documentation

◆ _M_append_fast() [1/7]

_CharT* _M_append_fast ( _STLP_PRIV __char_wrapper< _CharT >  __c,
_CharT *  __buf 
)
private

Definition at line 41 of file _string_sum_methods.h.

41  {
42  _STLP_STD::_Copy_Construct(__buf, __c.getValue());
43  return __buf + 1;
44  }
#define __c
Definition: schilyio.h:209
void _Copy_Construct(_Tp *__p, const _Tp &__val)
Definition: _construct.h:130

Referenced by _M_append_fast(), and _M_append_sum().

◆ _M_append_fast() [2/7]

_CharT* _M_append_fast ( _CharT const __s,
size_type  __s_size,
_CharT *  __buf 
)
private

Definition at line 45 of file _string_sum_methods.h.

46  { return uninitialized_copy(__s, __s + __s_size, __buf); }
_STLP_MOVE_TO_STD_NAMESPACE _ForwardIter uninitialized_copy(_InputIter __first, _InputIter __last, _ForwardIter __result)

◆ _M_append_fast() [3/7]

_CharT* _M_append_fast ( _STLP_PRIV __cstr_wrapper< _CharT > const __s,
_CharT *  __buf 
)
private

Definition at line 47 of file _string_sum_methods.h.

48  { return _M_append_fast(__s.c_str(), __s.size(), __buf); }
_CharT * _M_append_fast(_STLP_PRIV __char_wrapper< _CharT > __c, _CharT *__buf)

◆ _M_append_fast() [4/7]

_CharT* _M_append_fast ( _STLP_PRIV __bstr_wrapper< _CharT, _Traits, _Alloc __s,
_CharT *  __buf 
)
private

Definition at line 49 of file _string_sum_methods.h.

50  { return _M_append_fast(__s.b_str(), __buf); }
_CharT * _M_append_fast(_STLP_PRIV __char_wrapper< _CharT > __c, _CharT *__buf)

◆ _M_append_fast() [5/7]

_CharT* _M_append_fast ( _Self const __s,
_CharT *  __buf 
)
private

Definition at line 51 of file _string_sum_methods.h.

52  { return _M_append_fast(__s.data(), __s.size(), __buf); }
_CharT * _M_append_fast(_STLP_PRIV __char_wrapper< _CharT > __c, _CharT *__buf)

◆ _M_append_fast() [6/7]

_CharT* _M_append_fast ( _STLP_PRIV __sum_storage_elem< _CharT, _Traits, _Alloc > const ,
_CharT *  __buf 
)
private

Definition at line 53 of file _string_sum_methods.h.

54  { return __buf; }

◆ _M_append_fast() [7/7]

template<class _Left , class _Right , class _StorageDir >
_CharT* _M_append_fast ( _STLP_PRIV __bstr_sum< _CharT, _Traits, _Alloc, _Left, _Right, _StorageDir > const __s,
_CharT *  __buf 
)
private

Definition at line 56 of file _string_sum_methods.h.

57  { return _M_append_fast(__s.getRhs(), _M_append_fast(__s.getLhs(), __buf)); }
_CharT * _M_append_fast(_STLP_PRIV __char_wrapper< _CharT > __c, _CharT *__buf)

◆ _M_append_fast_pos() [1/7]

_CharT* _M_append_fast_pos ( _STLP_PRIV __char_wrapper< _CharT >  __c,
_CharT *  __buf,
size_type  ,
size_type  __n 
)
private

Definition at line 59 of file _string_sum_methods.h.

59  {
60  if (__n == 0)
61  return __buf;
62  _STLP_STD::_Copy_Construct(__buf, __c.getValue());
63  return __buf + 1;
64  }
return __n
Definition: _algo.h:75
#define __c
Definition: schilyio.h:209
void _Copy_Construct(_Tp *__p, const _Tp &__val)
Definition: _construct.h:130

Referenced by _M_append_fast_pos(), _M_append_sum_no_overflow(), and _M_append_sum_pos().

◆ _M_append_fast_pos() [2/7]

_CharT* _M_append_fast_pos ( _CharT const __s,
size_type  __s_size,
_CharT *  __buf,
size_type  __pos,
size_type  __n 
)
private

Definition at line 65 of file _string_sum_methods.h.

67  { return uninitialized_copy(__s + __pos, __s + __pos + (min)(__n, __s_size - __pos), __buf); }
return __n
Definition: _algo.h:75
_STLP_MOVE_TO_STD_NAMESPACE _ForwardIter uninitialized_copy(_InputIter __first, _InputIter __last, _ForwardIter __result)
#define min(a, b)
Definition: monoChain.cc:55

◆ _M_append_fast_pos() [3/7]

_CharT* _M_append_fast_pos ( _STLP_PRIV __cstr_wrapper< _CharT > const __s,
_CharT *  __buf,
size_type  __pos,
size_type  __n 
)
private

Definition at line 68 of file _string_sum_methods.h.

70  { return _M_append_fast_pos(__s.c_str(), __s.size(), __buf, __pos, __n); }
return __n
Definition: _algo.h:75
_CharT * _M_append_fast_pos(_STLP_PRIV __char_wrapper< _CharT > __c, _CharT *__buf, size_type, size_type __n)

◆ _M_append_fast_pos() [4/7]

_CharT* _M_append_fast_pos ( _STLP_PRIV __bstr_wrapper< _CharT, _Traits, _Alloc __s,
_CharT *  __buf,
size_type  __pos,
size_type  __n 
)
private

Definition at line 71 of file _string_sum_methods.h.

73  { return _M_append_fast_pos(__s.b_str(), __buf, __pos, __n); }
return __n
Definition: _algo.h:75
_CharT * _M_append_fast_pos(_STLP_PRIV __char_wrapper< _CharT > __c, _CharT *__buf, size_type, size_type __n)

◆ _M_append_fast_pos() [5/7]

_CharT* _M_append_fast_pos ( _Self const __s,
_CharT *  __buf,
size_type  __pos,
size_type  __n 
)
private

Definition at line 74 of file _string_sum_methods.h.

76  { return _M_append_fast_pos(__s.data(), __s.size(), __buf, __pos, __n); }
return __n
Definition: _algo.h:75
_CharT * _M_append_fast_pos(_STLP_PRIV __char_wrapper< _CharT > __c, _CharT *__buf, size_type, size_type __n)

◆ _M_append_fast_pos() [6/7]

_CharT* _M_append_fast_pos ( _STLP_PRIV __sum_storage_elem< _CharT, _Traits, _Alloc > const ,
_CharT *  __buf,
size_type  ,
size_type   
)
private

Definition at line 77 of file _string_sum_methods.h.

79  { return __buf; }

◆ _M_append_fast_pos() [7/7]

template<class _Left , class _Right , class _StorageDir >
_CharT* _M_append_fast_pos ( _STLP_PRIV __bstr_sum< _CharT, _Traits, _Alloc, _Left, _Right, _StorageDir > const __s,
_CharT *  __buf,
size_type  __pos,
size_type  __n 
)
private

Definition at line 82 of file _string_sum_methods.h.

83  {
84  if (__n == 0) {
85  return __buf;
86  }
87  size_type __lhs_size = __s.getLhs().size();
88  if (__pos < __lhs_size) {
89  if (__n < (__lhs_size - __pos)) {
90  return _M_append_fast_pos(__s.getLhs(), __buf, __pos, __n);
91  } else {
92  return _M_append_fast_pos(__s.getRhs(), _M_append_fast_pos(__s.getLhs(), __buf, __pos, __n),
93  0, __n - (__lhs_size - __pos));
94  }
95  } else {
96  return _M_append_fast_pos(__s.getRhs(), __buf, __pos - __lhs_size, __n);
97  }
98  }
return __n
Definition: _algo.h:75
_CharT * _M_append_fast_pos(_STLP_PRIV __char_wrapper< _CharT > __c, _CharT *__buf, size_type, size_type __n)

◆ _M_append_sum()

template<class _Left , class _Right , class _StorageDir >
_Self& _M_append_sum ( _STLP_PRIV __bstr_sum< _CharT, _Traits, _Alloc, _Left, _Right, _StorageDir > const __s)
private

Definition at line 101 of file _string_sum_methods.h.

101  {
102  size_type __s_size = __s.size();
103  if (__s_size == 0)
104  return *this;
105  const size_type __old_size = this->size();
106  if (__s_size > this->max_size() || __old_size > (this->max_size() - __s_size))
107  this->_M_throw_length_error();
108  if (__old_size + __s_size > this->capacity()) {
109  const size_type __len = __old_size + (max)(__old_size, __s_size) + 1;
110  pointer __new_start = this->_M_start_of_storage.allocate(__len);
111  pointer __new_finish = uninitialized_copy(this->_M_Start(), this->_M_Finish(), __new_start);
112  __new_finish = this->_M_append_fast(__s, __new_finish);
113  this->_M_construct_null(__new_finish);
114  this->_M_deallocate_block();
115  this->_M_reset(__new_start, __new_finish, __new_start + __len);
116  }
117  else {
118  _M_append_sum_no_overflow(__s, 0, __s_size);
119  }
120  return *this;
121  }
#define max(a, b)
Definition: svc.c:63
GLsizei const GLvoid * pointer
Definition: glext.h:5848
static INT max_size
Definition: history.c:51
void _M_append_sum_no_overflow(_STLP_PRIV __bstr_sum< _CharT, _Traits, _Alloc, _Left, _Right, _StorageDir > const &__s, size_type __pos, size_type __n)
_CharT * _M_append_fast(_STLP_PRIV __char_wrapper< _CharT > __c, _CharT *__buf)
_STLP_MOVE_TO_STD_NAMESPACE _ForwardIter uninitialized_copy(_InputIter __first, _InputIter __last, _ForwardIter __result)
GLsizeiptr size
Definition: glext.h:5919

Referenced by basic_string().

◆ _M_append_sum_no_overflow()

template<class _Left , class _Right , class _StorageDir >
void _M_append_sum_no_overflow ( _STLP_PRIV __bstr_sum< _CharT, _Traits, _Alloc, _Left, _Right, _StorageDir > const __s,
size_type  __pos,
size_type  __n 
)
private

Definition at line 148 of file _string_sum_methods.h.

149  {
150  pointer __finish = this->_M_Finish();
151  _M_append_fast_pos(__s, __finish + 1, __pos + 1, __n - 1);
152  this->_M_construct_null(__finish + __n);
153  _Traits::assign(*this->_M_finish, __s[__pos]);
154  this->_M_finish += __n;
155  }
return __n
Definition: _algo.h:75
GLsizei const GLvoid * pointer
Definition: glext.h:5848
_CharT * _M_append_fast_pos(_STLP_PRIV __char_wrapper< _CharT > __c, _CharT *__buf, size_type, size_type __n)

Referenced by _M_append_sum(), and _M_append_sum_pos().

◆ _M_append_sum_pos()

template<class _Left , class _Right , class _StorageDir >
_Self& _M_append_sum_pos ( _STLP_PRIV __bstr_sum< _CharT, _Traits, _Alloc, _Left, _Right, _StorageDir > const __s,
size_type  __pos,
size_type  __n 
)
private

Definition at line 124 of file _string_sum_methods.h.

125  {
126  size_type __s_size = (min)(__s.size() - __pos, __n);
127  if (__s_size == 0)
128  return *this;
129  const size_type __old_size = this->size();
130  if (__s_size > this->max_size() || __old_size > (this->max_size() - __s_size))
131  this->_M_throw_length_error();
132  if (__old_size + __s_size > this->capacity()) {
133  const size_type __len = __old_size + (max)(__old_size, __s_size) + 1;
134  pointer __new_start = this->_M_start_of_storage.allocate(__len);
135  pointer __new_finish = uninitialized_copy(this->_M_Start(), this->_M_Finish(), __new_start);
136  __new_finish = _M_append_fast_pos(__s, __new_finish, __pos, __s_size);
137  this->_M_construct_null(__new_finish);
138  this->_M_deallocate_block();
139  this->_M_reset(__new_start, __new_finish, __new_start + __len);
140  }
141  else {
142  _M_append_sum_no_overflow(__s, __pos, __s_size);
143  }
144  return *this;
145  }
#define max(a, b)
Definition: svc.c:63
return __n
Definition: _algo.h:75
GLsizei const GLvoid * pointer
Definition: glext.h:5848
static INT max_size
Definition: history.c:51
void _M_append_sum_no_overflow(_STLP_PRIV __bstr_sum< _CharT, _Traits, _Alloc, _Left, _Right, _StorageDir > const &__s, size_type __pos, size_type __n)
_STLP_MOVE_TO_STD_NAMESPACE _ForwardIter uninitialized_copy(_InputIter __first, _InputIter __last, _ForwardIter __result)
GLsizeiptr size
Definition: glext.h:5919
_CharT * _M_append_fast_pos(_STLP_PRIV __char_wrapper< _CharT > __c, _CharT *__buf, size_type, size_type __n)
#define min(a, b)
Definition: monoChain.cc:55

Referenced by basic_string().

◆ basic_string() [1/2]

template<class _Left , class _Right , class _StorageDir >
basic_string ( _STLP_PRIV __bstr_sum< _CharT, _Traits, _Alloc, _Left, _Right, _StorageDir > const __s)

Definition at line 24 of file _string_sum_methods.h.

25  : _STLP_STRING_SUM_BASE(_Reserve_t(), __s.size(), __s.get_allocator())
26  { _M_append_sum(__s); }
_Self & _M_append_sum(_STLP_PRIV __bstr_sum< _CharT, _Traits, _Alloc, _Left, _Right, _StorageDir > const &__s)

◆ basic_string() [2/2]

template<class _Left , class _Right , class _StorageDir >
basic_string ( _STLP_PRIV __bstr_sum< _CharT, _Traits, _Alloc, _Left, _Right, _StorageDir > const __s,
size_type  __pos,
size_type  __n = npos,
const allocator_type &  __a = allocator_type() 
)

Definition at line 29 of file _string_sum_methods.h.

32  : _STLP_STRING_SUM_BASE(_Reserve_t(), (__pos <= __s.size()) ? ((min) (__n, __s.size() - __pos)) : 0, __a) {
33  size_type __size = __s.size();
34  if (__pos > __size)
35  this->_M_throw_out_of_range();
36  else
37  _M_append_sum_pos(__s, __pos, (min) (__n, __size - __pos));
38  }
return __n
Definition: _algo.h:75
_Self & _M_append_sum_pos(_STLP_PRIV __bstr_sum< _CharT, _Traits, _Alloc, _Left, _Right, _StorageDir > const &__s, size_type __pos, size_type __n)
#define min(a, b)
Definition: monoChain.cc:55