The Micro C++ Library
|
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 >.
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. |
An StreamReader is a Stream implementation that is based on std::istream associated to a name.
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.
name | See traits::Stream::Stream(const std::string&) |
stream | The 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.
name | See traits::Stream::Stream(const std::string&) |
stream | The 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
.
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.
Read size Reader::char_type into buffer.
If buffer is 0
, the stream is positioned size bytes forward.
Implements micxx::traits::Reader< unsigned char, std::size_t >.