Go to the documentation of this file.
34 "putBack is already full. \n";
87 return findTokenResume(w);
93 bool isFirstToken =
true;
95 while( !eof() && good() )
101 "error in reading stream " << name() <<
102 " at line number "<< lineNumber()<<
endl;
106 if( next.
isWord() && isFirstToken)
117 isFirstToken =
false;
126 return findTokenResumeSilent(w,limitLine);
132 bool isFirstToken =
true;
134 while( !eof() && good() && lineNumber()<limitLine )
142 if( next.
isWord() && isFirstToken)
150 isFirstToken =
false;
160 bool checkEndStatement
177 if( checkEndStatement )
184 " expected ; but found " << next;
195 " token is not a word" << next <<
endl;
205 if( findTokenSilent(w, limitLine) )
241 const token delimiter(*
this);
249 <<
"' while reading " << funcName
250 <<
", found " << delimiter <<
endl;
260 const token delimiter(*
this);
268 <<
"' while reading " << funcName
279 const token delimiter(*
this);
287 <<
"' while reading " << funcName
298 const token delimiter(*
this);
306 <<
"' while reading " << funcName
317 const token delimiter(*
this);
325 <<
"' while reading " << funcName
326 <<
", found " << delimiter<<
endl;
332 return delimiter.
pToken();
338 const token delimiter(*
this);
347 <<
"' while reading " << funcName
348 <<
", found " << delimiter
349 <<
" at stream position " <<
endl;
355 return delimiter.
pToken();
362 const token delimiter(*
this);
368 " expected ; but found " << delimiter <<
endl;
374 return delimiter.
pToken();
381 check(
"iIstream::operator()");
385 return const_cast<iIstream&
>(*this);
bool readBegin(const char *funcName)
Begin read of data chunk, starts with '('.
#define notImplementedFunction
Report that a function is yet not implemented.
virtual bool findTokenAndNextSilent(const word &w, word &nextW, int32 limitLine=100)
#define fatalExit
Fatal exit.
Token class based on OpenFOAM stream, with some modifications/simplifications to be tailored to our n...
punctuationToken pToken() const
Return punctuation character.
bool isEndBlock() const
Token is end endBlock.
@ END_BLOCK
Begin block [isseparator].
bool error() const
Token is ERROR.
bool readEnd(const char *funcName)
End read of data chunk, ends with ')' return true or FatalIOError.
char readEndStatement(const char *funcName)
End statement character ;.
iOstream & endl(iOstream &os)
Add newline and flush stream.
@ BEGIN_BLOCK
End dimensions [isseparator].
virtual bool findTokenSilent(const word &w, int32 limitLine=100)
search for all tokesn and find the first word token that matchs
virtual bool findTokenResume(const word &w)
search for all tokesn after the current file position and find the first word token tbat matchs w
void reset()
Reset token to UNDEFINED and clear any allocated storage.
virtual bool findTokenResumeSilent(const word &w, int32 limitLine=100)
search for all tokesn after the current file position and find the first word token tbat matchs w
Interface class for any input stream
bool bad() const
Return true if stream is corrupted.
bool getBack(token &tok)
Get the put back token if there is one and return true.
#define fatalErrorInFunction
Report a fatal error and function name and exit the application.
char readBeginList(const char *funcName)
Begin read of list data, starts with '(' or '{' return starting delimiter or FatalIOError.
bool putBack_
Has a token been put back on the stream?
void putBack(const token &tok)
Put back token Only a single put back is permitted.
virtual bool findTokenAndNext(const word &w, word &nextW, bool checkEndStatement=true)
search for all tokens and find the first word token and also next word token chekck if it is eneded w...
@ END_LIST
Begin list [isseparator].
iIstream & operator()() const
virtual const word & name() const
Return the name of the stream.
bool readBeginSquare(const char *funcName)
Begin read of data chunk, starts with '('.
@ BEGIN_LIST
End entry [isseparator].
@ BEGIN_SQR
End list [isseparator].
token putBackToken_
The last token put back on the stream.
char readEndList(const char *funcName)
End read of list data, ends with ')' or '}' return closing delimiter or FatalIOError.
virtual size_t findBinaryBlockStart()
It seek for a character sequence that indicates the start of a binary block char sequence is 255 255 ...
#define ioErrorInFile(fileName, lineNumber)
Report an error in file operation with supplied fileName and lineNumber.
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 isEndStatement() const
Token is end statement.
@ END_SQR
Begin dimensions [isseparator].
const word & wordToken() const
Return const reference to the word contents.
bool isWord() const
Token is word or DIRECTIVE word.
bool readEndSquare(const char *funcName)
Begin read of data chunk, starts with '('.
bool peekBack(token &tok)
Peek at the put back token without removing it.