cxxtools::BasicLimitOStream< char_type > Class Template Reference

The class implements a output stream, which limits the number of characters to write. More...

#include <cxxtools/limitstream.h>

Inheritance diagram for cxxtools::BasicLimitOStream< char_type >:
basic_ostream

Public Member Functions

 BasicLimitOStream (std::basic_ostream< char_type > &sink, unsigned count=0)
 Initialize a limiting output stream using a underlying output stream and the number of characters to write.
 BasicLimitOStream (std::basic_streambuf< char_type > *sink, unsigned count=0)
 Initialize a limiting output stream using a underlying stream buffer and the number of characters to write.
unsigned ocount () const
 sets the number of remaining characters to write.
void ocount (unsigned c)
 returns the number of remaining characters to write.
void attach (std::basic_ostream< char_type > &s)
 sets the underlying stream buffer.
void attach (std::basic_streambuf< char_type > *s)
 sets the underlying stream buffer.

Detailed Description

template<typename char_type>
class cxxtools::BasicLimitOStream< char_type >

The class implements a output stream, which limits the number of characters to write.

When trying to write more than the specified number of characters, eof is reported.

Constructor & Destructor Documentation

template<typename char_type >
cxxtools::BasicLimitOStream< char_type >::BasicLimitOStream ( std::basic_ostream< char_type > &  sink,
unsigned  count = 0 
)
inlineexplicit

Initialize a limiting output stream using a underlying output stream and the number of characters to write.

template<typename char_type >
cxxtools::BasicLimitOStream< char_type >::BasicLimitOStream ( std::basic_streambuf< char_type > *  sink,
unsigned  count = 0 
)
inlineexplicit

Initialize a limiting output stream using a underlying stream buffer and the number of characters to write.

Member Function Documentation

template<typename char_type >
void cxxtools::BasicLimitOStream< char_type >::attach ( std::basic_ostream< char_type > &  s)
inline

sets the underlying stream buffer.

template<typename char_type >
void cxxtools::BasicLimitOStream< char_type >::attach ( std::basic_streambuf< char_type > *  s)
inline

sets the underlying stream buffer.

template<typename char_type >
unsigned cxxtools::BasicLimitOStream< char_type >::ocount ( ) const
inline

sets the number of remaining characters to write.

template<typename char_type >
void cxxtools::BasicLimitOStream< char_type >::ocount ( unsigned  c)
inline

returns the number of remaining characters to write.


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