std::strstreambuf (3) - Linux Manuals
std::strstreambuf: std::strstreambuf
NAME
std::strstreambuf - std::strstreambuf
Synopsis
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.
Notes
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.
Member functions
Public member functions
constructor (public member function)
destructor destructs a strstreambuf object, optionally deallocating the character array
[virtual]
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
[virtual]
pbackfail backs out the input sequence to unget a character
[virtual]
overflow appends a character to the output sequence, may reallocate or initially allocate the buffer if dynamic and not frozen
[virtual]
setbuf attempts to replace the controlled character sequence with an array
[virtual]
seekoff repositions the next pointer in the input sequence, output sequence, or both, using relative addressing
[virtual]
seekpos repositions the next pointer in the input sequence, output sequence, or both using absolute addressing
[virtual]
Inherited from std::basic_streambuf
Member types
Member type Definition
char_type CharT
traits_type Traits; the program is ill-formed if Traits::char_type is not CharT.
int_type Traits::int_type
pos_type Traits::pos_type
off_type Traits::off_type
Member functions
destructor destructs the basic_streambuf object
[virtual]
Locales
pubimbue (public member function of std::basic_streambuf<CharT,Traits>)
getloc (public member function of std::basic_streambuf<CharT,Traits>)
Positioning
pubsetbuf (public member function of std::basic_streambuf<CharT,Traits>)