34 #ifndef _GLIBXX_STREAMBUF
35 #define _GLIBXX_STREAMBUF 1
37 #pragma GCC system_header
46 _GLIBCXX_BEGIN_NAMESPACE(std)
48 template<typename _CharT, typename _Traits>
50 __copy_streambufs_eof(basic_streambuf<_CharT, _Traits>*,
51 basic_streambuf<_CharT, _Traits>*,
bool&);
113 template<typename _CharT, typename _Traits>
135 friend class basic_ios<char_type, traits_type>;
142 __copy_streambufs_eof<>(__streambuf_type*, __streambuf_type*,
bool&);
144 template<
bool _IsMove,
typename _CharT2>
145 friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
150 template<
typename _CharT2>
151 friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
156 template<
typename _CharT2,
typename _Traits2>
160 template<
typename _CharT2,
typename _Traits2,
typename _Alloc>
165 template<
typename _CharT2,
typename _Traits2,
typename _Alloc>
206 locale __tmp(this->getloc());
208 _M_buf_locale = __loc;
222 {
return _M_buf_locale; }
235 {
return this->setbuf(__s, __n); }
238 pubseekoff(off_type __off, ios_base::seekdir __way,
239 ios_base::openmode __mode = ios_base::in | ios_base::out)
240 {
return this->seekoff(__off, __way, __mode); }
243 pubseekpos(pos_type __sp,
244 ios_base::openmode __mode = ios_base::in | ios_base::out)
245 {
return this->seekpos(__sp, __mode); }
263 const streamsize __ret = this->egptr() - this->gptr();
264 return __ret ? __ret : this->showmanyc();
277 int_type __ret = traits_type::eof();
278 if (__builtin_expect(!traits_type::eq_int_type(this->sbumpc(),
280 __ret = this->sgetc();
296 if (__builtin_expect(this->gptr() < this->egptr(),
true))
298 __ret = traits_type::to_int_type(*this->gptr());
302 __ret = this->uflow();
318 if (__builtin_expect(this->gptr() < this->egptr(),
true))
319 __ret = traits_type::to_int_type(*this->gptr());
321 __ret = this->underflow();
335 {
return this->xsgetn(__s, __n); }
348 sputbackc(char_type __c)
351 const bool __testpos = this->eback() < this->gptr();
352 if (__builtin_expect(!__testpos ||
353 !traits_type::eq(__c, this->gptr()[-1]),
false))
354 __ret = this->pbackfail(traits_type::to_int_type(__c));
358 __ret = traits_type::to_int_type(*this->gptr());
376 if (__builtin_expect(this->eback() < this->gptr(),
true))
379 __ret = traits_type::to_int_type(*this->gptr());
382 __ret = this->pbackfail();
403 if (__builtin_expect(this->pptr() < this->epptr(),
true))
407 __ret = traits_type::to_int_type(__c);
410 __ret = this->overflow(traits_type::to_int_type(__c));
427 {
return this->xsputn(__s, __n); }
440 : _M_in_beg(0), _M_in_cur(0), _M_in_end(0),
441 _M_out_beg(0), _M_out_cur(0), _M_out_end(0),
461 gptr()
const {
return _M_in_cur; }
474 gbump(
int __n) { _M_in_cur += __n; }
485 setg(char_type* __gbeg, char_type* __gnext, char_type* __gend)
505 pbase()
const {
return _M_out_beg; }
508 pptr()
const {
return _M_out_cur; }
511 epptr()
const {
return _M_out_end; }
521 pbump(
int __n) { _M_out_cur += __n; }
531 setp(char_type* __pbeg, char_type* __pend)
533 _M_out_beg = _M_out_cur = __pbeg;
578 seekoff(off_type, ios_base::seekdir,
579 ios_base::openmode = ios_base::in | ios_base::out)
580 {
return pos_type(off_type(-1)); }
591 ios_base::openmode = ios_base::in | ios_base::out)
592 {
return pos_type(off_type(-1)); }
664 {
return traits_type::eof(); }
678 int_type __ret = traits_type::eof();
679 const bool __testeof = traits_type::eq_int_type(this->underflow(),
683 __ret = traits_type::to_int_type(*this->gptr());
700 pbackfail(int_type = traits_type::eof())
701 {
return traits_type::eof(); }
743 overflow(int_type = traits_type::eof())
744 {
return traits_type::eof(); }
746 #if _GLIBCXX_DEPRECATED
760 if (this->gptr() < this->egptr())
770 basic_streambuf(
const __streambuf_type& __sb)
771 : _M_in_beg(__sb._M_in_beg), _M_in_cur(__sb._M_in_cur),
772 _M_in_end(__sb._M_in_end), _M_out_beg(__sb._M_out_beg),
773 _M_out_cur(__sb._M_out_cur), _M_out_end(__sb._M_out_cur),
774 _M_buf_locale(__sb._M_buf_locale)
778 operator=(
const __streambuf_type&) {
return *
this; };
784 __copy_streambufs_eof(basic_streambuf<char>* __sbin,
785 basic_streambuf<char>* __sbout,
bool& __ineof);
786 #ifdef _GLIBCXX_USE_WCHAR_T
789 __copy_streambufs_eof(basic_streambuf<wchar_t>* __sbin,
790 basic_streambuf<wchar_t>* __sbout,
bool& __ineof);
793 _GLIBCXX_END_NAMESPACE
795 #ifndef _GLIBCXX_EXPORT_TEMPLATE