Go to the documentation of this file.
49 i >= 0 && i < list.
size()
63 tokens.resize(64, token());
66 while (!is.read(tok).bad() && tok.good())
68 tokens.newElmt(nTok++) = std::move(tok);
97 const std::string&
input,
125 void Foam::ITstream::reserveCapacity
135 label
n = tokenList::size();
162 Istream(static_cast<IOstreamOption>(is)),
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_++];
468 lineNumber_ = tok.lineNumber();
470 if (tokenIndex_ == nToks)
480 <<
"attempt to read beyond EOF"
493 tok.lineNumber(toks.last().lineNumber());
497 tok.lineNumber(this->lineNumber());
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
Floating-point double precision scalar type.
virtual Istream & readRaw(char *data, std::streamsize count)
A class for handling words, derived from Foam::string.
void resize(const label len)
label lineNumber() const noexcept
float floatScalar
Floating-point single precision scalar type.
virtual void print(Ostream &os) const
streamFormat format() const noexcept
Generic input stream using a standard (STL) stream.
label lineNumber() const noexcept
Input/output from string buffers.
A token holds an item read from Istream.
void setOpened() noexcept
virtual Istream & read(token &tok)
void operator=(const ITstream &is)
word format(conversionProperties.get< word >("format"))
ITstream(const ITstream &is)
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
const token & peekFirst() const
const token & peekBack() const noexcept
The IOstreamOption is a simple container for options an IOstream can normally have.
void operator=(const UList< T > &a)
versionNumber version() const noexcept
static const token undefinedToken
OBJstream os(runTime.globalPath()/outputName)
bool bad() const noexcept
errorManipArg< error, int > exit(error &err, const int errNo=1)
List< token > tokenList
List of tokens, used for a IOdictionary entry.
const std::string version
bool good() const noexcept
bool hasPutback() const noexcept
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...
const token & peekLast() const
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
static Istream & input(Istream &is, IntRange< T > &range)
virtual Istream & read(token &t)
word name(const expressions::valueTypeCode typeCode)
static const token & peekTokenAt(const UList< token > &list, const label i)
#define FatalIOErrorInFunction(ios)
static label parseStream(ISstream &is, tokenList &tokens)
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
const token & peek() const
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)