Reference
C Library
IOstream Library
Strings library
STL Containers
STL Algorithms
Miscellaneous
IOstream Library
manipulators
classes:
filebuf
fstream
ifstream
ios
iostream
ios_base
istream
istringstream
ofstream
ostream
ostringstream
streambuf
stringbuf
stringstream
objects:
cerr
cin
clog
cout
types:
fpos
streamoff
streampos
streamsize
stringbuf
stringbuf::stringbuf
public members:
stringbuf::str
virtual members:
stringbuf::overflow
stringbuf::pbackfail
stringbuf::seekoff
stringbuf::seekpos
stringbuf::setbuf
stringbuf::underflow


stringbuf::stringbuf

constructor member
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