ocountstream Class Reference

Trivial output stream for calculating byte counts. More...

Inheritance diagram for ocountstream:
[legend]
Collaboration diagram for ocountstream:
[legend]

Public Member Functions

 ocountstream ()
 Default construct. More...
 
std::streamsize size () const
 
void rewind ()
 Rewind the stream, reset the count. More...
 
std::streamsize tellp () const
 

Additional Inherited Members

- Protected Member Functions inherited from countstreambuf
virtual std::streampos seekoff (std::streamoff off, std::ios_base::seekdir way, std::ios_base::openmode which=std::ios_base::in|std::ios_base::out)
 Set position pointer to relative position. More...
 
virtual std::streampos seekpos (std::streampos pos, std::ios_base::openmode which=std::ios_base::in|std::ios_base::out)
 Set position pointer to absolute position. More...
 
virtual int overflow (int c=EOF)
 Handle output counting via overflow. More...
 
virtual std::streamsize xsputn (const char *s, std::streamsize n)
 Put sequence of characters. More...
 
 countstreambuf (std::streamsize precount=0)
 Default construct, or with precount size. More...
 
std::streamsize tellp () const
 
void printBufInfo (Ostream &os) const
 Some information about the number of bytes counted. More...
 

Detailed Description

Trivial output stream for calculating byte counts.

Since all output values are discarded, it can be used as a /dev/null output buffer as well.

Definition at line 148 of file OCountStream.H.

Constructor & Destructor Documentation

◆ ocountstream()

ocountstream ( )
inline

Default construct.

Definition at line 157 of file OCountStream.H.

Member Function Documentation

◆ size()

std::streamsize size ( ) const
inline
Returns
The number of bytes counted

Definition at line 168 of file OCountStream.H.

References countstreambuf::tellp().

Here is the call graph for this function:

◆ rewind()

void rewind ( )
inline

Rewind the stream, reset the count.

Definition at line 174 of file OCountStream.H.

References clear().

Here is the call graph for this function:

◆ tellp()

std::streamsize tellp ( ) const
inline
Returns
The buffer put position == number of bytes counted.

Definition at line 128 of file OCountStream.H.


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