#include <rtstreams.h>
Inheritance diagram for lrt::ParseInputStream:

Public Methods | |
| ParseInputStream (InputStream *in, const String &separators, const char commentStart=0) | |
| Creates a new ParseInputStream. More... | |
| void | setIgnoreComments (bool) |
| Set if comments can be ignored. More... | |
| void | setAutoTrim (bool) |
| Set if returned words and lines are auto-trimmed. More... | |
| 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, or from the internal buffer. | |
| String | getWord (const String &specialSeps="") |
| Reads a word from the input stream. More... | |
| String | getLine (bool skipEmpty=true) |
| Reads a whole line from the input stream. More... | |
| int | getLineNumber () |
| Gets the current line number. | |
| bool | skipRestOfLine () |
| Discards the rest of the current line. More... | |
| bool | eos () |
| Returns true if the end of the underlying input stream is reached. | |
Static Public Attributes | |
| const String | whitespace |
The separators which make up whitespace, i.e. ' ', '\t' and ''. More... | |
It also keeps information about the current line number.
|
||||||||||||||||
|
Creates a new ParseInputStream.
|
|
|
Reads a whole line from the input stream.
|
|
|
Reads a word from the input stream.
|
|
|
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::FilterInputStream. |
|
|
Restores the previously marked position in the stream. This will only work if the underlying input stream supports marking. Reimplemented from lrt::FilterInputStream. |
|
|
Set if returned words and lines are auto-trimmed. If true, words and lines returned by a getWord() or getLine() will be stripped of any whitespace (including line ends). Also, words or lines which only consist of whitespace will be ignored completely. The line number counter will still work correctly. This option is turned off by default. |
|
|
Set if comments can be ignored. If true, comments will be skipped automatically by a getWord() or getLine(). Also, lines which only consist of a comment will be skipped completely. The line number counter will still work correctly. This option is turned off by default. |
|
|
Discards the rest of the current line. This includes the line end character '\n'. |
|
|
The separators which make up whitespace, i.e. '
This is a useful constant for the |