Wrapps an std::istream and provides basic functions for extracting numbers and strings.
More...
#include <parser.h>
Wrapps an std::istream and provides basic functions for extracting numbers and strings.
Clasp::StreamSource::StreamSource |
( |
std::istream & |
is | ) |
|
|
explicit |
void Clasp::StreamSource::error |
( |
const char * |
err | ) |
const |
|
inline |
unsigned Clasp::StreamSource::line |
( |
| ) |
const |
|
inline |
Returns the number of matched EOLs + 1.
bool Clasp::StreamSource::match |
( |
char |
c | ) |
|
|
inline |
Consumes next character if equal to c.
bool Clasp::StreamSource::matchEol |
( |
| ) |
|
Consumes next character(s) if equal to EOL.
Consumes the next character if it is either '
' or '' and increments the internal line counter.
- Note
- If next char is '', the function will also consume a following '
' (i.e. matchEol also matches CR/LF).
char Clasp::StreamSource::operator* |
( |
| ) |
|
|
inline |
Returns the character at the current reading-position.
Advances the current reading-position.
bool Clasp::StreamSource::parseInt |
( |
int & |
val | ) |
|
Reads a base-10 integer.
- Precondition
- system uses ASCII
bool Clasp::StreamSource::parseInt |
( |
int & |
val, |
|
|
int |
min, |
|
|
int |
max |
|
) |
| |
int Clasp::StreamSource::parseInt |
( |
int |
min, |
|
|
int |
max, |
|
|
const char * |
err |
|
) |
| |
|
inline |
bool Clasp::StreamSource::parseInt64 |
( |
int64 & |
val | ) |
|
bool Clasp::StreamSource::skipSpace |
( |
| ) |
|
|
inline |
Skips horizontal white-space.
bool Clasp::StreamSource::skipWhite |
( |
| ) |
|
|
inline |
Skips horizontal and vertical white-space.
The documentation for this class was generated from the following files:
- /Users/danielbaeck/Dropbox/Uni Klagenfurt/Diplomarbeit/gringo44/libclasp/clasp/parser.h
- /Users/danielbaeck/Dropbox/Uni Klagenfurt/Diplomarbeit/gringo44/libclasp/src/parser.cpp