49 i >= 0 && i < list.
size()
68 tokens.
newElmt(nTok++) = std::move(tok);
97 const std::string&
input,
125void Foam::ITstream::reserveCapacity
176 name_(std::move(is.name_)),
263 const std::string&
input,
297 os <<
"ITstream : " << name_.c_str() <<
", line ";
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);
Input/output from string buffers.
Foam::string str() const
Get the string - as Foam::string rather than std::string.
virtual bool resize()
Resize the ODE solver.
The IOstreamOption is a simple container for options an IOstream can normally have.
bool bad() const noexcept
True if stream is corrupted.
void setGood() noexcept
Set stream state to be good.
void setOpened() noexcept
Set stream opened.
Generic input stream using a standard (STL) stream.
virtual Istream & read(token &t)
Return next token from stream.
An input stream of tokens.
const token & peek() const
Failsafe peek at what the next read would return,.
std::string toString() const
const token & peekFirst() const
Failsafe peek at the first token in the list.
const token & peekLast() const
Failsafe peek at the last token in the list.
void seek(label pos)
Move tokenIndex to the specified position.
void skip(label n=1)
Move tokenIndex relative to the current position.
virtual void rewind()
Rewind the stream so that it may be read again.
static tokenList parse(const UList< char > &input, IOstreamOption streamOpt=IOstreamOption())
virtual Istream & readRaw(char *data, std::streamsize count)
Low-level raw binary read.
void operator=(const ITstream &is)
Copy assignment, with rewind()
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.
const token & peekBack() const noexcept
Examine putback token without removing it.
bool hasPutback() const noexcept
True if putback token is in use.
T & newElmt(const label i)
void operator=(const UList< token > &a)
Assignment to UList operator. Takes linear time.
void resize(const label len)
Adjust allocated size of list.
void clear()
Clear the list, i.e. set size to zero.
Output to string buffer, using a OSstream. Always UNCOMPRESSED.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual bool read()
Re-read model coefficients if they have changed.
Similar to IStringStream but using an externally managed buffer for its input. This allows the input ...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
T & first()
Return the first element of the list.
bool empty() const noexcept
True if the UList is empty (ie, size() is zero)
void size(const label n)
Older name for setAddressableSize.
T & last()
Return the last element of the list.
void operator=(const ObukhovLength &)=delete
No copy assignment.
scalar print()
Print to screen.
A token holds an item read from Istream.
label lineNumber() const noexcept
The line number for the token.
bool good() const noexcept
True if token is not UNDEFINED or ERROR.
void reset()
Reset token to UNDEFINED and clear any allocated storage.
static const token undefinedToken
An undefined token.
bool append() const noexcept
True if output format uses an append mode.
A class for handling words, derived from Foam::string.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
OBJstream os(runTime.globalPath()/outputName)
dimensionedScalar pos(const dimensionedScalar &ds)
static label parseStream(ISstream &is, tokenList &tokens)
static Istream & input(Istream &is, IntRange< T > &range)
double doubleScalar
A typedef for double.
static const token & peekTokenAt(const UList< token > &list, const label i)
float floatScalar
A typedef for float.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
word format(conversionProperties.get< word >("format"))