30 #ifndef _VSTRING_UTIL_H
31 #define _VSTRING_UTIL_H 1
33 #pragma GCC system_header
47 namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
49 _GLIBCXX_BEGIN_NAMESPACE_VERSION
51 template<
typename _CharT,
typename _Traits,
typename _Alloc>
52 struct __vstring_utility
54 typedef typename __alloc_traits<_Alloc>::template rebind<_CharT>::other
56 typedef __alloc_traits<_CharT_alloc_type> _CharT_alloc_traits;
58 typedef _Traits traits_type;
59 typedef typename _Traits::char_type value_type;
60 typedef typename _CharT_alloc_type::size_type size_type;
61 typedef typename _CharT_alloc_type::difference_type difference_type;
62 typedef typename _CharT_alloc_traits::pointer pointer;
63 typedef typename _CharT_alloc_traits::const_pointer const_pointer;
67 __normal_iterator<pointer, __gnu_cxx::
68 __versa_string<_CharT, _Traits, _Alloc,
72 __normal_iterator<const_pointer, __gnu_cxx::
73 __versa_string<_CharT, _Traits, _Alloc,
79 __normal_iterator<pointer, __gnu_cxx::
80 __versa_string<_CharT, _Traits, _Alloc,
84 __normal_iterator<const_pointer, __gnu_cxx::
85 __versa_string<_CharT, _Traits, _Alloc,
91 template<
typename _Alloc1>
95 _Alloc_hider(_CharT* __ptr)
96 : _Alloc1(), _M_p(__ptr) { }
98 _Alloc_hider(
const _Alloc1& __a, _CharT* __ptr)
99 : _Alloc1(__a), _M_p(__ptr) { }
107 _S_copy(_CharT* __d,
const _CharT* __s, size_type __n)
110 traits_type::assign(*__d, *__s);
112 traits_type::copy(__d, __s, __n);
116 _S_move(_CharT* __d,
const _CharT* __s, size_type __n)
119 traits_type::assign(*__d, *__s);
121 traits_type::move(__d, __s, __n);
125 _S_assign(_CharT* __d, size_type __n, _CharT __c)
128 traits_type::assign(*__d, __c);
130 traits_type::assign(__d, __n, __c);
135 template<
typename _Iterator>
137 _S_copy_chars(_CharT* __p, _Iterator __k1, _Iterator __k2)
139 for (; __k1 != __k2; ++__k1, ++__p)
140 traits_type::assign(*__p, *__k1);
144 _S_copy_chars(_CharT* __p, __sso_iterator __k1, __sso_iterator __k2)
145 { _S_copy_chars(__p, __k1.base(), __k2.base()); }
148 _S_copy_chars(_CharT* __p, __const_sso_iterator __k1,
149 __const_sso_iterator __k2)
150 { _S_copy_chars(__p, __k1.base(), __k2.base()); }
153 _S_copy_chars(_CharT* __p, __rc_iterator __k1, __rc_iterator __k2)
154 { _S_copy_chars(__p, __k1.base(), __k2.base()); }
157 _S_copy_chars(_CharT* __p, __const_rc_iterator __k1,
158 __const_rc_iterator __k2)
159 { _S_copy_chars(__p, __k1.base(), __k2.base()); }
162 _S_copy_chars(_CharT* __p, _CharT* __k1, _CharT* __k2)
163 { _S_copy(__p, __k1, __k2 - __k1); }
166 _S_copy_chars(_CharT* __p,
const _CharT* __k1,
const _CharT* __k2)
167 { _S_copy(__p, __k1, __k2 - __k1); }
170 _S_compare(size_type __n1, size_type __n2)
172 const difference_type __d = difference_type(__n1 - __n2);
174 if (__d > __numeric_traits_integer<int>::__max)
175 return __numeric_traits_integer<int>::__max;
176 else if (__d < __numeric_traits_integer<int>::__min)
177 return __numeric_traits_integer<int>::__min;
183 _GLIBCXX_END_NAMESPACE_VERSION
GNU extensions for public use.