The Micro C++ Library
micxx::StreamReader Class Reference

An StreamReader is a Stream implementation that is based on std::istream associated to a name. More...

#include <micxx.hxx>

Inherits micxx::traits::NonCopyable, micxx::traits::Stream, and micxx::traits::Reader< unsigned char, std::size_t >.

List of all members.

Public Member Functions

 StreamReader ()
 Create a new StreamReader from std::cin.
 StreamReader (const std::string &name, std::istream *stream=0)
 Create a new StreamReader from name and optionally from stream.
 StreamReader (const std::wstring &name, std::istream *stream=0)
 Create a new StreamReader from name and optionally from stream.
virtual ~StreamReader ()
 Delete the stored std::istream pointer.
virtual void close ()
 Operation not supported.
virtual void ignore (off_type size, int delim=EOF)
 The stream is positioned either size bytes forward or until delim is read (if this occurs before size bytes could be read).
virtual void open (std::ios_base::openmode openMode=std::ios_base::in)
 This implementation only checks, if openMode is equal to std::ios_base::in.
virtual off_type read (void *buffer, off_type size)
 Read size Reader::char_type into buffer.

Detailed Description

An StreamReader is a Stream implementation that is based on std::istream associated to a name.

Author:
Norbert Klose
Date:
April, 2007

Constructor & Destructor Documentation

micxx::StreamReader::StreamReader ( )

Create a new StreamReader from std::cin.

micxx::StreamReader::StreamReader ( const std::string &  name,
std::istream *  stream = 0 
)

Create a new StreamReader from name and optionally from stream.

Parameters:
nameSee traits::Stream::Stream(const std::string&)
streamThe std::istream to be used. Ownership of stream is transferred to this Stream object.
micxx::StreamReader::StreamReader ( const std::wstring name,
std::istream *  stream = 0 
)

Create a new StreamReader from name and optionally from stream.

Parameters:
nameSee traits::Stream::Stream(const std::string&)
streamThe std::istream to be used. Ownership of stream is transferred to this Stream object.
virtual micxx::StreamReader::~StreamReader ( ) [virtual]

Delete the stored std::istream pointer.

The stored pointer is only deleted, if not 0 and not equal to &std::cin.


Member Function Documentation

virtual void micxx::StreamReader::close ( ) [virtual]

Operation not supported.

Implements micxx::traits::Stream.

virtual void micxx::StreamReader::ignore ( off_type  size,
int  delim = EOF 
) [virtual]

The stream is positioned either size bytes forward or until delim is read (if this occurs before size bytes could be read).

Implements micxx::traits::Reader< unsigned char, std::size_t >.

virtual void micxx::StreamReader::open ( std::ios_base::openmode  openMode = std::ios_base::in) [virtual]

This implementation only checks, if openMode is equal to std::ios_base::in.

Implements micxx::traits::Stream.

virtual off_type micxx::StreamReader::read ( void *  buffer,
off_type  size 
) [virtual]

Read size Reader::char_type into buffer.

If buffer is 0, the stream is positioned size bytes forward.

Returns:
The number of bytes read or skipped.

Implements micxx::traits::Reader< unsigned char, std::size_t >.


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