cxxtools::BasicLimitIStream< char_type > Class Template Reference

The class implements a input stream, which limits the number of characters to read. More...

#include <cxxtools/limitstream.h>

Inheritance diagram for cxxtools::BasicLimitIStream< char_type >:
basic_istream

Public Member Functions

 BasicLimitIStream (std::basic_istream< char_type > &source, unsigned count=0)
 Initialize a limiting input stream using a underlying input stream and the number of characters to read.
 BasicLimitIStream (std::basic_streambuf< char_type > *source, unsigned count=0)
 Initialize a limiting input stream using a underlying stream buffer and the number of characters to read.
unsigned icount () const
 returns the number of remaining characters to read.
void icount (unsigned c)
 sets the number of remaining characters to read.
void attach (std::basic_istream< 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::BasicLimitIStream< char_type >

The class implements a input stream, which limits the number of characters to read.

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

Constructor & Destructor Documentation

template<typename char_type >
cxxtools::BasicLimitIStream< char_type >::BasicLimitIStream ( std::basic_istream< char_type > &  source,
unsigned  count = 0 
)
inlineexplicit

Initialize a limiting input stream using a underlying input stream and the number of characters to read.

template<typename char_type >
cxxtools::BasicLimitIStream< char_type >::BasicLimitIStream ( std::basic_streambuf< char_type > *  source,
unsigned  count = 0 
)
inline

Initialize a limiting input stream using a underlying stream buffer and the number of characters to read.

Member Function Documentation

template<typename char_type >
void cxxtools::BasicLimitIStream< char_type >::attach ( std::basic_istream< char_type > &  s)
inline

sets the underlying stream buffer.

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

sets the underlying stream buffer.

template<typename char_type >
unsigned cxxtools::BasicLimitIStream< char_type >::icount ( ) const
inline

returns the number of remaining characters to read.

template<typename char_type >
void cxxtools::BasicLimitIStream< char_type >::icount ( unsigned  c)
inline

sets the number of remaining characters to read.


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