std::strstreambuf
Defined in header <strstream>
|
||
class strstreambuf : public std::basic_streambuf<char> |
(deprecated in C++98) (removed in C++26) |
|
std::strstreambuf
is a std::basic_streambuf whose associated character sequence is a character array, which may be constant (e.g. a string literal), modifiable 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 accommodate output (e.g. by calling delete[] and new[] or user-provided functions).
Typical implementation of a std::strstreambuf
holds four private data members:
Contents |
[edit] 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.
strstreambuf
has been deprecated since C++98 and removed since C++26. The recommended replacement is std::spanbuf(since C++23).
[edit] Member functions
Public member functions | |
constructs a strstreambuf object (public member function) | |
[virtual] |
destructs a strstreambuf object, optionally deallocating the character array (virtual public member function) |
sets/clears the frozen state of the buffer (public member function) | |
marks the buffer frozen and returns the beginning pointer of the input sequence (public member function) | |
returns the next pointer minus the beginning pointer in the output sequence: the number of characters written (public member function) | |
Protected member functions | |
[virtual] |
reads a character from the input sequence without advancing the next pointer (virtual protected member function) |
[virtual] |
backs out the input sequence to unget a character (virtual protected member function) |
[virtual] |
appends a character to the output sequence, may reallocate or initially allocate the buffer if dynamic and not frozen (virtual protected member function) |
[virtual] |
attempts to replace the controlled character sequence with an array (virtual protected member function) |
[virtual] |
repositions the next pointer in the input sequence, output sequence, or both, using relative addressing (virtual protected member function) |