Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

PlainFileReader Class Reference

#include <PlainFile.h>

Inheritance diagram for PlainFileReader:

Inheritance graph
[legend]
Collaboration diagram for PlainFileReader:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 PlainFileReader (int fd, size_t bufmax=4096)
virtual ~PlainFileReader ()
int getByte ()
virtual bool eof () const
int fd () const

Constructor & Destructor Documentation

PlainFileReader::PlainFileReader int  fd,
size_t  bufmax = 4096
 

The PlainFile does not make an assumption whether the file descriptor is blocking or non-blocking. If it is non-blocking without any data to read, it will return an error. The file descriptor is not considered owned by the PlainFile object, ie. it will not be discarded on deletion of the object. However, no implications about the number of read or unread bytes must be made by the calling application.

Parameters:
fd file descriptor to read from
bufmax optional size of the dynamically allocated buffer

virtual PlainFileReader::~PlainFileReader  )  [virtual]
 

Destructor.


Member Function Documentation

virtual bool PlainFileReader::eof  )  const [virtual]
 

If the file descriptor refers to a blocking file, this function can be used by the application to determine whether the end of file has been reached. In case of non-blocking operation, the function is meaningless.

Returns:
True if the read operation has returned 0 bytes, false otherwise.

int PlainFileReader::fd  )  const
 

Retrieves the current file descriptor.

Returns:
the current file descriptor

int PlainFileReader::getByte  )  [virtual]
 

Gets a byte from the given file.

Returns:
a byte value in the range 0x00 - 0xff or -1 in case of error.

Implements PlainReader.


The documentation for this class was generated from the following file:
Generated on Sun Mar 6 13:36:06 2005 for Komssys by doxygen 1.3.8