Go to the documentation of this file.
31 if( checkEndStatement )
57 if( !findKeywordAndVal(keyword, val) )
60 " error in finding keyword "<< keyword <<
" and value next to it.";
72 if(!findKeywordAndVal(keyword, val))
86 if( !eof() && good() )
98 " expected word token.";
104 " expected keyword "<< keyword <<
" but found "<<next.
wordToken()<<
endl;
116 " expected ; but found "<< next<<
endl;
135 <<
"Bad token - could not get word/string value";
152 <<
"Wrong token type - expected word/string value, found "
170 <<
"Bad token - could not get int64 value";
183 <<
"Wrong token type - expected int64 value, found "
199 val =
static_cast<int32>(lval);
208 val =
static_cast<int8>(lval);
216 val =
static_cast<uint64>(lval);
224 val =
static_cast<uint32>(lval);
232 val =
static_cast<uint8>(lval);
244 <<
"Bad token - could not get float value";
257 <<
"Wrong token type - expected float value, found "
274 <<
"Bad token - could not get double value";
287 <<
"Wrong token type - expected double value, found "
304 <<
"Bad token - could not get double value";
312 val =
static_cast<size_t>(t.
number());
317 <<
"Wrong token type - expected double value, found "
T lookupDataOrSet(const word &keyword, const T &setVal)
lookup for keyword and data; set to setVal if lookup fails.
#define fatalExit
Fatal exit.
Token class based on OpenFOAM stream, with some modifications/simplifications to be tailored to our n...
const word & stringToken() const
Return const reference to the string contents.
bool error() const
Token is ERROR.
bool good() const
True if token is not UNDEFINED or ERROR.
real number() const
Return int64, float or double value.
iOstream & endl(iOstream &os)
Add newline and flush stream.
bool findKeywordAndVal(const word &keyword, T &val, bool checkEndStatement=true)
find a pair of keyword and data terminated by ; keyword data; return false if keyword does not exist ...
virtual bool check(const char *operation) const
Check IOstream status for given operation.
Interface class for any input stream
bool nextData(const word &keyword, T &data)
read the data next to keword keyword data; check the keyword is correct or not
void setBad()
Set stream to be bad.
INLINE_FUNCTION iIstream & operator>>(iIstream &str, AB3History &ab3)
virtual const word & name() const
Return the name of the stream.
T lookupData(const word &keyword)
lookup for keyword and data; fatalExit if fails
#define ioErrorInFile(fileName, lineNumber)
Report an error in file operation with supplied fileName and lineNumber.
unsigned long long int uint64
int32 lineNumber() const
Const access to the current stream line number.
virtual bool findToken(const word &w)
search for all tokesn and find the first word token tbat matchs w
bool isNumber() const
Token is int, float or duble.
bool isEndStatement() const
Token is end statement.
const word & wordToken() const
Return const reference to the word contents.
bool isString() const
Token is STRING, VARIABLE or VERBATIM string.
bool isWord() const
Token is word or DIRECTIVE word.