261 |
261 |
262 allocator_type get_allocator() const { |
262 allocator_type get_allocator() const { |
263 return _STLP_CONVERT_ALLOCATOR((const allocator_type&)this->_M_end_of_storage, _CharT); |
263 return _STLP_CONVERT_ALLOCATOR((const allocator_type&)this->_M_end_of_storage, _CharT); |
264 } |
264 } |
265 |
265 |
266 _STLP_DUMMY_IMP_DECLSPEC basic_string(); |
266 _STLP_DECLSPEC basic_string(); |
267 |
267 |
268 explicit basic_string(const allocator_type& __a) |
268 explicit basic_string(const allocator_type& __a) |
269 : _String_base<_CharT,_Alloc>(__a, 8) { |
269 : _String_base<_CharT,_Alloc>(__a, 8) { |
270 _M_terminate_string(); |
270 _M_terminate_string(); |
271 _STLP_POP_CLEANUP_ITEM |
271 _STLP_POP_CLEANUP_ITEM |
276 : _String_base<_CharT,_Alloc>(__a, __n + 1) { |
276 : _String_base<_CharT,_Alloc>(__a, __n + 1) { |
277 _M_terminate_string(); |
277 _M_terminate_string(); |
278 _STLP_POP_CLEANUP_ITEM |
278 _STLP_POP_CLEANUP_ITEM |
279 } |
279 } |
280 |
280 |
281 _STLP_DUMMY_IMP_DECLSPEC basic_string(const basic_string<_CharT, _Traits, _Alloc>&); |
281 _STLP_DECLSPEC basic_string(const basic_string<_CharT, _Traits, _Alloc>&); |
282 |
282 |
283 basic_string(const _Self& __s, size_type __pos, size_type __n = npos, |
283 basic_string(const _Self& __s, size_type __pos, size_type __n = npos, |
284 const allocator_type& __a = allocator_type()) |
284 const allocator_type& __a = allocator_type()) |
285 : _String_base<_CharT,_Alloc>(__a) { |
285 : _String_base<_CharT,_Alloc>(__a) { |
286 if (__pos > __s.size()) |
286 if (__pos > __s.size()) |
298 _STLP_FIX_LITERAL_BUG(__s) |
298 _STLP_FIX_LITERAL_BUG(__s) |
299 _M_range_initialize(__s, __s + __n); |
299 _M_range_initialize(__s, __s + __n); |
300 _STLP_POP_CLEANUP_ITEM |
300 _STLP_POP_CLEANUP_ITEM |
301 } |
301 } |
302 |
302 |
303 _STLP_DUMMY_IMP_DECLSPEC basic_string(const _CharT* __s, |
303 _STLP_DECLSPEC basic_string(const _CharT* __s, |
304 const allocator_type& __a = allocator_type()); |
304 const allocator_type& __a = allocator_type()); |
305 |
305 |
306 basic_string(size_type __n, _CharT __c, |
306 basic_string(size_type __n, _CharT __c, |
307 const allocator_type& __a = allocator_type()) |
307 const allocator_type& __a = allocator_type()) |
308 : _String_base<_CharT,_Alloc>(__a, __n + 1) |
308 : _String_base<_CharT,_Alloc>(__a, __n + 1) |
673 { _STLP_FIX_LITERAL_BUG(__s) return assign(__s, __s + __n); } |
673 { _STLP_FIX_LITERAL_BUG(__s) return assign(__s, __s + __n); } |
674 |
674 |
675 _Self& assign(const _CharT* __s) |
675 _Self& assign(const _CharT* __s) |
676 { _STLP_FIX_LITERAL_BUG(__s) return assign(__s, __s + _Traits::length(__s)); } |
676 { _STLP_FIX_LITERAL_BUG(__s) return assign(__s, __s + _Traits::length(__s)); } |
677 |
677 |
678 _STLP_DUMMY_IMP_DECLSPEC _Self& assign(size_type __n, _CharT __c); |
678 _STLP_DECLSPEC _Self& assign(size_type __n, _CharT __c); |
679 |
679 |
680 #ifdef _STLP_MEMBER_TEMPLATES |
680 #ifdef _STLP_MEMBER_TEMPLATES |
681 |
681 |
682 private: // Helper functions for assign. |
682 private: // Helper functions for assign. |
683 |
683 |
800 _M_insert_dispatch(__p, __first, __last, _Integral()); |
800 _M_insert_dispatch(__p, __first, __last, _Integral()); |
801 } |
801 } |
802 |
802 |
803 #else /* _STLP_MEMBER_TEMPLATES */ |
803 #else /* _STLP_MEMBER_TEMPLATES */ |
804 |
804 |
805 _STLP_DUMMY_IMP_DECLSPEC void insert(iterator __p, const _CharT* __first, const _CharT* __last); |
805 _STLP_DECLSPEC void insert(iterator __p, const _CharT* __first, const _CharT* __last); |
806 |
806 |
807 #endif /* _STLP_MEMBER_TEMPLATES */ |
807 #endif /* _STLP_MEMBER_TEMPLATES */ |
808 |
808 |
809 private: // Helper functions for insert. |
809 private: // Helper functions for insert. |
810 |
810 |
1137 { return find(__s._M_start, __pos, __s.size()); } |
1137 { return find(__s._M_start, __pos, __s.size()); } |
1138 |
1138 |
1139 size_type find(const _CharT* __s, size_type __pos = 0) const |
1139 size_type find(const _CharT* __s, size_type __pos = 0) const |
1140 { _STLP_FIX_LITERAL_BUG(__s) return find(__s, __pos, _Traits::length(__s)); } |
1140 { _STLP_FIX_LITERAL_BUG(__s) return find(__s, __pos, _Traits::length(__s)); } |
1141 |
1141 |
1142 _STLP_DUMMY_IMP_DECLSPEC size_type find(const _CharT* __s, size_type __pos, size_type __n) const; |
1142 _STLP_DECLSPEC size_type find(const _CharT* __s, size_type __pos, size_type __n) const; |
1143 |
1143 |
1144 // WIE: Versant schema compiler 5.2.2 ICE workaround |
1144 // WIE: Versant schema compiler 5.2.2 ICE workaround |
1145 size_type find(_CharT __c) const |
1145 size_type find(_CharT __c) const |
1146 { return find(__c, 0) ; } |
1146 { return find(__c, 0) ; } |
1147 size_type find(_CharT __c, size_type __pos /* = 0 */) const; |
1147 size_type find(_CharT __c, size_type __pos /* = 0 */) const; |
1152 { return rfind(__s._M_start, __pos, __s.size()); } |
1152 { return rfind(__s._M_start, __pos, __s.size()); } |
1153 |
1153 |
1154 size_type rfind(const _CharT* __s, size_type __pos = npos) const |
1154 size_type rfind(const _CharT* __s, size_type __pos = npos) const |
1155 { _STLP_FIX_LITERAL_BUG(__s) return rfind(__s, __pos, _Traits::length(__s)); } |
1155 { _STLP_FIX_LITERAL_BUG(__s) return rfind(__s, __pos, _Traits::length(__s)); } |
1156 |
1156 |
1157 _STLP_DUMMY_IMP_DECLSPEC size_type rfind(const _CharT* __s, size_type __pos, size_type __n) const; |
1157 _STLP_DECLSPEC size_type rfind(const _CharT* __s, size_type __pos, size_type __n) const; |
1158 _STLP_DUMMY_IMP_DECLSPEC size_type rfind(_CharT __c, size_type __pos = npos) const; |
1158 _STLP_DECLSPEC size_type rfind(_CharT __c, size_type __pos = npos) const; |
1159 |
1159 |
1160 public: // find_first_of |
1160 public: // find_first_of |
1161 |
1161 |
1162 size_type find_first_of(const _Self& __s, size_type __pos = 0) const |
1162 size_type find_first_of(const _Self& __s, size_type __pos = 0) const |
1163 { return find_first_of(__s._M_start, __pos, __s.size()); } |
1163 { return find_first_of(__s._M_start, __pos, __s.size()); } |
1164 |
1164 |
1165 size_type find_first_of(const _CharT* __s, size_type __pos = 0) const |
1165 size_type find_first_of(const _CharT* __s, size_type __pos = 0) const |
1166 { _STLP_FIX_LITERAL_BUG(__s) return find_first_of(__s, __pos, _Traits::length(__s)); } |
1166 { _STLP_FIX_LITERAL_BUG(__s) return find_first_of(__s, __pos, _Traits::length(__s)); } |
1167 |
1167 |
1168 _STLP_DUMMY_IMP_DECLSPEC size_type find_first_of(const _CharT* __s, size_type __pos, |
1168 _STLP_DECLSPEC size_type find_first_of(const _CharT* __s, size_type __pos, |
1169 size_type __n) const; |
1169 size_type __n) const; |
1170 |
1170 |
1171 size_type find_first_of(_CharT __c, size_type __pos = 0) const |
1171 size_type find_first_of(_CharT __c, size_type __pos = 0) const |
1172 { return find(__c, __pos); } |
1172 { return find(__c, __pos); } |
1173 |
1173 |
1178 { return find_last_of(__s._M_start, __pos, __s.size()); } |
1178 { return find_last_of(__s._M_start, __pos, __s.size()); } |
1179 |
1179 |
1180 size_type find_last_of(const _CharT* __s, size_type __pos = npos) const |
1180 size_type find_last_of(const _CharT* __s, size_type __pos = npos) const |
1181 { _STLP_FIX_LITERAL_BUG(__s) return find_last_of(__s, __pos, _Traits::length(__s)); } |
1181 { _STLP_FIX_LITERAL_BUG(__s) return find_last_of(__s, __pos, _Traits::length(__s)); } |
1182 |
1182 |
1183 _STLP_DUMMY_IMP_DECLSPEC size_type find_last_of(const _CharT* __s, size_type __pos, |
1183 _STLP_DECLSPEC size_type find_last_of(const _CharT* __s, size_type __pos, |
1184 size_type __n) const; |
1184 size_type __n) const; |
1185 |
1185 |
1186 size_type find_last_of(_CharT __c, size_type __pos = npos) const { |
1186 size_type find_last_of(_CharT __c, size_type __pos = npos) const { |
1187 return rfind(__c, __pos); |
1187 return rfind(__c, __pos); |
1188 } |
1188 } |
1194 { return find_first_not_of(__s._M_start, __pos, __s.size()); } |
1194 { return find_first_not_of(__s._M_start, __pos, __s.size()); } |
1195 |
1195 |
1196 size_type find_first_not_of(const _CharT* __s, size_type __pos = 0) const |
1196 size_type find_first_not_of(const _CharT* __s, size_type __pos = 0) const |
1197 { _STLP_FIX_LITERAL_BUG(__s) return find_first_not_of(__s, __pos, _Traits::length(__s)); } |
1197 { _STLP_FIX_LITERAL_BUG(__s) return find_first_not_of(__s, __pos, _Traits::length(__s)); } |
1198 |
1198 |
1199 _STLP_DUMMY_IMP_DECLSPEC size_type find_first_not_of(const _CharT* __s, size_type __pos, |
1199 _STLP_DECLSPEC size_type find_first_not_of(const _CharT* __s, size_type __pos, |
1200 size_type __n) const; |
1200 size_type __n) const; |
1201 |
1201 |
1202 _STLP_DUMMY_IMP_DECLSPEC size_type find_first_not_of(_CharT __c, size_type __pos = 0) const; |
1202 _STLP_DECLSPEC size_type find_first_not_of(_CharT __c, size_type __pos = 0) const; |
1203 |
1203 |
1204 public: // find_last_not_of |
1204 public: // find_last_not_of |
1205 |
1205 |
1206 size_type find_last_not_of(const _Self& __s, |
1206 size_type find_last_not_of(const _Self& __s, |
1207 size_type __pos = npos) const |
1207 size_type __pos = npos) const |
1208 { return find_last_not_of(__s._M_start, __pos, __s.size()); } |
1208 { return find_last_not_of(__s._M_start, __pos, __s.size()); } |
1209 |
1209 |
1210 size_type find_last_not_of(const _CharT* __s, size_type __pos = npos) const |
1210 size_type find_last_not_of(const _CharT* __s, size_type __pos = npos) const |
1211 { _STLP_FIX_LITERAL_BUG(__s) return find_last_not_of(__s, __pos, _Traits::length(__s)); } |
1211 { _STLP_FIX_LITERAL_BUG(__s) return find_last_not_of(__s, __pos, _Traits::length(__s)); } |
1212 |
1212 |
1213 _STLP_DUMMY_IMP_DECLSPEC size_type find_last_not_of(const _CharT* __s, size_type __pos, |
1213 _STLP_DECLSPEC size_type find_last_not_of(const _CharT* __s, size_type __pos, |
1214 size_type __n) const; |
1214 size_type __n) const; |
1215 |
1215 |
1216 _STLP_DUMMY_IMP_DECLSPEC size_type find_last_not_of(_CharT __c, size_type __pos = npos) const; |
1216 _STLP_DECLSPEC size_type find_last_not_of(_CharT __c, size_type __pos = npos) const; |
1217 |
1217 |
1218 public: // Substring. |
1218 public: // Substring. |
1219 |
1219 |
1220 _Self substr(size_type __pos = 0, size_type __n = npos) const { |
1220 _Self substr(size_type __pos = 0, size_type __n = npos) const { |
1221 if (__pos > size()) |
1221 if (__pos > size()) |