Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

lrt::FileInputStream Class Reference

FileInputStream implements a input stream which receives data from a file. More...

#include <rtstreams.h>

Inheritance diagram for lrt::FileInputStream:

Inheritance graph
[legend]
List of all members.

Public Methods

 FileInputStream (const File &file, bool textMode)
 Creates a FileInputStream from the file denoted by the given file descriptor file. More...

 FileInputStream (const String &fileName, bool textMode)
 Creates a FileInputStream from the file given by its file name fileName. More...

virtual bool markSupported ()
virtual void mark ()
 Marks the current position in the stream for later returning to it.

virtual void reset ()
 Resets the current position to the previously marked one. More...

virtual int read ()
 Reads one byte from the file. More...

virtual bool eos ()
 Checks if this file's end has been reached. More...

virtual void close ()
 Closes the file.

virtual ~FileInputStream ()

Detailed Description

FileInputStream implements a input stream which receives data from a file.

Marking and resetting positions is always supported by such streams.


Constructor & Destructor Documentation

lrt::FileInputStream::FileInputStream (  const File &    file,
bool    textMode
) 
 

Creates a FileInputStream from the file denoted by the given file descriptor file.

Parameters:
file  The file which should be opened.

lrt::FileInputStream::FileInputStream (  const String &    fileName,
bool    textMode
) 
 

Creates a FileInputStream from the file given by its file name fileName.

Note that you should always separate paths with forward slashes '/'; libRT will convert them to the system dependent path separators.


Member Function Documentation

bool lrt::FileInputStream::eos (    )  [virtual]
 

Checks if this file's end has been reached.

Returns:
true if the file has ended, false if there is still some data to read.

Implements lrt::InputStream.

bool lrt::FileInputStream::markSupported (    )  [virtual]
 

Returns:
True since marking is supported by FileInputStreams.

Reimplemented from lrt::InputStream.

int lrt::FileInputStream::read (    )  [virtual]
 

Reads one byte from the file.

Returns:
The byte read, or -1 if the end of file was reached.

Implements lrt::InputStream.

void lrt::FileInputStream::reset (    )  [virtual]
 

Resets the current position to the previously marked one.

If no position was marked before, the position is reset to the beginning of the file.

Reimplemented from lrt::InputStream.


The documentation for this class was generated from the following files:
This is the RoboTour API documentation version 0.1 • Copyright (C) by Florian Fischer