33#ifndef _GLIBXX_STREAMBUF
34#define _GLIBXX_STREAMBUF 1
36#pragma GCC system_header
45namespace std _GLIBCXX_VISIBILITY(default)
47_GLIBCXX_BEGIN_NAMESPACE_VERSION
49#define _IsUnused __attribute__ ((__unused__))
51 template<
typename _CharT,
typename _Traits>
53 __copy_streambufs_eof(basic_streambuf<_CharT, _Traits>*,
54 basic_streambuf<_CharT, _Traits>*,
bool&);
121 template<
typename _CharT,
typename _Traits>
152 template<
bool _IsMove,
typename _CharT2>
153 friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
158 template<
typename _CharT2>
159 friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
164 template<
typename _CharT2,
typename _Distance>
165 friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
171 template<
typename _CharT2,
typename _Traits2,
typename _Alloc>
176 template<
typename _CharT2,
typename _Traits2,
typename _Alloc>
245 {
return this->
setbuf(__s, __n); }
258 {
return this->
seekoff(__off, __way, __mode); }
270 {
return this->
seekpos(__sp, __mode); }
292 return __ret ? __ret : this->
showmanyc();
305 int_type __ret = traits_type::eof();
306 if (__builtin_expect(!traits_type::eq_int_type(this->
sbumpc(),
308 __ret = this->
sgetc();
324 if (__builtin_expect(this->
gptr() < this->
egptr(),
true))
326 __ret = traits_type::to_int_type(*this->
gptr());
330 __ret = this->
uflow();
346 if (__builtin_expect(this->
gptr() < this->
egptr(),
true))
347 __ret = traits_type::to_int_type(*this->
gptr());
363 {
return this->
xsgetn(__s, __n); }
380 const bool __testpos = this->
eback() < this->
gptr();
381 if (__builtin_expect(!__testpos ||
382 !traits_type::eq(__c, this->
gptr()[-1]),
false))
383 __ret = this->
pbackfail(traits_type::to_int_type(__c));
387 __ret = traits_type::to_int_type(*this->
gptr());
405 if (__builtin_expect(this->
eback() < this->
gptr(),
true))
408 __ret = traits_type::to_int_type(*this->
gptr());
432 if (__builtin_expect(this->
pptr() < this->
epptr(),
true))
436 __ret = traits_type::to_int_type(__c);
439 __ret = this->
overflow(traits_type::to_int_type(__c));
456 {
return this->
xsputn(__s, __n); }
693 {
return traits_type::eof(); }
707 int_type __ret = traits_type::eof();
708 const bool __testeof = traits_type::eq_int_type(this->
underflow(),
712 __ret = traits_type::to_int_type(*this->
gptr());
730 {
return traits_type::eof(); }
774 {
return traits_type::eof(); }
776#if _GLIBCXX_USE_DEPRECATED && __cplusplus <= 201402L
787 _GLIBCXX_DEPRECATED_SUGGEST(
"std::basic_streambuf::sbumpc")
805#if __cplusplus < 201103L
815#if __cplusplus >= 201103L
830#if __cplusplus >= 201103L
831 template<
typename _CharT,
typename _Traits>
835 template<
typename _CharT,
typename _Traits>
838 operator=(
const basic_streambuf&) =
default;
844 __copy_streambufs_eof(basic_streambuf<char>* __sbin,
845 basic_streambuf<char>* __sbout,
bool& __ineof);
846#ifdef _GLIBCXX_USE_WCHAR_T
849 __copy_streambufs_eof(basic_streambuf<wchar_t>* __sbin,
850 basic_streambuf<wchar_t>* __sbout,
bool& __ineof);
855_GLIBCXX_END_NAMESPACE_VERSION
void swap(any &__x, any &__y) noexcept
Exchange the states of two any objects.
ISO C++ entities toplevel namespace is std.
ptrdiff_t streamsize
Integral type for I/O operation counts and buffer sizes.
Template class basic_ios, virtual base class for all stream classes.
The actual work of input and output (interface).
virtual pos_type seekpos(pos_type, ios_base::openmode=ios_base::in|ios_base::out)
Alters the stream positions.
char_type * _M_in_beg
Start of get area.
locale getloc() const
Locale access.
traits_type::int_type int_type
char_type * epptr() const
Access to the put area.
basic_streambuf< char_type, traits_type > __streambuf_type
This is a non-standard type.
virtual int_type overflow(int_type __c=traits_type::eof())
Consumes data from the buffer; writes to the controlled sequence.
virtual streamsize xsputn(const char_type *__s, streamsize __n)
Multiple character insertion.
pos_type pubseekpos(pos_type __sp, ios_base::openmode __mode=ios_base::in|ios_base::out)
Alters the stream position.
char_type * pptr() const
Access to the put area.
void setg(char_type *__gbeg, char_type *__gnext, char_type *__gend)
Setting the three read area pointers.
char_type * eback() const
Access to the get area.
virtual int sync()
Synchronizes the buffer arrays with the controlled sequences.
virtual int_type uflow()
Fetches more data from the controlled sequence.
char_type * egptr() const
Access to the get area.
char_type * gptr() const
Access to the get area.
traits_type::pos_type pos_type
streamsize sputn(const char_type *__s, streamsize __n)
Entry point for all single-character output functions.
virtual streamsize xsgetn(char_type *__s, streamsize __n)
Multiple character extraction.
char_type * _M_out_beg
Start of put area.
int_type snextc()
Getting the next character.
virtual void imbue(const locale &__loc)
Changes translations.
int_type sbumpc()
Getting the next character.
char_type * _M_in_cur
Current read area.
streamsize sgetn(char_type *__s, streamsize __n)
Entry point for xsgetn.
basic_streambuf * pubsetbuf(char_type *__s, streamsize __n)
Entry points for derived buffer functions.
virtual basic_streambuf< char_type, _Traits > * setbuf(char_type *, streamsize)
Manipulates the buffer.
char_type * _M_out_cur
Current put area.
virtual streamsize showmanyc()
Investigating the data available.
int_type sungetc()
Moving backwards in the input stream.
virtual int_type pbackfail(int_type __c=traits_type::eof())
Tries to back up the input sequence.
locale pubimbue(const locale &__loc)
Entry point for imbue().
streamsize in_avail()
Looking ahead into the stream.
void gbump(int __n)
Moving the read position.
virtual int_type underflow()
Fetches more data from the controlled sequence.
void setp(char_type *__pbeg, char_type *__pend)
Setting the three write area pointers.
pos_type pubseekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode __mode=ios_base::in|ios_base::out)
Alters the stream position.
void pbump(int __n)
Moving the write position.
int_type sgetc()
Getting the next character.
int pubsync()
Calls virtual sync function.
virtual pos_type seekoff(off_type, ios_base::seekdir, ios_base::openmode=ios_base::in|ios_base::out)
Alters the stream positions.
char_type * pbase() const
Access to the put area.
char_type * _M_in_end
End of get area.
virtual ~basic_streambuf()
Destructor deallocates no buffer space.
traits_type::off_type off_type
int_type sputbackc(char_type __c)
Pushing characters back into the input stream.
locale _M_buf_locale
Current locale setting.
char_type * _M_out_end
End of put area.
int_type sputc(char_type __c)
Entry point for all single-character output functions.
basic_streambuf()
Base constructor.
Template class basic_istream.
Template class basic_ostream.
Provides input iterator semantics for streambufs.
Provides output iterator semantics for streambufs.
Managing sequences of characters and character-like objects.
static const openmode in
Open for input. Default for ifstream and fstream.
static const openmode out
Open for output. Default for ofstream and fstream.
Container class for localization functionality.