다음을 통해 공유


basic_stringbuf Class

Describes a stream buffer that controls the transmission of elements of type Elem, whose character traits are determined by the class Tr, to and from a sequence of elements stored in an array object.

For a list of all members of this type, see basic_stringbuf Members.

template <class Elem, class Tr = char_traits<Elem>, 
   class Alloc = allocator<Elem> 
>
   class basic_stringbuf : public basic_streambuf<Elem, Tr>

Parameters

  • Alloc
    The allocator class.

  • Elem
    The type of the basic element of the string.

  • Tr
    The character traits specialized on the basic element of the string.

Remarks

The object is allocated, extended, and freed as necessary to accommodate changes in the sequence.

An object of class basic_stringbuf<Elem, Tr, Alloc> stores a copy of the ios_base::openmode argument from its constructor as its stringbuf mode mode:

  • If mode & ios_base::in is nonzero, the input buffer is accessible. For more information, see basic_streambuf Class.

  • If mode & ios_base::out is nonzero, the output buffer is accessible.

Requirements

Header: <sstream>

Namespace: std

See Also

Concepts

basic_stringbuf Members

<sstream> Members

Thread Safety in the Standard C++ Library

iostream Programming

iostreams Conventions