basic_stringbuf::str

basic_string<E, T, A> str() const;
void str(basic_string<E, T, A>& x);

The first member function returns an object of class basic_string<E, T, allocator>, whose controlled sequence is a copy of the sequence controlled by *this. The sequence copied depends on the stored stringbuf mode mode:

The second member function deallocates any sequence currently controlled by *this. It then allocates a copy of the sequence controlled by x. If mode & ios_base::in is nonzero, it sets the input buffer to begin reading at the beginning of the sequence. If mode & ios_base::out is nonzero, it sets the output buffer to begin writing at the beginning of the sequence.