public member function

std::stringbuf::stringbuf

<sstream>
explicit stringbuf ( ios_base::openmode which = ios_base::in | ios_base::out );
explicit stringbuf ( const string& str, ios_base::openmode which = ios_base::in | ios_base::out );
Construct a string stream buffer object
Initializes the internal openmode field as set by parameter which and initializes the base class by calling its parent's constructor streambuf::streambuf.

When the second version is used, the contents of the controlled character sequence are initialized with a copy of parameter str.

Parameters

which
Specifies the openmode for the stream buffer. If (which & ios_base::in) is true, input operations are allowed, and if (which & ios_base::out) is true, output operations are allowed.
str
string object whose content is used to intialize the internal character sequence.

Return Value

none (constructor)

Basic template member declaration

( basic_stringbuf<charT,traits,Allocator> )
1
2
3
basic_stringbuf ( ios_base::openmode which = ios_base::in | ios_base::out );
basic_stringbuf ( const basic_string<charT,traits,Allocator>& str,
                  ios_base::openmode which = ios_base::in | ios_base::out );


See also