countstreambuf Class Reference

A streambuf class for determining byte counts. More...

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

Public Member Functions

 countstreambuf (std::streamsize precount=0)
 Construct null, or with precount size. More...
 
std::streamsize size () const
 
void printBufInfo (Ostream &os) const
 Some information about the number of bytes counted. More...
 

Protected Member Functions

virtual int overflow (int c=EOF)
 Handle output counting via overflow. More...
 
virtual std::streampos seekpos (std::streampos, std::ios_base::openmode which=std::ios_base::in|std::ios_base::out)
 Set position pointer to absolute position. More...
 

Detailed Description

A streambuf class for determining byte counts.

Definition at line 49 of file OCountStream.H.

Constructor & Destructor Documentation

◆ countstreambuf()

countstreambuf ( std::streamsize  precount = 0)
inline

Construct null, or with precount size.

Definition at line 84 of file OCountStream.H.

Member Function Documentation

◆ overflow()

virtual int overflow ( int  c = EOF)
inlineprotectedvirtual

Handle output counting via overflow.

Definition at line 59 of file OCountStream.H.

References Foam::constant::universal::c.

◆ seekpos()

virtual std::streampos seekpos ( std::streampos  ,
std::ios_base::openmode  which = std::ios_base::in|std::ios_base::out 
)
inlineprotectedvirtual

Set position pointer to absolute position.

For the counter, any positioning is ignored and it always acts like seekpos(0), which resets the count.

Definition at line 72 of file OCountStream.H.

◆ size()

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

Definition at line 90 of file OCountStream.H.

Referenced by OCountStreamAllocator::size().

Here is the caller graph for this function:

◆ printBufInfo()

void printBufInfo ( Ostream os) const
inline

Some information about the number of bytes counted.

Definition at line 96 of file OCountStream.H.

Referenced by OCountStreamAllocator::printBufInfo().

Here is the caller graph for this function:

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