Standard C++ Library Reference ISO/IEC (VERSION3)
ios_base::in | ios_base::out);
virtual pos_type seekpos(pos_type sp,
ios_base::openmode which =
ios_base::in | ios_base::out);
virtual int sync();
virtual streamsize showmanyc();
virtual streamsize xsgetn(char_type *ptr,
streamsize count);
virtual int_type underflow();
virtual int_type uflow();
virtual int_type pbackfail(int_type meta =
traits_type::eof());
virtual streamsize xsputn(const char_type *ptr,
streamsize count);
virtual int_type overflow(int_type meta =
traits_type::eof());
};
The template class describes an abstract base class for deriving a stream buffer, which controls
the transmission of elements to and from a specific representation of a stream. An object of
class basic_streambuf helps control a stream with elements of type Tr, also known as
char_type, whose character traits are determined by the class char_traits, also known
as traits_type.
Every stream buffer conceptually controls two independent streams, in fact, one for extractions
(input) and one for insertions (output). A specific representation may, however, make either or
both of these streams inaccessible. It typically maintains some relationship between the two
streams. What you insert into the output stream of a basic_stringbuf<Elem, Tr>
object, for example, is what you later extract from its input stream. And when you position one
stream of a basic_filebuf<Elem, Tr> object, you position the other stream in tandem.
The public interface to template class basic_streambuf supplies the operations common to
all stream buffers, however specialized. The protected interface supplies the operations needed
for a specific representation of a stream to do its work. The protected virtual member functions
let you tailor the behavior of a derived stream buffer for a specific representation of a stream.
Each of the derived stream buffers in this library describes how it specializes the behavior of its
protected virtual member functions. Documented here is the default behavior for the base
class, which is often to do nothing.
The remaining protected member functions control copying to and from any storage supplied to
buffer transmissions to and from streams. An input buffer, for example, is characterized by:
eback(), a pointer to the beginning of the buffer●
gptr(), a pointer to the next element to read●