41 return sptr ? sptr->
stdStream().tellg() : std::streampos(0);
75 <<
"Attempt to put back onto bad stream"
78 else if (putBackAvail_)
81 <<
"Attempt to put back another token"
97 <<
"Attempt to get back from bad stream"
100 else if (putBackAvail_)
102 putBackAvail_ =
false;
113 const token delimiter(*
this);
120 <<
"' while reading " << funcName
121 <<
", found " << delimiter.
info() <<
nl
131 const token delimiter(*
this);
138 <<
"' while reading " << funcName
139 <<
", found " << delimiter.
info()
140 <<
" at stream position " << stream_tellg(
this) <<
nl
150 const token delimiter(*
this);
158 <<
"' while reading " << funcName
159 <<
", found " << delimiter.
info()
165 return delimiter.
pToken();
171 const token delimiter(*
this);
179 <<
"' while reading " << funcName
180 <<
", found " << delimiter.
info()
181 <<
" at stream position " << stream_tellg(
this) <<
nl
187 return delimiter.
pToken();
199 return const_cast<Istream&
>(*this);
void exit(const int errNo=1)
Exit : can be called for any error to exit program.
Generic input stream using a standard (STL) stream.
virtual std::istream & stdStream()
Access to underlying std::istream.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
bool getBack(token &tok)
Get the put-back token if there is one.
Istream & operator()() const
Return a non-const reference to const Istream.
char readEndList(const char *funcName)
End read of list data, ends with ')' or '}'.
bool readEnd(const char *funcName)
End read of data chunk, ends with ')'.
const token & peekBack() const noexcept
Examine putback token without removing it.
char readBeginList(const char *funcName)
Begin read of list data, starts with '(' or '{'.
bool readBegin(const char *funcName)
Begin read of data chunk, starts with '('.
void putBack(const token &tok)
Put back a token. Only a single put back is permitted.
A token holds an item read from Istream.
@ BEGIN_BLOCK
Begin block [isseparator].
@ END_BLOCK
End block [isseparator].
@ BEGIN_LIST
Begin list [isseparator].
@ END_LIST
End list [isseparator].
punctuationToken pToken() const
Return punctuation character.
InfoProxy< token > info() const
Return info proxy for printing token information to a stream.
void reset()
Reset token to UNDEFINED and clear any allocated storage.
static const token undefinedToken
An undefined token.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
static void check(const int retVal, const char *what)
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)