43 #ifndef _RWSTD_STRING_INCLUDED
44 #define _RWSTD_STRING_INCLUDED
63 NAMESPACE_BENTLEY_BSTDCXX_BEGIN
65 #if defined _RWSTD_NO_EXTERN_MEMBER_TEMPLATE
66 # define _RWSTD_NO_STRING_OUTLINED_MEMBER_TEMPLATES
67 #endif // _RWSTD_NO_STRING_MEMBER_TEMPLATES
70 #ifdef _RWSTD_NO_STRING_OUTLINED_MEMBER_TEMPLATES
73 template <
class _CharT,
class _Traits,
class _Alloc,
74 class _StringIter,
class _InputIter>
77 _StringIter, _StringIter, _InputIter, _InputIter);
80 template <
class _CharT,
class _Traits,
class _Alloc,
81 class _StringIter,
class _InputIter>
84 _StringIter, _StringIter, _InputIter, _InputIter);
86 #endif // _RWSTD_NO_STRING_OUTLINED_MEMBER_TEMPLATES
91 template <
class _CharT,
class _Traits,
class _Allocator>
100 #if !defined (DOCUMENTATION_GENERATOR)
101 typedef BC__RW::__string_ref<value_type, traits_type, allocator_type>
114 typedef typename allocator_type::pointer
pointer;
117 #ifndef _RWSTD_NO_DEBUG_ITER
118 #error "we don't want debug iterators ... yet"
119 typedef BC__RW::__rw_debug_iter <basic_string, pointer, pointer>
122 typedef BC__RW::__rw_debug_iter <basic_string, const_pointer, pointer>
133 #else // if defined (_RWSTD_NO_DEBUG_ITER)
138 #if !defined (DOCUMENTATION_GENERATOR)
146 #endif // DOCUMENTATION_GENERATOR
148 #endif // _RWSTD_NO_DEBUG_ITER
151 #ifndef _RWSTD_NO_CLASS_PARTIAL_SPEC
156 #else // if defined (_RWSTD_NO_CLASS_PARTIAL_SPEC)
162 typedef std::reverse_iterator<
iterator,
167 #endif // _RWSTD_NO_CLASS_PARTIAL_SPEC
169 #ifndef _RWSTD_NO_STRING_NPOS_TYPE
171 #else // if defined (_RWSTD_NO_STRING_NPOS_TYPE)
178 explicit basic_string (
const allocator_type &__alloc = allocator_type ())
179 : allocator_type (__alloc), _C_data (_C_nullref ()->
data ()) { }
186 const allocator_type& = allocator_type ());
190 const allocator_type& = allocator_type ());
197 const allocator_type& = allocator_type ());
201 template <
class _InputIter>
203 const allocator_type &__alloc = allocator_type ())
204 : allocator_type (__alloc), _C_data (_C_nullref ()->
data ()) {
210 _RWSTD_REDECLARED_DEFAULT (allocator_type ()));
262 return _C_pref ()->size ();
278 return _C_pref ()->capacity ();
285 _C_unlink (_C_nullref ()->
data ());
287 traits_type::assign (_C_data [0],
value_type ());
288 _C_pref ()->_C_size._C_size = 0;
323 return append (__s, traits_type::length (__s));
326 template<
class _InputIter>
331 return append (__first, __last, _RWSTD_DISPATCH (_InputIter));
334 template<
class _InputIter>
338 __first, __last), *
this;
352 return *
this = __str;
366 template<
class _InputIter>
371 return assign (__first, __last, _RWSTD_DISPATCH (_InputIter));
374 template<
class _InputIter>
401 return insert (__pos, __s, traits_type::length (__s));
410 template<
class _InputIter>
412 insert (__p, __first, __last, _RWSTD_DISPATCH (_InputIter));
415 template <
class _InputIter>
419 replace (__p, __p, __first, __last);
429 if (__first >= _C_data && __first <= _C_data +
size ())
432 replace (__p, __p, __first, __last);
435 # ifndef _RWSTD_NO_DEBUG_ITER
440 if (!(__first == __last)) {
442 insert (__p, __pf, __pf + _C_off (__first, __last));
452 # endif // _RWSTD_NO_DEBUG_ITER
465 _RWSTD_ASSERT (__it !=
end ());
466 return erase (__it, __it + 1);
470 const size_type __pos = _C_off (__first);
480 return __x < __y ? __x : __y;
493 #if !defined (DOCUMENTATION_GENERATOR)
494 #ifndef _RWSTD_NO_STRING_OUTLINED_MEMBER_TEMPLATES
496 template <
class _InputIter>
501 template <
class _InputIter>
503 _InputIter __first2, _InputIter __last2) {
504 return __rw_replace_aux (*
this, __first1, __last1, __first2, __last2);
507 #endif // _RWSTD_NO_STRING_OUTLINED_MEMBER_TEMPLATES
511 #endif // DOCUMENTATION_GENERATOR
531 return replace (__pos, __n, __s, traits_type::length (__s));
541 return replace (_C_off (__first), _C_off (__first, __last), __str);
548 replace (_C_off (__first), _C_off (__first, __last), __s, __n);
555 return replace (__first, __last, __s, traits_type::length (__s));
561 return replace (_C_off (__first), _C_off (__first, __last), __n, __c);
564 #ifndef _RWSTD_NO_STRING_OUTLINED_MEMBER_TEMPLATES
566 template<
class _InputIter>
569 _InputIter __first2, _InputIter __last2,
void*);
571 #else // if defined (_RWSTD_NO_STRING_OUTLINED_MEMBER_TEMPLATES)
573 template<
class _InputIter>
576 _InputIter __first2, _InputIter __last2,
void*) {
577 return __rw_replace (*
this, __first1, __last1, __first2, __last2);
580 #endif // _RWSTD_NO_STRING_OUTLINED_MEMBER_TEMPLATES
585 return replace (_C_off (__first), _C_off (__first, __last), __n, __c);
589 template<
class _InputIter>
592 _InputIter __first2, _InputIter __last2) {
593 return replace (__first1, __last1, __first2, __last2,
594 _RWSTD_DISPATCH (_InputIter));
602 #ifndef _RWSTD_NO_EXT_DEEP_STRING_COPY
608 #endif //_RWSTD_NO_EXT_DEEP_STRING_COPY
613 _C_data = __s._C_data;
614 __s._C_data = __temp;
648 return find (__s, __pos, traits_type::length (__s));
664 return rfind (__s, __pos, traits_type::length (__s));
669 return rfind (&__c, __pos, 1);
683 return find_first_of (__s, __pos, traits_type::length (__s));
688 return find (__c, __pos);
702 return find_last_of (__s, __pos, traits_type::length (__s));
707 return rfind (__c, __pos);
773 return compare(__pos, __n, __s, traits_type::length (__s));
779 #if defined (_RWSTD_NO_PART_SPEC_OVERLOAD)
785 #ifndef _RWSTD_NO_STRING_OUTLINED_MEMBER_TEMPLATES
789 #else // if defined (_RWSTD_NO_STRING_OUTLINED_MEMBER_TEMPLATSE)
793 #endif // _RWSTD_NO_STRING_OUTLINED_MEMBER_TEMPLATES
797 _RWSTD_ASSERT_RANGE (__first, __last);
809 _C_string_ref_type* _C_pref ()
const {
812 return _RWSTD_STATIC_CAST (_C_string_ref_type*,
813 _RWSTD_STATIC_CAST (
void*, _C_data)) - 1;
820 #ifndef _RWSTD_NO_COLLAPSE_TEMPLATE_STATICS
822 static BC__RW::__null_ref<_CharT, _Traits, _Allocator> _C_null_ref;
824 static BC__RW::__null_ref<_CharT, _Traits, _Allocator>* _C_nullref () {
828 #else // if defined (_RWSTD_NO_COLLAPSE_TEMPLATE_STATICS)
831 static BC__RW::__null_ref<_CharT, _Traits, _Allocator>* _C_nullref () {
832 typedef BC__RW::__null_ref<_CharT, _Traits, _Allocator> _NullRef;
837 #endif // _RWSTD_NO_COLLAPSE_TEMPLATE_STATICS
844 #if !defined (DOCUMENTATION_GENERATOR)
845 #ifdef BENTLEY_CHANGE_REMOVED
848 #ifndef _RWSTD_NO_WCHAR_T
853 #endif // _RWSTD_NO_WCHAR_T
854 #endif //def BENTLEY_CHANGE_REMOVED
857 template <
class _CharT,
class _Traits ,
class _Allocator>
859 #if !defined (__GNUG__) \
860 || __GNUG__ > 3 || __GNUC_MINOR__ > 3 \
861 || !defined (__ia64__)
866 #endif // !gcc || gcc > 3.3 || !IA64
871 _RWSTD_ASSERT (0 != _C_data);
873 if (0 >= _C_pref ()->_C_dec_ref ()) {
883 const size_type __size =
884 capacity () +
sizeof (_C_string_ref_type) /
sizeof (value_type) + 2;
886 _C_pref ()->_C_destroy ();
888 _C_ref_alloc_type (*this).destroy (_C_pref ());
889 _RWSTD_VALUE_ALLOC (_C_value_alloc_type, *
this,
890 deallocate (_RWSTD_REINTERPRET_CAST (pointer,
899 template <
class _CharT,
class _Traits,
class _Alloc>
902 _C_grow (size_type __from, size_type __to)
const
904 const size_type __cap = _RWSTD_NEW_CAPACITY (
basic_string,
this, __from);
906 return __cap < __to ? __to : __cap;
909 template <
class _CharT,
class _Traits ,
class _Allocator>
915 _C_data = __s._C_data;
916 _C_pref ()->_C_inc_ref ();
920 _C_data = _C_get_rep (__n, __n)->data ();
921 traits_type::copy (_C_data, __s.
data (), __n);
924 _RWSTD_ASSERT (0 != _C_data);
927 template <
class _CharT,
class _Traits ,
class _Allocator>
932 if (size_type (1) < size_type (_C_pref ()->_C_get_ref ()))
939 _C_pref ()->_C_unref ();
941 return _C_make_iter (_C_data);
945 template <
class _CharT,
class _Traits ,
class _Allocator>
951 const size_type __ref_size =
952 1U +
sizeof (_C_string_ref_type) /
sizeof (_CharT);
954 return __max_chars < __ref_size ? 0 : __max_chars - __ref_size;
958 template <
class _CharT,
class _Traits ,
class _Allocator>
961 erase (size_type __pos, size_type __n)
963 _RWSTD_REQUIRES (__pos <=
size (),
964 std::out_of_range, (_RWSTD_ERROR_OUT_OF_RANGE,
965 _RWSTD_FUNC (
"basic_string::erase(size_type, size_type)"),
968 const value_type __tmp = value_type () ;
969 size_type __len =
size () - __pos;
970 return replace (__pos, __n < __len ? __n : __len, &__tmp, size_type ());
974 template <
class _CharT,
class _Traits ,
class _Allocator>
979 #ifdef _RWSTD_BOUNDS_CHECKING
981 _RWSTD_REQUIRES (__pos <=
size (),
982 std::out_of_range, (_RWSTD_ERROR_OUT_OF_RANGE,
983 _RWSTD_FUNC (
"basic_string::operator[](size_type) const"),
986 #endif // _RWSTD_BOUNDS_CHECKING
989 return _C_data [__pos];
993 template <
class _CharT,
class _Traits ,
class _Allocator>
998 #ifdef _RWSTD_BOUNDS_CHECKING
1001 _RWSTD_REQUIRES (__pos <
size (),
1002 std::out_of_range, (_RWSTD_ERROR_OUT_OF_RANGE,
1003 _RWSTD_FUNC (
"basic_string::operator[](size_type)"),
1006 #endif // _RWSTD_BOUNDS_CHECKING
1009 return begin ()[__pos];
1013 template <
class _CharT,
class _Traits ,
class _Allocator>
1016 at (size_type __pos)
const
1018 _RWSTD_REQUIRES (__pos <
size (),
1019 std::out_of_range, (_RWSTD_ERROR_OUT_OF_RANGE,
1020 _RWSTD_FUNC (
"basic_string::at (size_type) const"),
1024 return _C_data [__pos];
1028 template <
class _CharT,
class _Traits ,
class _Allocator>
1031 at (size_type __pos)
1033 _RWSTD_REQUIRES (__pos <
size (),
1034 std::out_of_range, (_RWSTD_ERROR_OUT_OF_RANGE,
1035 _RWSTD_FUNC (
"basic_string::at (size_type)"),
1039 return begin ()[__pos];
1043 template <
class _CharT,
class _Traits ,
class _Allocator>
1046 resize (size_type __n, value_type __c)
1048 _RWSTD_REQUIRES (__n <=
max_size (),
1049 std::length_error, (_RWSTD_ERROR_LENGTH_ERROR,
1050 _RWSTD_FUNC (
"basic_string::resize(size_type, "
1051 "value_type)"), __n,
max_size ()));
1056 replace (
size (), size_type (), __n -
size (), __c);
1060 template <
class _CharT,
class _Traits ,
class _Allocator>
1065 const size_type __size0 =
size ();
1066 const _RWSTD_SIZE_T __size1 = __size0 + 1;
1068 if ( capacity () < __size1
1069 || size_type (1) < size_type (_C_pref ()->_C_get_ref ())) {
1070 replace (
size (), size_type (), 1, __c);
1073 traits_type::assign (_C_data [__size0], __c);
1074 traits_type::assign (_C_data [__size1], value_type ());
1075 _C_pref ()->_C_size._C_size = __size1;
1080 template <
class _CharT,
class _Traits ,
class _Allocator>
1084 _RWSTD_REQUIRES (__cap <=
max_size (),
1085 std::length_error, (_RWSTD_ERROR_LENGTH_ERROR,
1086 _RWSTD_FUNC (
"basic_string::reserve(size_type)"),
1089 if (__cap > capacity ())
1094 template <
class _CharT,
class _Traits ,
class _Allocator>
1098 size_type __pos2, size_type __n2)
1100 _RWSTD_REQUIRES (__pos1 <=
size (),
1101 std::out_of_range, (_RWSTD_ERROR_OUT_OF_RANGE,
1102 _RWSTD_FUNC (
"basic_string::replace(size_type, "
1103 "size_type, const basic_string&, "
1104 "size_type, size_type)"),
1107 _RWSTD_REQUIRES (__pos2 <= __str.
size (),
1108 std::out_of_range, (_RWSTD_ERROR_OUT_OF_RANGE,
1109 _RWSTD_FUNC (
"basic_string::replace(size_type, "
1110 "size_type, const basic_string&, "
1111 "size_type, size_type)"),
1112 __pos2, __str.
size ()));
1114 const size_type __rem = __str.
size () - __pos2;
1116 replace (__pos1, __n1, __str.
data () + __pos2, __n2 < __rem ? __n2 : __rem);
1122 template <
class _CharT,
class _Traits ,
class _Allocator>
1125 find (value_type __c, size_type __pos)
const
1127 if (__pos >
size ())
1130 const const_pointer __where =
1133 return __where ? __where - _C_data : npos;
1137 template <
class _CharT,
class _Traits,
class _Allocator>
1142 const size_type __size =
size ();
1144 _C_string_ref_type*
const __temp =
1145 _C_get_rep (__cap, __size > __cap ? __cap : __size);
1147 traits_type::copy (__temp->data (), _C_data, __size);
1149 _C_unlink (__temp->data ());
1153 template <
class _CharT,
class _Traits,
class _Allocator>
1158 const size_type __n1 =
size ();
1159 const size_type __n2 = __str.
size ();
1160 const bool __first = __n1 < __n2;
1163 traits_type::compare (data (), __str.
data (), __first ? __n1 : __n2);
1165 return __res ? __res : __first ? -1 : int (__n1 != __n2);
1169 template <
class _CharT,
class _Traits,
class _Allocator>
1174 _RWSTD_REQUIRES (__pos <= __str.
size (),
1175 std::out_of_range, (_RWSTD_ERROR_OUT_OF_RANGE,
1176 _RWSTD_FUNC (
"basic_string::append(const basic_string&,"
1177 " size_type, size_type)"),
1178 __pos, __str.
size ()));
1180 const size_type __rlen = _C_min (__str.
size() - __pos, __n);
1182 return append (__str.
data () + __pos, __rlen);
1186 template <
class _CharT,
class _Traits,
class _Allocator>
1189 append (const_pointer __s, size_type __n)
1191 const size_type __size0 =
size ();
1192 const _RWSTD_SIZE_T __size1 = __size0 + __n;
1194 if ( capacity () <= __size1
1195 || size_type (1) < size_type (_C_pref ()->_C_get_ref ()))
1196 return replace (
size (), size_type (), __s, __n);
1198 traits_type::copy (_C_data + __size0, __s, __n);
1199 traits_type::assign (_C_data [__size1], value_type ());
1200 _C_pref ()->_C_size._C_size = __size1;
1206 template <
class _CharT,
class _Traits,
class _Allocator>
1209 append (size_type __n, value_type __c)
1211 const size_type __size0 =
size ();
1212 const _RWSTD_SIZE_T __size1 = __size0 + __n;
1214 if ( capacity () < __size1
1215 || size_type (1) < size_type (_C_pref ()->_C_get_ref ()))
1216 return replace (
size (), size_type (), __n, __c);
1218 traits_type::assign (_C_data + __size0, __n, __c);
1219 traits_type::assign (_C_data [__size1], value_type ());
1220 _C_pref ()->_C_size._C_size = __size1;
1228 template <
class _CharT,
class _Traits ,
class _Allocator>
1236 return string_type (__lhs.
data (), __lhs.
size ()) += __rhs;
1241 template <
class _CharT,
class _Traits ,
class _Allocator>
1251 template <
class _CharT,
class _Traits ,
class _Allocator>
1261 template <
class _CharT,
class _Traits ,
class _Allocator>
1264 const _CharT* __rhs)
1269 return string_type (__lhs.
data (), __lhs.
size ()) += __rhs;
1274 template <
class _CharT,
class _Traits ,
class _Allocator>
1282 return string_type (__lhs.
data (), __lhs.
size ()) += __rhs;
1287 template <
class _CharT,
class _Traits ,
class _Allocator>
1293 return __lhs.
size () == __rhs.
size ()
1294 && !_Traits::compare (__lhs.
data (), __rhs.
data (), __lhs.
size ());
1299 template <
class _CharT,
class _Traits ,
class _Allocator>
1305 __n = _Traits::length (__lhs);
1308 return __rhs.
size () == __n
1309 && !_Traits::compare (__lhs, __rhs.
data (), __n);
1314 template <
class _CharT,
class _Traits ,
class _Allocator>
1317 const _CharT* __rhs)
1319 return __rhs == __lhs;
1324 template <
class _CharT,
class _Traits ,
class _Allocator>
1326 operator< (const basic_string<_CharT, _Traits, _Allocator>& __lhs,
1329 return 0 > __lhs.
compare (__rhs);
1334 template <
class _CharT,
class _Traits ,
class _Allocator>
1339 return 0 < __rhs.
compare (__lhs);
1344 template <
class _CharT,
class _Traits ,
class _Allocator>
1346 operator< (const basic_string<_CharT, _Traits, _Allocator>& __lhs,
1347 const _CharT* __rhs)
1349 return 0 > __lhs.
compare (__rhs);
1354 template <
class _CharT,
class _Traits ,
class _Allocator>
1359 return !(__lhs == __rhs);
1364 template <
class _CharT,
class _Traits ,
class _Allocator>
1369 return __rhs < __lhs;
1374 template <
class _CharT,
class _Traits ,
class _Allocator>
1376 operator<= (const basic_string<_CharT, _Traits, _Allocator>& __lhs,
1379 return !(__rhs < __lhs);
1384 template <
class _CharT,
class _Traits ,
class _Allocator>
1389 return !(__lhs < __rhs);
1393 #ifndef _RWSTD_NO_PART_SPEC_OVERLOAD
1395 template <
class _CharT,
class _Traits,
class _Allocator>
1402 #endif // _RWSTD_NO_PART_SPEC_OVERLOAD
1406 template <
class _CharT,
class _Traits ,
class _Allocator>
1411 return !(__lhs == __rhs);
1416 template <
class _CharT,
class _Traits ,
class _Allocator>
1419 const _CharT* __rhs)
1421 return !(__lhs == __rhs);
1426 template <
class _CharT,
class _Traits ,
class _Allocator>
1431 return __rhs < __lhs;
1436 template <
class _CharT,
class _Traits ,
class _Allocator>
1439 const _CharT* __rhs)
1441 return __rhs < __lhs;
1446 template <
class _CharT,
class _Traits ,
class _Allocator>
1451 return !(__rhs < __lhs);
1456 template <
class _CharT,
class _Traits ,
class _Allocator>
1458 operator<= (const basic_string<_CharT, _Traits, _Allocator>& __lhs,
1459 const _CharT* __rhs)
1461 return !(__rhs < __lhs);
1466 template <
class _CharT,
class _Traits ,
class _Allocator>
1471 return !(__lhs < __rhs);
1476 template <
class _CharT,
class _Traits ,
class _Allocator>
1479 const _CharT* __rhs)
1481 return !(__lhs < __rhs);
1486 template <
class _CharT,
class _Traits ,
class _Allocator>
1487 inline std::basic_ostream<_CharT, _Traits>&
1488 operator<< (std::basic_ostream<_CharT, _Traits>& __os,
1491 __os << __str.
c_str();
1496 NAMESPACE_BENTLEY_BSTDCXX_END
1498 #if !defined (DOCUMENTATION_GENERATOR)
1499 #ifdef BENTLEY_CHANGE_REMOVED
1500 #ifndef _RWSTD_RW_STRINGIO_H_INCLUDED
1501 # include <rw/_stringio.h>
1502 #endif // _RWSTD_RW_STRINGIO_H_INCLUDED
1505 BC__RWSTD_NAMESPACE (BC__RW) {
1507 #ifndef _RWSTD_NO_FUNC_PARTIAL_SPEC
1509 # ifndef _RWSTD_NO_NONDEDUCED_CONTEXT
1510 # define _RWSTD_STRING_SIZE_TYPE \
1511 typename BENTLEY_BSTDCXX::basic_string<_CharT, _Traits, _Allocator>::size_type
1513 # define _RWSTD_STRING_SIZE_TYPE _RWSTD_SIZE_T
1514 # endif // _RWSTD_NO_NONDEDUCED_CONTEXT
1519 template <
class _CharT,
class _Traits,
class _Allocator>
1520 inline _RWSTD_STRING_SIZE_TYPE
1521 __rw_new_capacity (_RWSTD_STRING_SIZE_TYPE __size,
1522 const BENTLEY_BSTDCXX::basic_string<_CharT, _Traits, _Allocator>*)
1524 typedef _RWSTD_STRING_SIZE_TYPE _RWSizeT;
1526 const _RWSizeT __ratio = _RWSizeT ( (_RWSTD_STRING_CAPACITY_RATIO << 10)
1527 / _RWSTD_RATIO_DIVIDER);
1529 const _RWSizeT __cap = (__size >> 10) * __ratio
1530 + (((__size & 0x3ff) * __ratio) >> 10);
1532 return (__size += _RWSTD_MINIMUM_STRING_CAPACITY) > __cap ? __size : __cap;
1535 #else // if defined (_RWSTD_NO_FUNC_PARTIAL_SPEC)
1537 # ifndef _RWSTD_NO_NONDEDUCED_CONTEXT
1538 # define _RWSTD_STRING_SIZE_TYPE(type) type::size_type
1540 # define _RWSTD_STRING_SIZE_TYPE(ignore) _RWSTD_SIZE_T
1541 # endif // _RWSTD_NO_NONDEDUCED_CONTEXT
1547 _RWSTD_SPECIALIZED_FUNCTION
1548 inline _RWSTD_STRING_SIZE_TYPE (BENTLEY_BSTDCXX::string)
1549 __rw_new_capacity (_RWSTD_STRING_SIZE_TYPE (BENTLEY_BSTDCXX::
string) __size,
1550 const BENTLEY_BSTDCXX::
string*)
1552 typedef _RWSTD_STRING_SIZE_TYPE (BENTLEY_BSTDCXX::string) _RWSizeT;
1554 const _RWSizeT __ratio = _RWSizeT ( (_RWSTD_STRING_CAPACITY_RATIO << 10)
1555 / _RWSTD_RATIO_DIVIDER);
1557 const _RWSizeT __cap = (__size >> 10) * __ratio
1558 + (((__size & 0x3ff) * __ratio) >> 10);
1560 return (__size += _RWSTD_MINIMUM_STRING_CAPACITY) > __cap ? __size : __cap;
1563 _RWSTD_SPECIALIZED_FUNCTION
1564 inline _RWSTD_STRING_SIZE_TYPE (BENTLEY_BSTDCXX::wstring)
1565 __rw_new_capacity (_RWSTD_STRING_SIZE_TYPE (BENTLEY_BSTDCXX::wstring) __size,
1566 const BENTLEY_BSTDCXX::wstring*)
1568 typedef _RWSTD_STRING_SIZE_TYPE (BENTLEY_BSTDCXX::wstring) _RWSizeT;
1570 const _RWSizeT __ratio = _RWSizeT ( (_RWSTD_STRING_CAPACITY_RATIO << 10)
1571 / _RWSTD_RATIO_DIVIDER);
1573 const _RWSizeT __cap = (__size >> 10) * __ratio
1574 + (((__size & 0x3ff) * __ratio) >> 10);
1576 return (__size += _RWSTD_MINIMUM_STRING_CAPACITY) > __cap ? __size : __cap;
1579 #endif // _RWSTD_NO_FUNC_PARTIAL_SPEC
1582 #undef _RWSTD_STRING_SIZE_TYPE
1586 #endif // DOCUMENTATION_GENERATOR
1590 #endif // _RWSTD_STRING_INCLUDED
const_reverse_iterator rend() const
Definition: basic_string.h:257
size_type find_first_not_of(value_type __c, size_type __pos=0) const
Definition: basic_string.h:726
iterator find(const key_type &__x)
Definition: stdcxx/bstdmap.h:269
void swap(basic_string &__s)
Definition: basic_string.h:610
size_type find_last_of(value_type __c, size_type __pos=npos) const
Definition: basic_string.h:706
basic_string & assign(const_pointer __s)
Definition: basic_string.h:361
basic_string & assign(_InputIter __first, _InputIter __last, void *)
Definition: basic_string.h:375
basic_string & replace(size_type __pos, size_type __n, const basic_string &__s)
Definition: basic_string.h:516
allocator_type::reference reference
Definition: basic_string.h:112
const_iterator begin() const
Definition: basic_string.h:232
basic_string & insert(size_type __pos, const_pointer __s)
Definition: basic_string.h:400
basic_string & replace(iterator __first, iterator __last, const_pointer __s)
Definition: basic_string.h:554
basic_string(_InputIter __first, _InputIter __last, const allocator_type &__alloc=allocator_type())
Definition: basic_string.h:202
basic_string & replace(iterator __first1, iterator __last1, _InputIter __first2, _InputIter __last2)
Definition: basic_string.h:591
int compare(size_type __pos, size_type __n, const basic_string &__str) const
Definition: basic_string.h:757
basic_string & operator=(const basic_string &)
basic_string & insert(size_type __pos, size_type __n, value_type __c)
Definition: basic_string.h:458
BC__RW::__rw_debug_iter< basic_string, pointer, pointer > iterator
Definition: basic_string.h:120
allocator_type::size_type size_type
Definition: basic_string.h:110
const_pointer data() const
Definition: basic_string.h:630
size_type rfind(const basic_string &__str, size_type __pos=npos) const
Definition: basic_string.h:655
iterator _C_make_iter(const pointer &__ptr)
Definition: basic_string.h:125
const_iterator end() const
Definition: basic_string.h:241
size_type rfind(value_type __c, size_type __pos=npos) const
Definition: basic_string.h:668
bool operator<=(const basic_string< _CharT, _Traits, _Allocator > &__lhs, const basic_string< _CharT, _Traits, _Allocator > &__rhs)
Definition: basic_string.h:1376
allocator_type::const_pointer const_pointer
Definition: basic_string.h:115
reverse_iterator rbegin()
Definition: basic_string.h:245
iterator begin()
Definition: stdcxx/bstdmap.h:178
size_type find_last_not_of(const basic_string &__str, size_type __pos=npos) const
Definition: basic_string.h:731
basic_string copy() const
Definition: basic_string.h:604
reverse_iterator rend()
Definition: basic_string.h:253
int compare(const basic_string &__str) const
basic_string & operator+=(const basic_string &__s)
Definition: basic_string.h:302
size_type find_first_of(value_type __c, size_type __pos=0) const
Definition: basic_string.h:687
bool operator!=(const basic_string< _CharT, _Traits, _Allocator > &__lhs, const basic_string< _CharT, _Traits, _Allocator > &__rhs)
Definition: basic_string.h:1356
void insert(iterator __p, const_pointer __first, const_pointer __last, void *)
Definition: basic_string.h:427
basic_string & replace(iterator __first, iterator __last, size_type __n, value_type __c, int)
Definition: basic_string.h:583
allocator_type get_allocator() const
Definition: basic_string.h:634
void swap(basic_string< _CharT, _Traits, _Allocator > &__a, basic_string< _CharT, _Traits, _Allocator > &__b)
Definition: basic_string.h:1396
traits_type::char_type value_type
Definition: basic_string.h:97
basic_string & assign(const basic_string &__str)
Definition: basic_string.h:351
void insert(iterator __p, _InputIter __first, _InputIter __last, void *)
Definition: basic_string.h:416
void resize(size_type __n)
Definition: basic_string.h:273
_Allocator allocator_type
Definition: basic_string.h:98
iterator erase(iterator __it)
Definition: stdcxx/bstdmap.h:242
const_iterator _C_make_iter(const const_pointer &__ptr) const
Definition: basic_string.h:129
basic_string & insert(size_type __pos, const_pointer __s, size_type __n)
Definition: basic_string.h:395
void insert(iterator __p, iterator __first, iterator __last, void *)
Definition: basic_string.h:446
size_type find(const basic_string &__str, size_type __pos=0) const
Definition: basic_string.h:639
bool operator<(const basic_string< _CharT, _Traits, _Allocator > &__lhs, const basic_string< _CharT, _Traits, _Allocator > &__rhs)
Definition: basic_string.h:1326
const_reference operator[](size_type) const
allocator_type::pointer pointer
Definition: basic_string.h:114
size_type length() const
Definition: basic_string.h:265
bool operator>(const basic_string< _CharT, _Traits, _Allocator > &__lhs, const basic_string< _CharT, _Traits, _Allocator > &__rhs)
Definition: basic_string.h:1366
iterator erase(iterator __first, iterator __last)
Definition: basic_string.h:469
iterator erase(iterator __it)
Definition: basic_string.h:464
size_type find_last_of(const basic_string &__str, size_type __pos=npos) const
Definition: basic_string.h:692
basic_string & append(const_pointer __s)
Definition: basic_string.h:322
void resize(size_type, value_type)
size_type size() const
Definition: basic_string.h:261
basic_string & assign(const_pointer __s, size_type __n)
Definition: basic_string.h:357
size_type capacity() const
Definition: basic_string.h:277
basic_string & replace(iterator __first, iterator __last, const_pointer __s, size_type __n)
Definition: basic_string.h:546
size_type max_size() const
Definition: stdcxx/bstdmap.h:218
allocator_type::const_reference const_reference
Definition: basic_string.h:113
size_type rfind(const_pointer __s, size_type __pos=npos) const
Definition: basic_string.h:663
basic_string & insert(size_type, const basic_string &)
basic_string & replace(size_type __pos, size_type __n, const_pointer __s)
Definition: basic_string.h:530
void push_back(value_type)
basic_string & assign(size_type __n, value_type __c, int)
Definition: basic_string.h:382
basic_string< _CharT, _Traits, _Allocator > operator+(const basic_string< _CharT, _Traits, _Allocator > &__lhs, const basic_string< _CharT, _Traits, _Allocator > &__rhs)
Definition: basic_string.h:1230
_RWSTD_STATIC_CONST(size_type, npos=size_type(_RWSTD_SIZE_MAX))
size_type find_last_of(const_pointer __s, size_type __pos=npos) const
Definition: basic_string.h:701
Provides Bentley specific memory management functions (Bentley/BentleyAllocator.h).
basic_string & append(size_type __n, value_type __c, int)
Definition: basic_string.h:341
basic_string & assign(size_type __n, value_type __c)
Definition: basic_string.h:387
size_type find_last_not_of(const_pointer __s, size_type __pos=npos) const
Definition: basic_string.h:740
int compare(size_type __pos, size_type __n, const_pointer __s) const
Definition: basic_string.h:772
basic_string(const allocator_type &__alloc=allocator_type())
Definition: basic_string.h:178
void insert(iterator __p, size_type __n, value_type __c, int)
Definition: basic_string.h:422
bool operator==(const basic_string< _CharT, _Traits, _Allocator > &__lhs, const basic_string< _CharT, _Traits, _Allocator > &__rhs)
Definition: basic_string.h:1289
void reserve(size_type=0)
size_type find_first_not_of(const basic_string &__str, size_type __pos=0) const
Definition: basic_string.h:711
size_type find_first_not_of(const_pointer __s, size_type __pos=0) const
Definition: basic_string.h:720
BC__RW::__rw_debug_iter< basic_string, const_pointer, pointer > const_iterator
Definition: basic_string.h:123
iterator insert(iterator __pos, value_type __c)
Definition: basic_string.h:405
allocator_type::difference_type difference_type
Definition: basic_string.h:111
basic_string & replace(iterator __first, iterator __last, const basic_string &__str)
Definition: basic_string.h:540
void clear()
Definition: basic_string.h:283
basic_string & erase(size_type=0, size_type=npos)
basic_string & append(_InputIter __first, _InputIter __last)
Definition: basic_string.h:327
void insert(iterator __p, _InputIter __first, _InputIter __last)
Definition: basic_string.h:411
bool operator>=(const basic_string< _CharT, _Traits, _Allocator > &__lhs, const basic_string< _CharT, _Traits, _Allocator > &__rhs)
Definition: basic_string.h:1386
basic_string & append(const basic_string &, size_type, size_type)
allocator_type get_allocator() const
Definition: stdcxx/bstdmap.h:174
iterator end()
Definition: basic_string.h:236
basic_string & append(const basic_string &__str)
Definition: basic_string.h:316
basic_string & replace(iterator __first, iterator __last, size_type __n, value_type __c)
Definition: basic_string.h:560
void insert(iterator __it, size_type __n, value_type __c)
Definition: basic_string.h:454
size_type find_last_not_of(value_type __c, size_type __pos=npos) const
Definition: basic_string.h:746
A template that has many of the capabilities of std::basic_string.
Definition: basic_string.h:92
~basic_string()
Definition: basic_string.h:212
int compare(const_pointer __s) const
Definition: basic_string.h:767
std::reverse_iterator< const_iterator > const_reverse_iterator
Definition: basic_string.h:153
std::reverse_iterator< iterator > reverse_iterator
Definition: basic_string.h:154
size_type max_size() const
_Traits traits_type
Definition: basic_string.h:96
const_pointer c_str() const
Definition: basic_string.h:626
size_type size() const
Definition: stdcxx/bstdmap.h:214
basic_string & append(_InputIter __first, _InputIter __last, void *)
Definition: basic_string.h:335
const_reference at(size_type) const
void * bentleyAllocator_getNullRefBuffer()
basic_string & assign(_InputIter __first, _InputIter __last)
Definition: basic_string.h:367
bool empty() const
Definition: basic_string.h:292
size_type find_first_of(const_pointer __s, size_type __pos=0) const
Definition: basic_string.h:682
size_type find_first_of(const basic_string &__str, size_type __pos=0) const
Definition: basic_string.h:673
void insert(iterator __p, const_iterator __first, const_iterator __last, void *)
Definition: basic_string.h:437
size_type find(const_pointer __s, size_type __pos=0) const
Definition: basic_string.h:647
const_reverse_iterator rbegin() const
Definition: basic_string.h:249
basic_string substr(size_type=0, size_type=npos) const