33 #pragma GCC system_header
40 namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
42 _GLIBCXX_BEGIN_NAMESPACE_VERSION
52 template<
typename _CharT,
typename _Traits,
typename _Alloc,
53 template <
typename,
typename,
typename>
class _Base>
55 :
private _Base<_CharT, _Traits, _Alloc>
57 typedef _Base<_CharT, _Traits, _Alloc> __vstring_base;
58 typedef typename __vstring_base::_CharT_alloc_type _CharT_alloc_type;
62 typedef _Traits traits_type;
63 typedef typename _Traits::char_type value_type;
64 typedef _Alloc allocator_type;
65 typedef typename _CharT_alloc_type::size_type size_type;
66 typedef typename _CharT_alloc_type::difference_type difference_type;
67 typedef value_type& reference;
68 typedef const value_type& const_reference;
69 typedef typename _CharT_alloc_type::pointer pointer;
70 typedef typename _CharT_alloc_type::const_pointer const_pointer;
71 typedef __gnu_cxx::__normal_iterator<pointer, __versa_string> iterator;
72 typedef __gnu_cxx::__normal_iterator<const_pointer, __versa_string>
79 static const size_type
npos =
static_cast<size_type
>(-1);
83 _M_check(size_type __pos,
const char* __s)
const
85 if (__pos > this->
size())
86 std::__throw_out_of_range(__N(__s));
91 _M_check_length(size_type __n1, size_type __n2,
const char* __s)
const
94 std::__throw_length_error(__N(__s));
99 _M_limit(size_type __pos, size_type __off)
const
101 const bool __testoff = __off < this->
size() - __pos;
102 return __testoff ? __off : this->
size() - __pos;
107 _M_disjunct(
const _CharT* __s)
const
111 + this->
size(), __s));
118 {
return iterator(this->_M_data()); }
122 {
return iterator(this->_M_data() + this->_M_length()); }
133 : __vstring_base() { }
140 : __vstring_base(__a) { }
148 : __vstring_base(__str) { }
150 #ifdef __GXX_EXPERIMENTAL_CXX0X__
160 : __vstring_base(std::move(__str)) { }
168 const _Alloc& __a = _Alloc())
169 : __vstring_base(__l.
begin(), __l.
end(), __a) { }
179 size_type __n =
npos)
180 : __vstring_base(__str._M_data()
181 + __str._M_check(__pos,
182 "__versa_string::__versa_string"),
183 __str._M_data() + __str._M_limit(__pos, __n)
184 + __pos, _Alloc()) { }
194 size_type __n,
const _Alloc& __a)
195 : __vstring_base(__str._M_data()
196 + __str._M_check(__pos,
197 "__versa_string::__versa_string"),
198 __str._M_data() + __str._M_limit(__pos, __n)
211 const _Alloc& __a = _Alloc())
212 : __vstring_base(__s, __s + __n, __a) { }
220 : __vstring_base(__s, __s ? __s + traits_type::
length(__s) :
230 : __vstring_base(__n, __c, __a) { }
238 template<
class _InputIterator>
240 const _Alloc& __a = _Alloc())
241 : __vstring_base(__beg, __end, __a) { }
254 {
return this->
assign(__str); }
256 #ifdef __GXX_EXPERIMENTAL_CXX0X__
279 this->
assign(__l.begin(), __l.end());
290 {
return this->
assign(__s); }
315 return iterator(this->_M_data());
324 {
return const_iterator(this->_M_data()); }
334 return iterator(this->_M_data() + this->
size());
343 {
return const_iterator(this->_M_data() + this->
size()); }
359 const_reverse_iterator
377 const_reverse_iterator
381 #ifdef __GXX_EXPERIMENTAL_CXX0X__
388 {
return const_iterator(this->_M_data()); }
396 {
return const_iterator(this->_M_data() + this->
size()); }
403 const_reverse_iterator
412 const_reverse_iterator
423 {
return this->_M_length(); }
429 {
return this->_M_length(); }
434 {
return this->_M_max_size(); }
447 resize(size_type __n, _CharT __c);
461 { this->
resize(__n, _CharT()); }
463 #ifdef __GXX_EXPERIMENTAL_CXX0X__
481 {
return this->_M_capacity(); }
502 { this->_M_reserve(__res_arg); }
509 { this->_M_clear(); }
517 {
return this->
size() == 0; }
533 _GLIBCXX_DEBUG_ASSERT(__pos <= this->
size());
534 return this->_M_data()[__pos];
551 _GLIBCXX_DEBUG_ASSERT(__pos <= this->
size());
553 _GLIBCXX_DEBUG_PEDASSERT(__pos < this->
size());
555 return this->_M_data()[__pos];
569 at(size_type __n)
const
571 if (__n >= this->
size())
572 std::__throw_out_of_range(__N(
"__versa_string::at"));
573 return this->_M_data()[__n];
590 if (__n >= this->
size())
591 std::__throw_out_of_range(__N(
"__versa_string::at"));
593 return this->_M_data()[__n];
596 #ifdef __GXX_EXPERIMENTAL_CXX0X__
638 {
return this->
append(__str); }
647 {
return this->
append(__s); }
661 #ifdef __GXX_EXPERIMENTAL_CXX0X__
669 {
return this->
append(__l.begin(), __l.end()); }
670 #endif // __GXX_EXPERIMENTAL_CXX0X__
679 {
return _M_append(__str._M_data(), __str.
size()); }
696 {
return _M_append(__str._M_data()
697 + __str._M_check(__pos,
"__versa_string::append"),
698 __str._M_limit(__pos, __n)); }
709 __glibcxx_requires_string_len(__s, __n);
710 _M_check_length(size_type(0), __n,
"__versa_string::append");
711 return _M_append(__s, __n);
722 __glibcxx_requires_string(__s);
723 const size_type __n = traits_type::length(__s);
724 _M_check_length(size_type(0), __n,
"__versa_string::append");
725 return _M_append(__s, __n);
738 {
return _M_replace_aux(this->
size(), size_type(0), __n, __c); }
740 #ifdef __GXX_EXPERIMENTAL_CXX0X__
748 {
return this->
append(__l.begin(), __l.end()); }
749 #endif // __GXX_EXPERIMENTAL_CXX0X__
759 template<
class _InputIterator>
761 append(_InputIterator __first, _InputIterator __last)
762 {
return this->
replace(_M_iend(), _M_iend(), __first, __last); }
771 const size_type __size = this->
size();
772 if (__size + 1 > this->
capacity() || this->_M_is_shared())
773 this->_M_mutate(__size, size_type(0), 0, size_type(1));
774 traits_type::assign(this->_M_data()[__size], __c);
775 this->_M_set_length(__size + 1);
786 this->_M_assign(__str);
790 #ifdef __GXX_EXPERIMENTAL_CXX0X__
805 #endif // __GXX_EXPERIMENTAL_CXX0X__
822 {
return _M_replace(size_type(0), this->
size(), __str._M_data()
823 + __str._M_check(__pos,
"__versa_string::assign"),
824 __str._M_limit(__pos, __n)); }
840 __glibcxx_requires_string_len(__s, __n);
841 return _M_replace(size_type(0), this->
size(), __s, __n);
856 __glibcxx_requires_string(__s);
857 return _M_replace(size_type(0), this->
size(), __s,
858 traits_type::length(__s));
872 {
return _M_replace_aux(size_type(0), this->
size(), __n, __c); }
883 template<
class _InputIterator>
885 assign(_InputIterator __first, _InputIterator __last)
886 {
return this->
replace(_M_ibegin(), _M_iend(), __first, __last); }
888 #ifdef __GXX_EXPERIMENTAL_CXX0X__
896 {
return this->
assign(__l.begin(), __l.end()); }
897 #endif // __GXX_EXPERIMENTAL_CXX0X__
913 insert(iterator __p, size_type __n, _CharT __c)
914 { this->
replace(__p, __p, __n, __c); }
928 template<
class _InputIterator>
930 insert(iterator __p, _InputIterator __beg, _InputIterator __end)
931 { this->
replace(__p, __p, __beg, __end); }
933 #ifdef __GXX_EXPERIMENTAL_CXX0X__
942 { this->
insert(__p, __l.begin(), __l.end()); }
943 #endif // __GXX_EXPERIMENTAL_CXX0X__
959 {
return this->
replace(__pos1, size_type(0),
960 __str._M_data(), __str.
size()); }
982 size_type __pos2, size_type __n)
983 {
return this->
replace(__pos1, size_type(0), __str._M_data()
984 + __str._M_check(__pos2,
"__versa_string::insert"),
985 __str._M_limit(__pos2, __n)); }
1004 insert(size_type __pos,
const _CharT* __s, size_type __n)
1005 {
return this->
replace(__pos, size_type(0), __s, __n); }
1025 __glibcxx_requires_string(__s);
1026 return this->
replace(__pos, size_type(0), __s,
1027 traits_type::length(__s));
1047 insert(size_type __pos, size_type __n, _CharT __c)
1048 {
return _M_replace_aux(_M_check(__pos,
"__versa_string::insert"),
1049 size_type(0), __n, __c); }
1067 _GLIBCXX_DEBUG_PEDASSERT(__p >= _M_ibegin() && __p <= _M_iend());
1068 const size_type __pos = __p - _M_ibegin();
1069 _M_replace_aux(__pos, size_type(0), size_type(1), __c);
1070 this->_M_set_leaked();
1071 return iterator(this->_M_data() + __pos);
1092 this->_M_erase(_M_check(__pos,
"__versa_string::erase"),
1093 _M_limit(__pos, __n));
1108 _GLIBCXX_DEBUG_PEDASSERT(__position >= _M_ibegin()
1109 && __position < _M_iend());
1110 const size_type __pos = __position - _M_ibegin();
1111 this->_M_erase(__pos, size_type(1));
1112 this->_M_set_leaked();
1113 return iterator(this->_M_data() + __pos);
1127 erase(iterator __first, iterator __last)
1129 _GLIBCXX_DEBUG_PEDASSERT(__first >= _M_ibegin() && __first <= __last
1130 && __last <= _M_iend());
1131 const size_type __pos = __first - _M_ibegin();
1132 this->_M_erase(__pos, __last - __first);
1133 this->_M_set_leaked();
1134 return iterator(this->_M_data() + __pos);
1156 {
return this->
replace(__pos, __n, __str._M_data(), __str.
size()); }
1179 size_type __pos2, size_type __n2)
1181 return this->
replace(__pos1, __n1, __str._M_data()
1182 + __str._M_check(__pos2,
1183 "__versa_string::replace"),
1184 __str._M_limit(__pos2, __n2));
1206 replace(size_type __pos, size_type __n1,
const _CharT* __s,
1209 __glibcxx_requires_string_len(__s, __n2);
1210 return _M_replace(_M_check(__pos,
"__versa_string::replace"),
1211 _M_limit(__pos, __n1), __s, __n2);
1230 replace(size_type __pos, size_type __n1,
const _CharT* __s)
1232 __glibcxx_requires_string(__s);
1233 return this->
replace(__pos, __n1, __s, traits_type::length(__s));
1254 replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
1255 {
return _M_replace_aux(_M_check(__pos,
"__versa_string::replace"),
1256 _M_limit(__pos, __n1), __n2, __c); }
1273 {
return this->
replace(__i1, __i2, __str._M_data(), __str.
size()); }
1290 replace(iterator __i1, iterator __i2,
const _CharT* __s, size_type __n)
1292 _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
1293 && __i2 <= _M_iend());
1294 return this->
replace(__i1 - _M_ibegin(), __i2 - __i1, __s, __n);
1311 replace(iterator __i1, iterator __i2,
const _CharT* __s)
1313 __glibcxx_requires_string(__s);
1314 return this->
replace(__i1, __i2, __s, traits_type::length(__s));
1332 replace(iterator __i1, iterator __i2, size_type __n, _CharT __c)
1334 _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
1335 && __i2 <= _M_iend());
1336 return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __c);
1353 template<
class _InputIterator>
1356 _InputIterator __k1, _InputIterator __k2)
1358 _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
1359 && __i2 <= _M_iend());
1360 __glibcxx_requires_valid_range(__k1, __k2);
1361 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
1362 return this->_M_replace_dispatch(__i1, __i2, __k1, __k2, _Integral());
1370 _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
1371 && __i2 <= _M_iend());
1372 __glibcxx_requires_valid_range(__k1, __k2);
1373 return this->
replace(__i1 - _M_ibegin(), __i2 - __i1,
1378 replace(iterator __i1, iterator __i2,
1379 const _CharT* __k1,
const _CharT* __k2)
1381 _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
1382 && __i2 <= _M_iend());
1383 __glibcxx_requires_valid_range(__k1, __k2);
1384 return this->
replace(__i1 - _M_ibegin(), __i2 - __i1,
1389 replace(iterator __i1, iterator __i2, iterator __k1, iterator __k2)
1391 _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
1392 && __i2 <= _M_iend());
1393 __glibcxx_requires_valid_range(__k1, __k2);
1394 return this->
replace(__i1 - _M_ibegin(), __i2 - __i1,
1395 __k1.base(), __k2 - __k1);
1399 replace(iterator __i1, iterator __i2,
1400 const_iterator __k1, const_iterator __k2)
1402 _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
1403 && __i2 <= _M_iend());
1404 __glibcxx_requires_valid_range(__k1, __k2);
1405 return this->
replace(__i1 - _M_ibegin(), __i2 - __i1,
1406 __k1.base(), __k2 - __k1);
1409 #ifdef __GXX_EXPERIMENTAL_CXX0X__
1425 {
return this->
replace(__i1, __i2, __l.begin(), __l.end()); }
1426 #endif // __GXX_EXPERIMENTAL_CXX0X__
1429 template<
class _Integer>
1432 _Integer __val, std::__true_type)
1433 {
return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __val); }
1435 template<
class _InputIterator>
1437 _M_replace_dispatch(iterator __i1, iterator __i2, _InputIterator __k1,
1438 _InputIterator __k2, std::__false_type);
1441 _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2,
1445 _M_replace(size_type __pos, size_type __len1,
const _CharT* __s,
1446 const size_type __len2);
1449 _M_append(
const _CharT* __s, size_type __n);
1466 copy(_CharT* __s, size_type __n, size_type __pos = 0)
const;
1477 { this->_M_swap(__s); }
1488 {
return this->_M_data(); }
1498 {
return this->_M_data(); }
1505 {
return allocator_type(this->_M_get_allocator()); }
1520 find(
const _CharT* __s, size_type __pos, size_type __n)
const;
1534 {
return this->
find(__str.
data(), __pos, __str.
size()); }
1547 find(
const _CharT* __s, size_type __pos = 0)
const
1549 __glibcxx_requires_string(__s);
1550 return this->
find(__s, __pos, traits_type::length(__s));
1564 find(_CharT __c, size_type __pos = 0)
const;
1593 rfind(
const _CharT* __s, size_type __pos, size_type __n)
const;
1608 __glibcxx_requires_string(__s);
1609 return this->
rfind(__s, __pos, traits_type::length(__s));
1623 rfind(_CharT __c, size_type __pos =
npos)
const;
1652 find_first_of(
const _CharT* __s, size_type __pos, size_type __n)
const;
1667 __glibcxx_requires_string(__s);
1668 return this->
find_first_of(__s, __pos, traits_type::length(__s));
1685 {
return this->
find(__c, __pos); }
1715 find_last_of(
const _CharT* __s, size_type __pos, size_type __n)
const;
1730 __glibcxx_requires_string(__s);
1731 return this->
find_last_of(__s, __pos, traits_type::length(__s));
1748 {
return this->
rfind(__c, __pos); }
1778 size_type __n)
const;
1793 __glibcxx_requires_string(__s);
1823 size_type __pos =
npos)
const
1840 size_type __n)
const;
1855 __glibcxx_requires_string(__s);
1887 return __versa_string(*
this, _M_check(__pos,
"__versa_string::substr"),
1908 if (this->_M_compare(__str))
1911 const size_type __size = this->
size();
1912 const size_type __osize = __str.
size();
1913 const size_type __len =
std::min(__size, __osize);
1915 int __r = traits_type::compare(this->_M_data(), __str.
data(), __len);
1917 __r = this->_S_compare(__size, __osize);
1941 compare(size_type __pos, size_type __n,
1969 size_type __pos2, size_type __n2)
const;
1987 compare(
const _CharT* __s)
const;
2011 compare(size_type __pos, size_type __n1,
const _CharT* __s)
const;
2038 compare(size_type __pos, size_type __n1,
const _CharT* __s,
2039 size_type __n2)
const;
2049 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2050 template <
typename,
typename,
typename>
class _Base>
2051 __versa_string<_CharT, _Traits, _Alloc, _Base>
2052 operator+(
const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
2053 const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs);
2061 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2062 template <
typename,
typename,
typename>
class _Base>
2063 __versa_string<_CharT, _Traits, _Alloc, _Base>
2064 operator+(
const _CharT* __lhs,
2065 const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs);
2073 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2074 template <
typename,
typename,
typename>
class _Base>
2075 __versa_string<_CharT, _Traits, _Alloc, _Base>
2076 operator+(_CharT __lhs,
2077 const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs);
2085 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2086 template <
typename,
typename,
typename>
class _Base>
2087 __versa_string<_CharT, _Traits, _Alloc, _Base>
2088 operator+(
const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
2089 const _CharT* __rhs);
2097 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2098 template <
typename,
typename,
typename>
class _Base>
2099 __versa_string<_CharT, _Traits, _Alloc, _Base>
2100 operator+(
const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
2103 #ifdef __GXX_EXPERIMENTAL_CXX0X__
2104 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2105 template <
typename,
typename,
typename>
class _Base>
2106 inline __versa_string<_CharT, _Traits, _Alloc, _Base>
2107 operator+(__versa_string<_CharT, _Traits, _Alloc, _Base>&& __lhs,
2108 const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
2109 {
return std::move(__lhs.append(__rhs)); }
2111 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2112 template <
typename,
typename,
typename>
class _Base>
2113 inline __versa_string<_CharT, _Traits, _Alloc, _Base>
2114 operator+(
const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
2115 __versa_string<_CharT, _Traits, _Alloc, _Base>&& __rhs)
2116 {
return std::move(__rhs.insert(0, __lhs)); }
2118 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2119 template <
typename,
typename,
typename>
class _Base>
2120 inline __versa_string<_CharT, _Traits, _Alloc, _Base>
2121 operator+(__versa_string<_CharT, _Traits, _Alloc, _Base>&& __lhs,
2122 __versa_string<_CharT, _Traits, _Alloc, _Base>&& __rhs)
2124 const auto __size = __lhs.size() + __rhs.size();
2125 const bool __cond = (__size > __lhs.capacity()
2126 && __size <= __rhs.capacity());
2127 return __cond ? std::move(__rhs.insert(0, __lhs))
2128 : std::move(__lhs.append(__rhs));
2131 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2132 template <
typename,
typename,
typename>
class _Base>
2133 inline __versa_string<_CharT, _Traits, _Alloc, _Base>
2134 operator+(
const _CharT* __lhs,
2135 __versa_string<_CharT, _Traits, _Alloc, _Base>&& __rhs)
2136 {
return std::move(__rhs.insert(0, __lhs)); }
2138 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2139 template <
typename,
typename,
typename>
class _Base>
2140 inline __versa_string<_CharT, _Traits, _Alloc, _Base>
2141 operator+(_CharT __lhs,
2142 __versa_string<_CharT, _Traits, _Alloc, _Base>&& __rhs)
2143 {
return std::move(__rhs.insert(0, 1, __lhs)); }
2145 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2146 template <
typename,
typename,
typename>
class _Base>
2147 inline __versa_string<_CharT, _Traits, _Alloc, _Base>
2148 operator+(__versa_string<_CharT, _Traits, _Alloc, _Base>&& __lhs,
2149 const _CharT* __rhs)
2150 {
return std::move(__lhs.append(__rhs)); }
2152 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2153 template <
typename,
typename,
typename>
class _Base>
2154 inline __versa_string<_CharT, _Traits, _Alloc, _Base>
2155 operator+(__versa_string<_CharT, _Traits, _Alloc, _Base>&& __lhs,
2157 {
return std::move(__lhs.append(1, __rhs)); }
2167 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2168 template <
typename,
typename,
typename>
class _Base>
2172 {
return __lhs.
compare(__rhs) == 0; }
2174 template<
typename _CharT,
2175 template <
typename,
typename,
typename>
class _Base>
2176 inline typename __enable_if<std::__is_char<_CharT>::__value,
bool>::__type
2181 {
return (__lhs.size() == __rhs.size()
2191 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2192 template <
typename,
typename,
typename>
class _Base>
2194 operator==(
const _CharT* __lhs,
2196 {
return __rhs.
compare(__lhs) == 0; }
2204 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2205 template <
typename,
typename,
typename>
class _Base>
2208 const _CharT* __rhs)
2209 {
return __lhs.
compare(__rhs) == 0; }
2218 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2219 template <
typename,
typename,
typename>
class _Base>
2223 {
return !(__lhs == __rhs); }
2231 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2232 template <
typename,
typename,
typename>
class _Base>
2234 operator!=(
const _CharT* __lhs,
2236 {
return !(__lhs == __rhs); }
2244 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2245 template <
typename,
typename,
typename>
class _Base>
2248 const _CharT* __rhs)
2249 {
return !(__lhs == __rhs); }
2258 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2259 template <
typename,
typename,
typename>
class _Base>
2261 operator<(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
2263 {
return __lhs.
compare(__rhs) < 0; }
2271 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2272 template <
typename,
typename,
typename>
class _Base>
2274 operator<(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
2275 const _CharT* __rhs)
2276 {
return __lhs.compare(__rhs) < 0; }
2284 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2285 template <
typename,
typename,
typename>
class _Base>
2287 operator<(
const _CharT* __lhs,
2289 {
return __rhs.
compare(__lhs) > 0; }
2298 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2299 template <
typename,
typename,
typename>
class _Base>
2303 {
return __lhs.
compare(__rhs) > 0; }
2311 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2312 template <
typename,
typename,
typename>
class _Base>
2315 const _CharT* __rhs)
2316 {
return __lhs.
compare(__rhs) > 0; }
2324 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2325 template <
typename,
typename,
typename>
class _Base>
2327 operator>(
const _CharT* __lhs,
2329 {
return __rhs.
compare(__lhs) < 0; }
2338 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2339 template <
typename,
typename,
typename>
class _Base>
2341 operator<=(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
2343 {
return __lhs.
compare(__rhs) <= 0; }
2351 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2352 template <
typename,
typename,
typename>
class _Base>
2354 operator<=(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
2355 const _CharT* __rhs)
2356 {
return __lhs.compare(__rhs) <= 0; }
2364 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2365 template <
typename,
typename,
typename>
class _Base>
2367 operator<=(
const _CharT* __lhs,
2369 {
return __rhs.
compare(__lhs) >= 0; }
2378 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2379 template <
typename,
typename,
typename>
class _Base>
2383 {
return __lhs.
compare(__rhs) >= 0; }
2391 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2392 template <
typename,
typename,
typename>
class _Base>
2395 const _CharT* __rhs)
2396 {
return __lhs.
compare(__rhs) >= 0; }
2404 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2405 template <
typename,
typename,
typename>
class _Base>
2407 operator>=(
const _CharT* __lhs,
2409 {
return __rhs.
compare(__lhs) <= 0; }
2418 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2419 template <
typename,
typename,
typename>
class _Base>
2423 { __lhs.
swap(__rhs); }
2425 _GLIBCXX_END_NAMESPACE_VERSION
2428 namespace std _GLIBCXX_VISIBILITY(default)
2430 _GLIBCXX_BEGIN_NAMESPACE_VERSION
2444 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2445 template <
typename,
typename,
typename>
class _Base>
2446 basic_istream<_CharT, _Traits>&
2447 operator>>(basic_istream<_CharT, _Traits>& __is,
2449 _Alloc, _Base>& __str);
2460 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2461 template <
typename,
typename,
typename>
class _Base>
2462 inline basic_ostream<_CharT, _Traits>&
2463 operator<<(basic_ostream<_CharT, _Traits>& __os,
2469 return __ostream_insert(__os, __str.data(), __str.size());
2486 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2487 template <
typename,
typename,
typename>
class _Base>
2488 basic_istream<_CharT, _Traits>&
2489 getline(basic_istream<_CharT, _Traits>& __is,
2506 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2507 template <
typename,
typename,
typename>
class _Base>
2508 inline basic_istream<_CharT, _Traits>&
2513 _GLIBCXX_END_NAMESPACE_VERSION
2516 #if (defined(__GXX_EXPERIMENTAL_CXX0X__) && defined(_GLIBCXX_USE_C99))
2520 namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
2522 _GLIBCXX_BEGIN_NAMESPACE_VERSION
2526 stoi(
const __vstring& __str, std::size_t* __idx = 0,
int __base = 10)
2527 {
return __gnu_cxx::__stoa<long, int>(&std::strtol,
"stoi", __str.c_str(),
2531 stol(
const __vstring& __str, std::size_t* __idx = 0,
int __base = 10)
2532 {
return __gnu_cxx::__stoa(&std::strtol,
"stol", __str.c_str(),
2535 inline unsigned long
2536 stoul(
const __vstring& __str, std::size_t* __idx = 0,
int __base = 10)
2537 {
return __gnu_cxx::__stoa(&std::strtoul,
"stoul", __str.c_str(),
2541 stoll(
const __vstring& __str, std::size_t* __idx = 0,
int __base = 10)
2542 {
return __gnu_cxx::__stoa(&std::strtoll,
"stoll", __str.c_str(),
2545 inline unsigned long long
2546 stoull(
const __vstring& __str, std::size_t* __idx,
int __base = 10)
2547 {
return __gnu_cxx::__stoa(&std::strtoull,
"stoull", __str.c_str(),
2552 stof(
const __vstring& __str, std::size_t* __idx = 0)
2553 {
return __gnu_cxx::__stoa(&std::strtof,
"stof", __str.c_str(), __idx); }
2556 stod(
const __vstring& __str, std::size_t* __idx = 0)
2557 {
return __gnu_cxx::__stoa(&std::strtod,
"stod", __str.c_str(), __idx); }
2560 stold(
const __vstring& __str, std::size_t* __idx = 0)
2561 {
return __gnu_cxx::__stoa(&std::strtold,
"stold", __str.c_str(), __idx); }
2568 {
return __gnu_cxx::__to_xstring<__vstring>(&std::vsnprintf, 4 *
sizeof(int),
2573 {
return __gnu_cxx::__to_xstring<__vstring>(&std::vsnprintf,
2574 4 *
sizeof(unsigned),
2579 {
return __gnu_cxx::__to_xstring<__vstring>(&std::vsnprintf,
2585 {
return __gnu_cxx::__to_xstring<__vstring>(&std::vsnprintf,
2586 4 *
sizeof(
unsigned long),
2592 {
return __gnu_cxx::__to_xstring<__vstring>(&std::vsnprintf,
2593 4 *
sizeof(
long long),
2598 {
return __gnu_cxx::__to_xstring<__vstring>(&std::vsnprintf,
2599 4 *
sizeof(
unsigned long long),
2605 const int __n = __numeric_traits<float>::__max_exponent10 + 20;
2606 return __gnu_cxx::__to_xstring<__vstring>(&std::vsnprintf, __n,
2613 const int __n = __numeric_traits<double>::__max_exponent10 + 20;
2614 return __gnu_cxx::__to_xstring<__vstring>(&std::vsnprintf, __n,
2621 const int __n = __numeric_traits<long double>::__max_exponent10 + 20;
2622 return __gnu_cxx::__to_xstring<__vstring>(&std::vsnprintf, __n,
2626 #ifdef _GLIBCXX_USE_WCHAR_T
2628 stoi(
const __wvstring& __str, std::size_t* __idx = 0,
int __base = 10)
2629 {
return __gnu_cxx::__stoa<long, int>(&std::wcstol,
"stoi", __str.c_str(),
2633 stol(
const __wvstring& __str, std::size_t* __idx = 0,
int __base = 10)
2634 {
return __gnu_cxx::__stoa(&std::wcstol,
"stol", __str.c_str(),
2637 inline unsigned long
2638 stoul(
const __wvstring& __str, std::size_t* __idx = 0,
int __base = 10)
2639 {
return __gnu_cxx::__stoa(&std::wcstoul,
"stoul", __str.c_str(),
2643 stoll(
const __wvstring& __str, std::size_t* __idx = 0,
int __base = 10)
2644 {
return __gnu_cxx::__stoa(&std::wcstoll,
"stoll", __str.c_str(),
2647 inline unsigned long long
2648 stoull(
const __wvstring& __str, std::size_t* __idx = 0,
int __base = 10)
2649 {
return __gnu_cxx::__stoa(&std::wcstoull,
"stoull", __str.c_str(),
2654 stof(
const __wvstring& __str, std::size_t* __idx = 0)
2655 {
return __gnu_cxx::__stoa(&std::wcstof,
"stof", __str.c_str(), __idx); }
2658 stod(
const __wvstring& __str, std::size_t* __idx = 0)
2659 {
return __gnu_cxx::__stoa(&std::wcstod,
"stod", __str.c_str(), __idx); }
2662 stold(
const __wvstring& __str, std::size_t* __idx = 0)
2663 {
return __gnu_cxx::__stoa(&std::wcstold,
"stold", __str.c_str(), __idx); }
2665 #ifndef _GLIBCXX_HAVE_BROKEN_VSWPRINTF
2668 to_wstring(
int __val)
2669 {
return __gnu_cxx::__to_xstring<__wvstring>(&std::vswprintf,
2674 to_wstring(
unsigned __val)
2675 {
return __gnu_cxx::__to_xstring<__wvstring>(&std::vswprintf,
2676 4 *
sizeof(unsigned),
2680 to_wstring(
long __val)
2681 {
return __gnu_cxx::__to_xstring<__wvstring>(&std::vswprintf,
2686 to_wstring(
unsigned long __val)
2687 {
return __gnu_cxx::__to_xstring<__wvstring>(&std::vswprintf,
2688 4 *
sizeof(
unsigned long),
2692 to_wstring(
long long __val)
2693 {
return __gnu_cxx::__to_xstring<__wvstring>(&std::vswprintf,
2694 4 *
sizeof(
long long),
2698 to_wstring(
unsigned long long __val)
2699 {
return __gnu_cxx::__to_xstring<__wvstring>(&std::vswprintf,
2700 4 *
sizeof(
unsigned long long),
2704 to_wstring(
float __val)
2706 const int __n = __numeric_traits<float>::__max_exponent10 + 20;
2707 return __gnu_cxx::__to_xstring<__wvstring>(&std::vswprintf, __n,
2712 to_wstring(
double __val)
2714 const int __n = __numeric_traits<double>::__max_exponent10 + 20;
2715 return __gnu_cxx::__to_xstring<__wvstring>(&std::vswprintf, __n,
2720 to_wstring(
long double __val)
2722 const int __n = __numeric_traits<long double>::__max_exponent10 + 20;
2723 return __gnu_cxx::__to_xstring<__wvstring>(&std::vswprintf, __n,
2729 _GLIBCXX_END_NAMESPACE_VERSION
2734 #ifdef __GXX_EXPERIMENTAL_CXX0X__
2738 namespace std _GLIBCXX_VISIBILITY(default)
2740 _GLIBCXX_BEGIN_NAMESPACE_VERSION
2745 :
public __hash_base<size_t, __gnu_cxx::__vstring>
2749 {
return std::_Hash_impl::hash(__s.
data(), __s.
length()); }
2752 #ifdef _GLIBCXX_USE_WCHAR_T
2756 :
public __hash_base<size_t, __gnu_cxx::__wvstring>
2760 {
return std::_Hash_impl::hash(__s.
data(),
2761 __s.
length() *
sizeof(wchar_t)); }
2765 #ifdef _GLIBCXX_USE_C99_STDINT_TR1
2768 struct hash<__gnu_cxx::__u16vstring>
2769 :
public __hash_base<size_t, __gnu_cxx::__u16vstring>
2773 {
return std::_Hash_impl::hash(__s.
data(),
2774 __s.
length() *
sizeof(char16_t)); }
2779 struct hash<__gnu_cxx::__u32vstring>
2780 :
public __hash_base<size_t, __gnu_cxx::__u32vstring>
2784 {
return std::_Hash_impl::hash(__s.
data(),
2785 __s.
length() *
sizeof(char32_t)); }
2789 _GLIBCXX_END_NAMESPACE_VERSION
__versa_string & replace(iterator __i1, iterator __i2, std::initializer_list< _CharT > __l)
Replace range of characters with initializer_list.
__versa_string & operator=(_CharT __c)
Set value to string of length 1.
size_type rfind(const _CharT *__s, size_type __pos=npos) const
Find last position of a C string.
Basis for explicit traits specializations.
size_type find_last_of(const _CharT *__s, size_type __pos=npos) const
Find last position of a character of C string.
const_reverse_iterator rend() const
void reserve(size_type __res_arg=0)
Attempt to preallocate enough memory for specified number of characters.
size_type find_last_not_of(const _CharT *__s, size_type __pos=npos) const
Find last position of a character not in C string.
const_iterator cbegin() const
size_type find_first_of(const __versa_string &__str, size_type __pos=0) const
Find position of a character of string.
const_reverse_iterator crend() const
static const size_type npos
Value returned by various member functions when they fail.
basic_istream< _CharT, _Traits > & getline(basic_istream< _CharT, _Traits > &__is, basic_string< _CharT, _Traits, _Alloc > &__str, _CharT __delim)
Read a line from stream into a string.
const_iterator begin() const
size_type capacity() const
const_reverse_iterator rbegin() const
const_iterator end() const
__versa_string & replace(iterator __i1, iterator __i2, _InputIterator __k1, _InputIterator __k2)
Replace range of characters with range.
__versa_string & replace(iterator __i1, iterator __i2, const _CharT *__s, size_type __n)
Replace range of characters with C substring.
__versa_string & operator=(const _CharT *__s)
Copy contents of __s into this string.
__versa_string & replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
Replace characters with multiple characters.
__versa_string(const __versa_string &__str)
Construct string with copy of value of str.
__versa_string & operator=(std::initializer_list< _CharT > __l)
Set value to string constructed from initializer list.
void insert(iterator __p, size_type __n, _CharT __c)
Insert multiple characters.
__versa_string & append(size_type __n, _CharT __c)
Append multiple characters.
void push_back(_CharT __c)
Append a single character.
__versa_string & replace(iterator __i1, iterator __i2, const _CharT *__s)
Replace range of characters with C string.
size_type find_last_of(const __versa_string &__str, size_type __pos=npos) const
Find last position of a character of string.
int compare(const __versa_string &__str) const
Compare to a string.
__versa_string(_InputIterator __beg, _InputIterator __end, const _Alloc &__a=_Alloc())
Construct string as copy of a range.
__versa_string & insert(size_type __pos, const _CharT *__s)
Insert a C string.
__versa_string & append(std::initializer_list< _CharT > __l)
Append an initializer_list of characters.
size_type find_first_of(const _CharT *__s, size_type __pos=0) const
Find position of a character of C string.
__versa_string & assign(const __versa_string &__str)
Set value to contents of another string.
__versa_string & insert(size_type __pos, size_type __n, _CharT __c)
Insert multiple characters.
void insert(iterator __p, _InputIterator __beg, _InputIterator __end)
Insert a range of characters.
bitset< _Nb > operator>>(size_t __position) const
Self-explanatory.
__versa_string(std::initializer_list< _CharT > __l, const _Alloc &__a=_Alloc())
Construct string from an initializer list.
void resize(size_type __n)
Resizes the string to the specified number of characters.
Controlling input.This is the base class for all input streams. It provides text formatting of all bu...
const _CharT * c_str() const
Return const pointer to null-terminated contents.
__versa_string & operator+=(std::initializer_list< _CharT > __l)
Append an initializer_list of characters.
__versa_string substr(size_type __pos=0, size_type __n=npos) const
Get a substring.
__versa_string & replace(iterator __i1, iterator __i2, const __versa_string &__str)
Replace range of characters with string.
_Siter_base< _Iterator >::iterator_type __base(_Iterator __it)
size_type find_last_not_of(const __versa_string &__str, size_type __pos=npos) const
Find last position of a character not in string.
__versa_string(size_type __n, _CharT __c, const _Alloc &__a=_Alloc())
Construct string as multiple characters.
__versa_string & assign(const __versa_string &__str, size_type __pos, size_type __n)
Set value to a substring of a string.
~__versa_string()
Destroy the string instance.
Primary class template hash.
__versa_string & operator=(const __versa_string &__str)
Assign the value of str to this string.
__versa_string & replace(iterator __i1, iterator __i2, size_type __n, _CharT __c)
Replace range of characters with multiple characters.
__versa_string & assign(const _CharT *__s)
Set value to contents of a C string.
allocator_type get_allocator() const
Return copy of allocator used to construct this string.
size_type find_first_of(_CharT __c, size_type __pos=0) const
Find position of a character.
std::basic_string< _CharT, _Traits, _Alloc > to_string() const
Returns a character interpretation of the bitset.
size_type rfind(const __versa_string &__str, size_type __pos=npos) const
Find last position of a string.
__versa_string()
Default constructor creates an empty string.
void resize(size_type __n, _CharT __c)
Resizes the string to the specified number of characters.
__versa_string & replace(size_type __pos1, size_type __n1, const __versa_string &__str, size_type __pos2, size_type __n2)
Replace characters with value from another string.
__versa_string & append(const _CharT *__s)
Append a C string.
__versa_string & replace(size_type __pos, size_type __n, const __versa_string &__str)
Replace characters with value from another string.
__versa_string & append(_InputIterator __first, _InputIterator __last)
Append a range of characters.
size_type find(const __versa_string &__str, size_type __pos=0) const
Find position of a string.
reverse_iterator rbegin()
iterator erase(iterator __position)
Remove one character.
const_reference back() const
__versa_string & replace(size_type __pos, size_type __n1, const _CharT *__s)
Replace characters with value of a C string.
Template class __versa_string.Data structure managing sequences of characters and character-like obje...
__versa_string & append(const _CharT *__s, size_type __n)
Append a C substring.
const _CharT * data() const
Return const pointer to contents.
iterator insert(iterator __p, _CharT __c)
Insert one character.
__versa_string & insert(size_type __pos1, const __versa_string &__str, size_type __pos2, size_type __n)
Insert a substring.
__versa_string(const _CharT *__s, const _Alloc &__a=_Alloc())
Construct string as copy of a C string.
__versa_string & assign(_InputIterator __first, _InputIterator __last)
Set value to a range of characters.
reference operator[](size_type __pos)
Subscript access to the data contained in the string.
__versa_string & operator+=(_CharT __c)
Append a character.
__versa_string & assign(size_type __n, _CharT __c)
Set value to multiple characters.
size_type find(const _CharT *__s, size_type __pos, size_type __n) const
Find position of a C substring.
const_iterator cend() const
size_type find_last_of(_CharT __c, size_type __pos=npos) const
Find last position of a character.
const_reference at(size_type __n) const
Provides access to the data contained in the string.
size_type length() const
Returns the number of characters in the string, not including any null-termination.
iterator erase(iterator __first, iterator __last)
Remove a range of characters.
__versa_string(__versa_string &&__str)
String move constructor.
size_type copy(_CharT *__s, size_type __n, size_type __pos=0) const
Copy substring into C string.
size_type find_first_not_of(const _CharT *__s, size_type __pos=0) const
Find position of a character not in C string.
One of the comparison functors.
void swap(__versa_string &__s)
Swap contents with another string.
__versa_string & erase(size_type __pos=0, size_type __n=npos)
Remove characters.
void shrink_to_fit()
A non-binding request to reduce capacity() to size().
__versa_string & insert(size_type __pos1, const __versa_string &__str)
Insert value of a string.
__versa_string & append(const __versa_string &__str, size_type __pos, size_type __n)
Append a substring.
__versa_string(const __versa_string &__str, size_type __pos, size_type __n=npos)
Construct string as copy of a substring.
size_type max_size() const
Returns the size() of the largest possible string.
const _Tp & min(const _Tp &, const _Tp &)
This does what you think it does.
__versa_string & operator+=(const __versa_string &__str)
Append a string to this string.
reference at(size_type __n)
Provides access to the data contained in the string.
size_type find(const _CharT *__s, size_type __pos=0) const
Find position of a C string.
__versa_string & operator+=(const _CharT *__s)
Append a C string.
__versa_string & append(const __versa_string &__str)
Append a string to this string.
__versa_string & assign(std::initializer_list< _CharT > __l)
Set value to an initializer_list of characters.
const_reference operator[](size_type __pos) const
Subscript access to the data contained in the string.
The standard allocator, as per [20.4].Further details: http://gcc.gnu.org/onlinedocs/libstdc++/manual...
void insert(iterator __p, std::initializer_list< _CharT > __l)
Insert an initializer_list of characters.
__versa_string(const _CharT *__s, size_type __n, const _Alloc &__a=_Alloc())
Construct string initialized by a character array.
__versa_string & insert(size_type __pos, const _CharT *__s, size_type __n)
Insert a C substring.
__versa_string(const _Alloc &__a)
Construct an empty string using allocator a.
const_reverse_iterator crbegin() const
__versa_string & assign(__versa_string &&__str)
Set value to contents of another string.
__versa_string & assign(const _CharT *__s, size_type __n)
Set value to a C substring.
size_type find_first_not_of(const __versa_string &__str, size_type __pos=0) const
Find position of a character not in string.
char_type widen(char __c) const
Widens characters.
const_reference front() const
__versa_string(const __versa_string &__str, size_type __pos, size_type __n, const _Alloc &__a)
Construct string as copy of a substring.
__versa_string & replace(size_type __pos, size_type __n1, const _CharT *__s, size_type __n2)
Replace characters with value of a C substring.
__versa_string & operator=(__versa_string &&__str)
String move assignment operator.
size_type size() const
Returns the number of characters in the string, not including any null-termination.