Compartilhar via


basic_stringbuf::basic_stringbuf

Constructs an object of type basic_stringbuf.

basic_stringbuf(
    ios_base::openmode _Mode = ios_base::in | ios_base::out
);
basic_stringbuf(
    const basic_string<Elem, Tr, Alloc>& _Str,
    ios_base::openmode _Mode = ios_base::in | ios_base::out
);

Parameters

Remarks

The first constructor stores a null pointer in all the pointers controlling the input buffer and the output buffer. For more information, see the Remarks section of the basic_streambuf Class. It also stores _Mode as the stringbuf mode. For more information, see the Remarks section of the basic_stringbuf Class.

The second constructor allocates a copy of the sequence controlled by the string object _Str. If _Mode & ios_base::in is nonzero, it sets the input buffer to start reading at the start of the sequence. If _Mode & ios_base::out is nonzero, it sets the output buffer to begin writing at the start of the sequence. It also stores _Mode as the stringbuf mode. For more information, see the Remarks section of the basic_stringbuf Class.

Requirements

Header: <sstream>

Namespace: std

See Also

Reference

basic_stringbuf Class

iostream Programming

iostreams Conventions