38#pragma GCC system_header
40#pragma GCC diagnostic push
41#pragma GCC diagnostic ignored "-Wc++11-extensions"
43namespace std _GLIBCXX_VISIBILITY(default)
45_GLIBCXX_BEGIN_NAMESPACE_VERSION
47 template <
class _CharT,
class _Traits,
class _Alloc>
48 typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type
52 int_type
__ret = traits_type::eof();
53 if (this->eback() < this->gptr())
60 const bool __testeq = traits_type::eq(traits_type::
68 *this->gptr() = traits_type::to_char_type(__c);
75 __ret = traits_type::not_eof(__c);
81 template <
class _CharT,
class _Traits,
class _Alloc>
82 typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type
88 return traits_type::eof();
90 const bool __testeof = traits_type::eq_int_type(__c, traits_type::eof());
92 return traits_type::not_eof(__c);
94 const __size_type
__capacity = _M_string.capacity();
96#if _GLIBCXX_USE_CXX11_ABI
97 if (
size_t(this->epptr() - this->pbase()) <
__capacity)
100 char_type* __base =
const_cast<char_type*
>(_M_string.data());
101 _M_pbump(__base, __base +
__capacity, this->pptr() - this->pbase());
104 const __size_type
__nget = this->gptr() - this->eback();
105 const __size_type
__eget = this->egptr() - this->eback();
106 this->setg(__base, __base +
__nget, __base +
__eget + 1);
108 *this->pptr() = traits_type::to_char_type(__c);
114 const __size_type
__max_size = _M_string.max_size();
115 const bool __testput = this->pptr() < this->epptr();
117 return traits_type::eof();
121 const char_type
__conv = traits_type::to_char_type(__c);
139 __tmp.assign(this->pbase(), this->epptr() - this->pbase());
141 _M_string.swap(
__tmp);
142 _M_sync(
const_cast<char_type*
>(_M_string.data()),
151 template <
class _CharT,
class _Traits,
class _Alloc>
152 typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type
156 int_type
__ret = traits_type::eof();
163 if (this->gptr() < this->egptr())
164 __ret = traits_type::to_int_type(*this->gptr());
169 template <
class _CharT,
class _Traits,
class _Alloc>
170 typename basic_stringbuf<_CharT, _Traits, _Alloc>::pos_type
174 pos_type
__ret = pos_type(off_type(-1));
183 const char_type*
__beg =
__testin ? this->eback() : this->pbase();
202 this->setg(this->eback(), this->eback() +
__newoffi,
210 _M_pbump(this->pbase(), this->epptr(),
__newoffo);
217 template <
class _CharT,
class _Traits,
class _Alloc>
218 typename basic_stringbuf<_CharT, _Traits, _Alloc>::pos_type
222 pos_type
__ret = pos_type(off_type(-1));
226 const char_type*
__beg =
__testin ? this->eback() : this->pbase();
237 this->setg(this->eback(), this->eback() +
__pos,
240 _M_pbump(this->pbase(), this->epptr(),
__pos);
247 template <
class _CharT,
class _Traits,
class _Alloc>
250 _M_sync(char_type* __base, __size_type __i, __size_type
__o)
254 char_type*
__endg = __base + _M_string.size();
255 char_type*
__endp = __base + _M_string.capacity();
257 if (__base != _M_string.data())
266 this->setg(__base, __base + __i, __endg);
269 _M_pbump(__base, __endp, __o);
274 this->setg(__endg, __endg, __endg);
278 template <
class _CharT,
class _Traits,
class _Alloc>
280 basic_stringbuf<_CharT, _Traits, _Alloc>::
281 _M_pbump(char_type* __pbeg, char_type* __pend, off_type __off)
283 this->setp(__pbeg, __pend);
284 while (__off > __gnu_cxx::__numeric_traits<int>::__max)
286 this->pbump(__gnu_cxx::__numeric_traits<int>::__max);
287 __off -= __gnu_cxx::__numeric_traits<int>::__max;
294#if _GLIBCXX_EXTERN_TEMPLATE
295 extern template class basic_stringbuf<char>;
296 extern template class basic_istringstream<char>;
297 extern template class basic_ostringstream<char>;
298 extern template class basic_stringstream<char>;
300#ifdef _GLIBCXX_USE_WCHAR_T
301 extern template class basic_stringbuf<wchar_t>;
302 extern template class basic_istringstream<wchar_t>;
303 extern template class basic_ostringstream<wchar_t>;
304 extern template class basic_stringstream<wchar_t>;
308_GLIBCXX_END_NAMESPACE_VERSION
311#pragma GCC diagnostic pop
constexpr const _Tp & max(const _Tp &, const _Tp &)
This does what you think it does.
constexpr const _Tp & min(const _Tp &, const _Tp &)
This does what you think it does.
ISO C++ entities toplevel namespace is std.
The actual work of input and output (for std::string).
virtual int_type underflow()
Fetches more data from the controlled sequence.
virtual pos_type seekpos(pos_type __sp, ios_base::openmode __mode=ios_base::in|ios_base::out)
Alters the stream positions.
virtual pos_type seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode __mode=ios_base::in|ios_base::out)
Alters the stream positions.
virtual int_type overflow(int_type __c=traits_type::eof())
Consumes data from the buffer; writes to the controlled sequence.
virtual int_type pbackfail(int_type __c=traits_type::eof())
Tries to back up the input sequence.
static const seekdir cur
Request a seek relative to the current position within the sequence.
static const seekdir end
Request a seek relative to the current end of the sequence.
static const openmode in
Open for input. Default for ifstream and fstream.
static const openmode out
Open for output. Default for ofstream and fstream.