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

lrt::FilterInputStream Class Reference

A FilterInputStream is a stream which just performs any operations on another stream. More...

#include <rtstreams.h>

Inheritance diagram for lrt::FilterInputStream:

Inheritance graph
[legend]
List of all members.

Public Methods

 FilterInputStream (InputStream *in)
 Constructs a new FilterInputStream, which gets its data from the underlying stream in.

virtual bool markSupported ()
 Returns true only if the underlying input stream supports marking.

virtual void mark ()
 Marks the current position in the stream for later restoring it. More...

virtual void reset ()
 Restores the previously marked position in the stream. More...

virtual int read ()
 Reads a byte from the underlying input stream.

virtual int read (Array< char > &b, int off, int len)
 Fills the array b with bytes from the underlying input stream.

virtual bool fail ()
 Returns true if there was some system failure for this stream (such as, it couldn't be opened).

virtual InputStream * detach ()
 Returns the underlying input stream from this filter stream and detaches it so that it won't be deleted, and can be used further after this filter stream has been destroyed.

virtual bool eos ()
 Checks if the underlying stream's end has been reached. More...

virtual void close ()
 Closes the underlying input stream.

virtual ~FilterInputStream ()
 Destroys this FilterInputStream and the underlying input stream.


Protected Attributes

InputStream * in
 The underlying input stream, which serves as data source for this stream.

bool _detach
 Is the underlying input stream detached?


Detailed Description

A FilterInputStream is a stream which just performs any operations on another stream.

This class has no practical application, but it's a good starting point for clever streams.


Member Function Documentation

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

Checks if the underlying stream's end has been reached.

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

Implements lrt::InputStream.

Reimplemented in lrt::ParseInputStream.

void lrt::FilterInputStream::mark (    )  [virtual]
 

Marks the current position in the stream for later restoring it.

This will only work if the underlying input stream supports marking.

Reimplemented from lrt::InputStream.

Reimplemented in lrt::ParseInputStream.

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

Restores the previously marked position in the stream.

This will only work if the underlying input stream supports marking.

Reimplemented from lrt::InputStream.

Reimplemented in lrt::ParseInputStream.


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