Go to the documentation of this file.
46 if(tok == token::END_STATEMENT)
continue;
76 if(
auto isKey = iEntry::readKeyword(is, key, nextTok ); isKey )
83 "expecting a valid token after keyword " << key <<
endl;
89 if( nextTok == token::BEGIN_BLOCK )
94 if( !parDict.
addPtr(key, ptr ))
97 "unable to add dicrionary " << key <<
106 if( !parDict.
addPtr(key, ptr ) )
109 "unable to add dataEntry " << key <<
122 if(nextTok != token::END_BLOCK )
125 "expecting a } but found "<< nextTok <<
endl;
135 "not expecting " << nextTok <<
endl;
143 "error in reading next token. \n";
169 "Error in wrting to file \n";
180 "Error in reading from file \n";
bool eof() const
Return true if end of input seen.
virtual iIstream & read(token &)=0
Return next token from stream.
#define fatalExit
Fatal exit.
Token class based on OpenFOAM stream, with some modifications/simplifications to be tailored to our n...
bool good() const
True if token is not UNDEFINED or ERROR.
virtual word globalName() const
global name of entry, separated with dots
iOstream & endl(iOstream &os)
Add newline and flush stream.
virtual bool write(iOstream &os) const =0
write to stream
Interface class for any input stream
virtual bool read(iIstream &is)=0
read from stream
bool bad() const
Return true if stream is corrupted.
#define fatalErrorInFunction
Report a fatal error and function name and exit the application.
static bool createEntry(dictionary &parDict, iIstream &is, bool hasBlockToken=false)
create an entry (dataEntry or dictionary) from stream
void putBack(const token &tok)
Put back token Only a single put back is permitted.
INLINE_FUNCTION iIstream & operator>>(iIstream &str, AB3History &ab3)
bool fatalCheck(const char *operation) const
Check IOstream status for given operation.
INLINE_FUNCTION iOstream & operator<<(iOstream &str, const AB3History &ab3)
virtual const word & name() const
Return the name of the stream.
bool addPtr(const word &keyword, uniquePtr< iEntry > &etry, bool warning=true)
add a pointer entry (dictionary/dataEntry) replaces this entry with existing one and issue a warning
bool writeKeyword(iOstream &os) const
#define ioErrorInFile(fileName, lineNumber)
Report an error in file operation with supplied fileName and lineNumber.
static bool readKeyword(iIstream &is, word &keyword, token &tok)
read a keyword from stream
Interface calss for data entry and dictionary
int32 lineNumber() const
Const access to the current stream line number.
Interface class for any output stream.
const word & wordToken() const
Return const reference to the word contents.
virtual iOstream & writeWordKeyword(const word &kw)
Write the keyword followed by an appropriate indentation.
Dictionary holds a set of data entries or sub-dictionaries that are enclosed in a curely braces or ar...
bool isWord() const
Token is word or DIRECTIVE word.