Go to the documentation of this file.
49 i >= 0 && i < list.
size()
68 tokens.
newElmt(nTok++) = std::move(tok);
97 const std::string&
input,
125 void Foam::ITstream::reserveCapacity
135 label
n = tokenList::size();
176 name_(std::move(is.name_)),
263 const std::string&
input,
297 os <<
"ITstream : " << name_.c_str() <<
", line ";
307 os << toks.first().lineNumber();
309 if (toks.first().lineNumber() < toks.last().lineNumber())
311 os <<
'-' << toks.last().lineNumber();
327 for (
const token& tok : *
this)
368 const label nToks = toks.size();
377 lineNumber_ = toks.first().lineNumber();
383 else if (pos < 0 || pos >= nToks)
390 lineNumber_ = toks.last().lineNumber();
402 lineNumber_ = toks[tokenIndex_].lineNumber();
414 const label nToks = toks.size();
419 while (
n++ && tokenIndex_)
424 if (tokenIndex_ < nToks)
426 lineNumber_ = toks[tokenIndex_].lineNumber();
434 while (
n-- && tokenIndex_ < nToks)
439 if (tokenIndex_ < nToks)
441 lineNumber_ = toks[tokenIndex_].lineNumber();
463 const label nToks = toks.size();
465 if (tokenIndex_ < nToks)
467 tok = toks[tokenIndex_++];
470 if (tokenIndex_ == nToks)
480 <<
"attempt to read beyond EOF"
569 reserveCapacity(tokenIndex_ + 1, lazy);
572 toks[tokenIndex_] = t;
579 reserveCapacity(tokenIndex_ + 1, lazy);
582 toks[tokenIndex_] = std::move(t);
589 reserveCapacity(tokenIndex_ + newTokens.
size(), lazy);
592 for (
const token& t : newTokens)
594 toks[tokenIndex_] = t;
602 reserveCapacity(tokenIndex_ + newTokens.size(), lazy);
605 for (
token& t : newTokens)
607 toks[tokenIndex_] = std::move(t);
622 Istream::operator=(is);
void append(const token &t, const bool lazy)
Similar to IStringStream but using an externally managed buffer for its input. This allows the input ...
T & newElmt(const label i)
double doubleScalar
A typedef for double.
virtual void rewind()
Rewind the stream so that it may be read again.
virtual Istream & readRaw(char *data, std::streamsize count)
Low-level raw binary read.
A class for handling words, derived from Foam::string.
void resize(const label len)
Adjust allocated size of list.
label lineNumber() const noexcept
The line number for the token.
float floatScalar
A typedef for float.
virtual void print(Ostream &os) const
Print stream description to Ostream.
streamFormat format() const noexcept
Get the current stream format.
Generic input stream using a standard (STL) stream.
Input/output from string buffers.
A token holds an item read from Istream.
void setOpened() noexcept
Set stream opened.
virtual Istream & read(token &tok)
Return next token from stream.
void operator=(const ITstream &is)
Copy assignment, with rewind()
void setGood() noexcept
Set stream state to be good.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
ITstream(const ITstream &is)
Copy construct.
An input stream of tokens.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
void print(Ostream &os) const
Print stream description to Ostream.
const token & peekFirst() const
Failsafe peek at the first token in the list.
void reset()
Reset token to UNDEFINED and clear any allocated storage.
const token & peekBack() const noexcept
Examine putback token without removing it.
The IOstreamOption is a simple container for options an IOstream can normally have.
void operator=(const UList< T > &a)
Assignment to UList operator. Takes linear time.
versionNumber version() const noexcept
Get the stream version.
static const token undefinedToken
An undefined token.
OBJstream os(runTime.globalPath()/outputName)
bool bad() const noexcept
True if stream is corrupted.
void seek(label pos)
Move tokenIndex to the specified position.
errorManipArg< error, int > exit(error &err, const int errNo=1)
List< token > tokenList
List of tokens, used for a IOdictionary entry.
bool good() const noexcept
True if token is not UNDEFINED or ERROR.
void skip(label n=1)
Move tokenIndex relative to the current position.
Foam::string str() const
Get the string - as Foam::string rather than std::string.
bool getBack(token &tok)
Get the put-back token if there is one.
bool hasPutback() const noexcept
True if putback token is in use.
std::string toString() const
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Output to string buffer, using a OSstream. Always UNCOMPRESSED.
const token & peekLast() const
Failsafe peek at the last token in the list.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void clear()
Clear the list, i.e. set size to zero.
static Istream & input(Istream &is, IntRange< T > &range)
virtual Istream & read(token &t)
Return next token from stream.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
static const token & peekTokenAt(const UList< token > &list, const label i)
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
static label parseStream(ISstream &is, tokenList &tokens)
void size(const label n)
Older name for setAddressableSize.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
const token & peek() const
Failsafe peek at what the next read would return,.
static tokenList parse(const UList< char > &input, IOstreamOption streamOpt=IOstreamOption())
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
dimensionedScalar pos(const dimensionedScalar &ds)