33 #ifndef _GLIBCXX_SSTREAM
34 #define _GLIBCXX_SSTREAM 1
36 #pragma GCC system_header
41 namespace std _GLIBCXX_VISIBILITY(default)
43 _GLIBCXX_BEGIN_NAMESPACE_VERSION
63 template<
typename _CharT,
typename _Traits,
typename _Alloc>
64 class basic_stringbuf :
public basic_streambuf<_CharT, _Traits>
68 typedef _CharT char_type;
69 typedef _Traits traits_type;
72 typedef _Alloc allocator_type;
73 typedef typename traits_type::int_type int_type;
74 typedef typename traits_type::pos_type pos_type;
75 typedef typename traits_type::off_type off_type;
77 typedef basic_streambuf<char_type, traits_type> __streambuf_type;
78 typedef basic_string<char_type, _Traits, _Alloc> __string_type;
79 typedef typename __string_type::size_type __size_type;
114 { _M_stringbuf_init(__mode); }
160 _M_stringbuf_init(ios_base::openmode __mode)
163 __size_type __len = 0;
165 __len = _M_string.
size();
166 _M_sync(const_cast<char_type*>(_M_string.
data()), 0, __len);
185 pbackfail(int_type __c = traits_type::eof());
188 overflow(int_type __c = traits_type::eof());
201 virtual __streambuf_type*
215 _M_sync(__s, __n, 0);
221 seekoff(off_type __off, ios_base::seekdir __way,
232 _M_sync(char_type*
__base, __size_type __i, __size_type __o);
252 _M_pbump(char_type* __pbeg, char_type* __pend, off_type __off);
271 template<
typename _CharT,
typename _Traits,
typename _Alloc>
272 class basic_istringstream :
public basic_istream<_CharT, _Traits>
276 typedef _CharT char_type;
277 typedef _Traits traits_type;
280 typedef _Alloc allocator_type;
281 typedef typename traits_type::int_type int_type;
282 typedef typename traits_type::pos_type pos_type;
283 typedef typename traits_type::off_type off_type;
286 typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
287 typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type;
288 typedef basic_istream<char_type, traits_type> __istream_type;
291 __stringbuf_type _M_stringbuf;
310 { this->
init(&_M_stringbuf); }
327 ios_base::openmode __mode = ios_base::in)
329 { this->
init(&_M_stringbuf); }
349 {
return const_cast<__stringbuf_type*
>(&_M_stringbuf); }
357 {
return _M_stringbuf.str(); }
367 { _M_stringbuf.str(__s); }
386 template <
typename _CharT,
typename _Traits,
typename _Alloc>
387 class basic_ostringstream :
public basic_ostream<_CharT, _Traits>
391 typedef _CharT char_type;
392 typedef _Traits traits_type;
395 typedef _Alloc allocator_type;
396 typedef typename traits_type::int_type int_type;
397 typedef typename traits_type::pos_type pos_type;
398 typedef typename traits_type::off_type off_type;
401 typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
402 typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type;
403 typedef basic_ostream<char_type, traits_type> __ostream_type;
406 __stringbuf_type _M_stringbuf;
425 { this->
init(&_M_stringbuf); }
444 { this->
init(&_M_stringbuf); }
464 {
return const_cast<__stringbuf_type*
>(&_M_stringbuf); }
472 {
return _M_stringbuf.str(); }
482 { _M_stringbuf.str(__s); }
501 template <
typename _CharT,
typename _Traits,
typename _Alloc>
502 class basic_stringstream :
public basic_iostream<_CharT, _Traits>
506 typedef _CharT char_type;
507 typedef _Traits traits_type;
510 typedef _Alloc allocator_type;
511 typedef typename traits_type::int_type int_type;
512 typedef typename traits_type::pos_type pos_type;
513 typedef typename traits_type::off_type off_type;
516 typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
517 typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type;
518 typedef basic_iostream<char_type, traits_type> __iostream_type;
521 __stringbuf_type _M_stringbuf;
539 { this->
init(&_M_stringbuf); }
556 { this->
init(&_M_stringbuf); }
576 {
return const_cast<__stringbuf_type*
>(&_M_stringbuf); }
584 {
return _M_stringbuf.str(); }
594 { _M_stringbuf.str(__s); }
597 _GLIBCXX_END_NAMESPACE_VERSION