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)
 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...
 

Protected Member Functions

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...
 

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)
inlineexplicit

Default construct, or with precount size.

Definition at line 122 of file OCountStream.H.

Member Function Documentation

◆ seekoff()

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 
)
inlineprotectedvirtual

Set position pointer to relative position.

Definition at line 59 of file OCountStream.H.

◆ seekpos()

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

Set position pointer to absolute position.

For the counter, adjust the count accordingly.

Definition at line 90 of file OCountStream.H.

◆ overflow()

virtual int overflow ( int  c = EOF)
inlineprotectedvirtual

Handle output counting via overflow.

Definition at line 101 of file OCountStream.H.

◆ xsputn()

virtual std::streamsize xsputn ( const char *  s,
std::streamsize  n 
)
inlineprotectedvirtual

Put sequence of characters.

Definition at line 112 of file OCountStream.H.

References n.

◆ tellp()

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

Definition at line 128 of file OCountStream.H.

Referenced by ocountstream::size(), and 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 134 of file OCountStream.H.

References os().

Referenced by OCountStreamAllocator::printBufInfo().

Here is the call graph for this function:
Here is the caller graph for this function:

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