basic_stringbuf 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.
template <class Elem, class Tr = char_traits<Elem>,
class Alloc = allocator<Elem>
>
class basic_stringbuf : public basic_streambuf<Elem, Tr>
Parameters
Alloc
The allocator class.Elem
The type of the basic element of the string.Tr
The character traits specialized on the basic element of the string.
Remarks
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:
If mode & ios_base::in is nonzero, the input buffer is accessible. For more information, see basic_streambuf Class.
If mode & ios_base::out is nonzero, the output buffer is accessible.
Constructors
Constructs an object of type basic_stringbuf. |
Typedefs
The type is a synonym for the template parameter Alloc. |
|
Associates a type name with the Elem template parameter. |
|
Makes this type within basic_filebuf's scope equivalent to the type of the same name in the Tr scope. |
|
Makes this type within basic_filebuf's scope equivalent to the type of the same name in the Tr scope. |
|
Makes this type within basic_filebuf's scope equivalent to the type of the same name in the Tr scope. |
|
Associates a type name with the Tr template parameter. |
Member Functions
A protected, virtual function that can be called when a new character is inserted into a full buffer. |
|
The protected virtual member function tries to put back an element into the input buffer, then makes it the current element (pointed to by the next pointer). |
|
The protected virtual member function tries to alter the current positions for the controlled streams. |
|
The protected virtual member function tries to alter the current positions for the controlled streams. |
|
Sets or gets the text in a string buffer without changing the write position. |
|
The protected virtual member function to extract the current element from the input stream. |
Requirements
Header: <sstream>
Namespace: std