std::strstreambuf (3) - Linux Man Pages
Defined in header <strstream>
class strstreambuf : public std::basic_streambuf<char> (deprecated in C++98)
std::strstreambuf is a std::basic_streambuf whose associated character sequence is a character array, which may be constant (e.g. a string literal), modifyable but not dynamic (e.g. a stack-allocated array), or dynamic, in which case the std::strstreambuf may be allowed to reallocate the array as necessary to accomodate output (e.g. by calling delete and new or user-provided functions).
Typical implementation of a std::strstreambuf holds four private data members:
1) buffer state, a bitmask type which can represent any combination of the four values "allocated" (destructor will deallocate), "constant" (output not allowed), "dynamic" (output may reallocate), or "frozen" (deallocation and reallocation are not allowed)
2) allocated buffer size (the beginning of the buffer does not need a special data member, it may be stored in the inherited pointer eback())
3) pointer to user-provided allocation function
4) pointer to user-provided deallocation function.
After any call to str() on a stream with a dynamic buffer, a call to freeze(false) is required to allow the strstreambuf destructor to deallocate the buffer when necessary.
Public member functions
constructor (public member function)
destructor destructs a strstreambuf object, optionally deallocating the character array
freeze (public member function)
str (public member function)
pcount (public member function)
Protected member functions
underflow reads a character from the input sequence without advancing the next pointer
pbackfail backs out the input sequence to unget a character
overflow appends a character to the output sequence, may reallocate or initially allocate the buffer if dynamic and not frozen
setbuf attempts to replace the controlled character sequence with an array
seekoff repositions the next pointer in the input sequence, output sequence, or both, using relative addressing
seekpos repositions the next pointer in the input sequence, output sequence, or both using absolute addressing
Inherited from std::basic_streambuf
Member type Definition
traits_type Traits; the program is ill-formed if Traits::char_type is not CharT.
destructor destructs the basic_streambuf object
pubimbue (public member function of std::basic_streambuf<CharT,Traits>)
getloc (public member function of std::basic_streambuf<CharT,Traits>)
pubsetbuf (public member function of std::basic_streambuf<CharT,Traits>)