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

rt::DefineInputStream Class Reference

An input stream which automatically replaces Defines while reading. More...

#include <robdefines.h>

Inheritance diagram for rt::DefineInputStream:

Inheritance graph
[legend]
List of all members.

Public Methods

 DefineInputStream (InputStream *in, const String &separators, const char commentStart=0)
virtual void close ()
 Closes the stream, and releases any system resources. More...

virtual ~DefineInputStream ()
void setIgnoreComments (bool)
void setAutoTrim (bool)
void setEnableDefines (bool)
virtual void mark ()
 Saves the current position in the stream for later restoring it. More...

virtual void reset ()
 If possible, restores the stream position saved by mark(). More...

virtual bool markSupported ()
 Returns whether marking and resetting a position in the stream is supported. More...

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

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

RobLoadReturnType getWord (String &word, const String &specialSeps="")
String getLine (bool skipEmpty=true)
int getLineNumber ()
bool skipRestOfLine ()
bool eos ()
 Checks if this stream's end has been reached. More...

bool isIdentifierValid (const String &str)
 checks the identifier (eg label name, define param) for validity. More...


Static Public Attributes

const String whitespace

Detailed Description

An input stream which automatically replaces Defines while reading.


Member Function Documentation

void rt::DefineInputStream::close (    )  [virtual]
 

Closes the stream, and releases any system resources.

Closed streams cannot be re-opened. The close method of class InputStream does nothing.

Reimplemented from lrt::InputStream.

bool rt::DefineInputStream::eos (    )  [virtual]
 

Checks if this stream's end has been reached.

This method must be implemented by subclassers!

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

Implements lrt::InputStream.

bool rt::DefineInputStream::isIdentifierValid (  const String &    str ) 
 

checks the identifier (eg label name, define param) for validity.

The function assumes that the first magic char (eg '?') was removed from the identifier.

void rt::DefineInputStream::mark (    )  [virtual]
 

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

Note that if marking is not supported, mark() has no effect.

See also:
markSupported() , reset()

Reimplemented from lrt::InputStream.

bool rt::DefineInputStream::markSupported (    )  [virtual]
 

Returns whether marking and resetting a position in the stream is supported.

The markSupported method of class InputStream always returns false.

See also:
mark()

Reimplemented from lrt::InputStream.

int rt::DefineInputStream::read (    )  [virtual]
 

Reads a byte from the stream.

If the stream cannot be read (or is EOF), this method returns -1. This method must be implemented by subclassers!

Returns:
The byte (in the lowest 8 bits of the returned integer), or -1 if the stream has ended.

Implements lrt::InputStream.

void rt::DefineInputStream::reset (    )  [virtual]
 

If possible, restores the stream position saved by mark().

If marking is not supported, reset() has no effect.

See also:
markSupported() , mark()

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