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::UnixInStream Class Reference

#include <elm/io/UnixInStream.h>

+ Inheritance diagram for elm::io::UnixInStream:

Public Member Functions

 UnixInStream (int fd)
 
int fd (void) const
 
virtual int read (void *buffer, int size)
 
virtual int read (void)
 
virtual CString lastErrorMessage (void)
 
- Public Member Functions inherited from elm::io::InStream
virtual ~InStream (void)
 

Protected Attributes

int _fd
 

Additional Inherited Members

- Static Public Attributes inherited from elm::io::InStream
static const int FAILED = -1
 
static const int ENDED = -2
 
static InStreamnull = _null
 

Detailed Description

Input stream implementation using the Unix low-level IO system.

Constructor & Destructor Documentation

elm::io::UnixInStream::UnixInStream ( int  fd)

Build a new Unix input stream with the given file descriptor.

Parameters
fdFile descriptor to use.

Member Function Documentation

int elm::io::UnixInStream::fd ( void  ) const

Get the file descriptor of this Unix file stream.

Returns
File descriptor.

References _fd.

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

Return a message for the last error.

Returns
Message of the last error.

Reimplemented from elm::io::InStream.

int elm::io::UnixInStream::read ( void *  buffer,
int  size 
)
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.

Implements elm::io::InStream.

References _fd.

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

Read one byte from the stream.

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

Reimplemented from elm::io::InStream.

References elm::io::InStream::read().

Member Data Documentation

int elm::io::UnixInStream::_fd
protected

Referenced by fd(), and read().


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