stringbuf::stringbuf [constructor]
stringbuf ( ios_base::openmode which = ios_base::in | ios_base::out );
stringbuf ( const string& str, ios_base::openmode which = ios_base::in | ios_base::out );
stringbuf
  cplusplus.com  

Construct an object and optionally initialize string.
  Initializes the internal openmode field as set by parameter which and initializes its inherited members by calling its parent's constructor streambuf().
  If the second prototype is used, the internal character sequence is initialized with a copy of parameter str.

Parameters.

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

Return Value.
  none

Basic template member declaration ( basic_stringbuf<charT,traits,Allocator> ):
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.
  streambuf constructor
  stringbuf class


© The C++ Resources Network, 2001