Go to the documentation of this file.
20 #ifndef __iIstream_hpp__
21 #define __iIstream_hpp__
135 virtual void rewind() = 0;
137 virtual void seek(
size_t pos) = 0;
140 virtual size_t tell() = 0;
201 bool readEnd(
const char* funcName);
259 inline iIstream&
operator>>( iIstream& is,
float& val);
261 inline iIstream&
operator>>( iIstream& is,
double& val);
263 inline iIstream&
operator>>( iIstream& is,
size_t& val);
273 #endif //__iIstream_hpp__
bool readBegin(const char *funcName)
Begin read of data chunk, starts with '('.
virtual void seek(size_t pos)=0
virtual bool findTokenAndNextSilent(const word &w, word &nextW, int32 limitLine=100)
T lookupDataOrSet(const word &keyword, const T &setVal)
lookup for keyword and data; set to setVal if lookup fails.
virtual iIstream & read(token &)=0
Return next token from stream.
Token class based on OpenFOAM stream, with some modifications/simplifications to be tailored to our n...
virtual iIstream & readString(word &)=0
Read a string.
bool readEnd(const char *funcName)
End read of data chunk, ends with ')' return true or FatalIOError.
char readEndStatement(const char *funcName)
End statement character ;.
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 findTokenSilent(const word &w, int32 limitLine=100)
search for all tokesn and find the first word token that matchs
IOstream &(* IOstreamManip)(IOstream &)
An IOstream manipulator.
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 void rewind()=0
Rewind the stream so that it may be read again.
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
iIstream &(* iIstreamManip)(iIstream &)
bool getBack(token &tok)
Get the put back token if there is one and return true.
bool nextData(const word &keyword, T &data)
read the data next to keword keyword data; check the keyword is correct or not
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.
INLINE_FUNCTION iIstream & operator>>(iIstream &str, AB3History &ab3)
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...
auto count(const Vector< T, Allocator > &vec, const T &val)
iIstream & operator()() const
void resetPutBack()
reset the put back token;
virtual size_t tell()=0
Return current position indicator.
T lookupData(const word &keyword)
lookup for keyword and data; fatalExit if fails
bool readBeginSquare(const char *funcName)
Begin read of data chunk, starts with '('.
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 ...
unsigned long long int uint64
virtual bool findToken(const word &w)
search for all tokesn and find the first word token tbat matchs w
A base calss for input/output streams.
virtual ~iIstream()=default
Destructor.
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.