Standard C++ Library Reference ISO/IEC (VERSION3)
ios_base::openmode which =
ios_base::in | ios_base::out);
virtual int underflow();
virtual int pbackfail(int meta = EOF);
virtual int overflow(int meta = EOF);
};
The class describes a stream buffer that controls the transmission of elements to and from a
sequence of elements stored in a char array object. Depending on how it is constructed, the
object can be allocated, extended, and freed as necessary to accommodate changes in the
sequence.
An object of class strstreambuf stores several bits of mode information as its
strstreambuf mode. These bits indicate whether the controlled sequence:
has been allocated, and hence needs to be freed eventually●
is modifiable●
is extendable by reallocating storage●
has been frozen and hence needs to be unfrozen before the object is destroyed, or freed
(if allocated) by an agency other than the object
●
A controlled sequence that is frozen cannot be modified or extended, regardless of the state of
these separate mode bits.
The object also stores pointers to two functions that control strstreambuf allocation. If these
are null pointers, the object devises its own method of allocating and freeing storage for the
controlled sequence.
strstreambuf::freeze
void freeze(bool freezeit = true);
If freezeit is true, the function alters the stored strstreambuf mode to make the controlled
sequence frozen. Otherwise, it makes the controlled sequence not frozen.
strstreambuf::pcount
streamsize pcount();
The member function returns a count of the number of elements written to the controlled
sequence. Specifically, if pptr() is a null pointer, the function returns zero. Otherwise, it
returns pptr() - pbase().