38 #ifndef Foam_ITstream_H 39 #define Foam_ITstream_H 76 void reserveCapacity(
const label nElem,
const bool lazy);
81 inline const token& peekAt(
const label i)
const 86 ? tokenList::operator[](i)
106 const string&
name =
"input" 113 const string&
name =
"input",
122 const string&
name =
"input" 130 const string&
name =
"input" 139 const string&
name =
"input" 146 const std::string&
input,
148 const string&
name =
"input" 157 const string&
name =
"input" 204 const std::string&
input,
238 const token&
front()
const {
return peekAt(0); }
247 const token&
peek()
const;
258 return size() - tokenIndex_;
271 void skip(label
n = 1);
304 virtual ios_base::fmtflags
flags()
const 306 return ios_base::fmtflags(0);
310 ios_base::fmtflags
flags(
const ios_base::fmtflags)
312 return ios_base::fmtflags(0);
376 using Istream::operator();
389 #ifdef Foam_IOstream_extras 423 void append(
const token& t,
const bool lazy)
430 void append(token&& t,
const bool lazy)
441 void append(
const UList<token>& newTokens,
const bool lazy)
static const token undefinedToken
An undefined token.
const token & front() const
Failsafe peek at the first token in the list.
A class for handling file names.
void seek(label pos)
Move tokenIndex to the specified position.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
A token holds an item read from Istream.
void skip(label n=1)
Move tokenIndex relative to the current position.
A simple container for options an IOstream can normally have.
std::string toString() const
Concatenate tokens into a space-separated std::string. The resulting string may contain quote charact...
label tokenIndex() const noexcept
The current token index when reading, or the insertion point.
label nRemainingTokens() const noexcept
Number of tokens remaining.
virtual bool endRawRead()
End of low-level raw binary read.
const token & peek() const
Failsafe peek at what the next read would return, including handling of any putback.
static tokenList parse(const UList< char > &input, IOstreamOption streamOpt=IOstreamOption())
Create token list by parsing the input character sequence until no good tokens remain.
constexpr IOstreamOption(streamFormat fmt=streamFormat::ASCII, compressionType comp=compressionType::UNCOMPRESSED) noexcept
Default construct (ASCII, UNCOMPRESSED, currentVersion) or construct with format, compression...
dimensionedScalar pos(const dimensionedScalar &ds)
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
virtual bool beginRawRead()
Start of low-level raw binary read.
void append(const token &t, const bool lazy)
Copy append a token at the current tokenIndex, incrementing the index.
A class for handling words, derived from Foam::string.
static Istream & input(Istream &is, IntRange< T > &range)
bool hasPutback() const noexcept
True if putback token is in use.
virtual Istream & readRaw(char *data, std::streamsize count)
Low-level raw binary read.
const token & peekFirst() const
Same as front()
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
virtual void rewind()
Rewind the stream so that it may be read again.
OBJstream os(runTime.globalPath()/outputName)
Database for solution data, solver performance and other reduced data.
virtual ios_base::fmtflags flags() const
Get stream flags - always 0.
virtual ~ITstream()=default
Destructor.
bool hasPutback() const noexcept
True if putback token is in use.
streamFormat
Data format (ascii | binary)
label size() const noexcept
The number of elements in the UList.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
virtual Istream & read(token &tok)
Return next token from stream.
void push_back(const token &t, const bool lazy)
Copy append a token at the current tokenIndex, incrementing the index.
virtual const fileName & name() const
The name of the input token stream.
ITstream(const ITstream &is)
Copy construct.
void operator=(const ITstream &is)
Copy assignment, with rewind()
void print(Ostream &os) const
Print stream description to Ostream.
const token & back() const
Failsafe peek at the last token in the list.
An input stream of tokens.