Elm  1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
elm::io::InStream Class Referenceabstract

#include <elm/io/InStream.h>

+ Inheritance diagram for elm::io::InStream:

Public Member Functions

virtual ~InStream (void)
 
virtual int read (void *buffer, int size)=0
 
virtual int read (void)
 
virtual CString lastErrorMessage (void)
 

Static Public Attributes

static const int FAILED = -1
 
static const int ENDED = -2
 
static InStreamnull = _null
 

Detailed Description

This class must be shared by all classes implementing input streams. It provides common facilities provided by input streams.

Constructor & Destructor Documentation

elm::io::InStream::~InStream ( void  )
virtual

Common virtual destructor.

Member Function Documentation

CString elm::io::InStream::lastErrorMessage ( void  )
virtual

Return a message for the last error.

Returns
Message of the last error.

Reimplemented in elm::io::UnixInStream, and elm::io::WinInStream.

Referenced by elm::io::StreamPipe::lastErrorMessage().

int elm::io::InStream::read ( void *  buffer,
int  size 
)
pure virtual

Read some bytes from the stream and store them in the given buffer. This method does not ever read as many bytes as available in the buffer even if the stream is not ended. Insteadn a read returning 0 bytes means the end of stream is reached.

Parameters
bufferBuffer to write bytes in.
sizeSize of the buffer.
Returns
Number of read bytes, 0 for end of stream, -1 for an error.

Implemented in elm::io::BlockInStream, elm::io::BufferedInStream, elm::io::UnixInStream, and elm::io::WinInStream.

Referenced by elm::util::Formatter::format(), elm::io::StreamPipe::proceed(), elm::checksum::Fletcher::put(), elm::checksum::MD5::put(), and elm::io::BufferedInStream::read().

int elm::io::InStream::read ( void  )
virtual

Read one byte from the stream.

Returns
Read byte, ERROR for an error, END for end of stream.

Reimplemented in elm::io::BlockInStream, elm::io::UnixInStream, and elm::io::WinInStream.

References ENDED, and FAILED.

Referenced by elm::io::WinInStream::read(), and elm::io::UnixInStream::read().

Member Data Documentation

const int elm::io::InStream::ENDED = -2
static
const int elm::io::InStream::FAILED = -1
static
InStream & elm::io::InStream::null = _null
static

An input stream that is always at end.


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