共用方式為


strstreambuf Class

Describes a stream buffer that controls the transmission of elements to and from a sequence of elements stored in a char array object.

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

class strstreambuf : public streambuf

Remarks

Depending on how the object is constructed, it can be allocated, extended, and freed as necessary to accommodate changes in the sequence.

An object of class strstreambuf stores several bits of mode information as its strstreambuf mode. These bits indicate whether the controlled sequence:

  • Has been allocated and needs to be freed eventually.

  • Is modifiable.

  • Is extendable by reallocating storage.

  • Has been frozen and hence needs to be unfrozen before the object is destroyed, or freed (if allocated) by an agency other than the object.

A controlled sequence that is frozen cannot be modified or extended, regardless of the state of these separate mode bits.

The object also stores pointers to two functions that control strstreambuf allocation. If these are null pointers, the object devises its own method of allocating and freeing storage for the controlled sequence.

注意

This class is deprecated. Consider using stringbuf or wstringbuf instead.

Requirements

Header: <strstream>

Namespace: std

See Also

Concepts

strstreambuf Members

streambuf

<strstream> Members

Thread Safety in the Standard C++ Library

iostream Programming

iostreams Conventions