Standard C++ Library Reference ISO/IEC (VERSION3)
 class basic_stringbuf
 : public basic_streambuf<Elem, Tr> {
public:
 typedef typename basic_streambuf<Elem, Tr>::char_type
 char_type;
 typedef typename basic_streambuf<Elem, Tr>::traits_type
 traits_type;
 typedef typename basic_streambuf<Elem, Tr>::int_type
 int_type;
 typedef typename basic_streambuf<Elem, Tr>::pos_type
 pos_type;
 typedef typename basic_streambuf<Elem, Tr>::off_type
 off_type;
 typedef Alloc allocator_type;
 basic_stringbuf(ios_base::openmode mode =
 ios_base::in | ios_base::out);
 basic_stringbuf(const basic_string<Elem, Tr, Alloc>& str,
 ios_base::openmode mode =
 ios_base::in | ios_base::out);
 basic_string<Elem, Tr, Alloc> str() const;
 void str(const basic_string<Elem, Tr, Alloc>& newstr);
protected:
 virtual pos_type seekoff(off_type off,
 ios_base::seekdir way,
 ios_base::openmode mode =
 ios_base::in | ios_base::out);
 virtual pos_type seekpos(pos_type sp,
 ios_base::openmode mode =
 ios_base::in | ios_base::out);
 virtual int_type underflow();
 virtual int_type pbackfail(int_type meta =
 traits_type::eof());
 virtual int_type overflow(int_type meta =
 traits_type::eof());
 };
The template class describes a stream buffer that controls the transmission of elements of type
Elem, whose character traits are determined by the class Tr, to and from a sequence of
elements stored in an array object. The object is allocated, extended, and freed as necessary to
accommodate changes in the sequence.
An object of class basic_stringbuf<Elem, Tr, Alloc> stores a copy of the
ios_base::openmode argument from its constructor as its stringbuf mode mode:










