#include <Stream.h>

Inheritance diagram for SBufStream:
Collaboration diagram for SBufStream:

Public Member Functions

 SBufStream (const SBuf &aBuf)
 SBufStream ()
 Create an empty SBufStream. More...
SBuf buf ()
 bytes written so far More...
SBufStreamclearBuf ()
 Clear the stream's backing store. More...

Private Attributes

SBuf sink_
 buffer for (flushed) bytes written to the stream More...
AppendingStreamBuf< SBufstreamBuffer_
 writes raw (post-formatting) bytes to the sink_ More...

Detailed Description

Stream interface to write to a SBuf.

Data is appended using standard operator << semantics, and extracted using the buf() method, in analogy with std::strstream .

Definition at line 20 of file Stream.h.

Constructor & Destructor Documentation

◆ SBufStream() [1/2]

SBufStream::SBufStream ( const SBuf aBuf)

Create a SBufStream preinitialized with the contents of a SBuf

The supplied SBuf copied: in order to retrieve the written-to contents they must be later fetched using the buf() class method.

Definition at line 28 of file Stream.h.

References streamBuffer_.

◆ SBufStream() [2/2]

SBufStream::SBufStream ( )

Definition at line 38 of file Stream.h.

Member Function Documentation

◆ buf()

◆ clearBuf()

SBufStream & SBufStream::clearBuf ( )

Definition at line 47 of file Stream.h.

References SBuf::clear(), and sink_.

Referenced by TestSBuf::testSBufStream().

Member Data Documentation

◆ sink_

SBuf SBufStream::sink_

Definition at line 55 of file Stream.h.

Referenced by buf(), and clearBuf().

◆ streamBuffer_

AppendingStreamBuf<SBuf> SBufStream::streamBuffer_

Definition at line 57 of file Stream.h.

Referenced by SBufStream().

The documentation for this class was generated from the following file:






Web Site Translations