Go to the documentation of this file.
36 Foam::label Foam::ITstream::parseStream(ISstream& is,
tokenList& tokens)
41 tokens.resize(64, token());
44 while (!is.read(tok).bad() && tok.good())
46 tokens.newElmt(nTok++) = std::move(tok);
64 parseStream(is, tokens);
71 const std::string& input,
84 parseStream(is, tokens);
98 parseStream(is, tokens);
105 void Foam::ITstream::reserveCapacity
115 label
n = tokenList::size();
155 parseStream(is,
static_cast<tokenList&
>(*
this));
163 const std::string& input,
175 parseStream(is,
static_cast<tokenList&
>(*
this));
195 parseStream(is,
static_cast<tokenList&
>(*
this));
204 os <<
"ITstream : " << name_.c_str() <<
", line ";
210 if (tokenList::first().lineNumber() < tokenList::last().lineNumber())
232 label len = tokens.size();
237 for (
const token& tok : tokens)
260 if (tokenIndex_ < size())
262 tok = operator[](tokenIndex_++);
265 if (tokenIndex_ == size())
275 <<
"attempt to read beyond EOF"
288 tok.
lineNumber() = tokenList::last().lineNumber();
374 lineNumber_ = toks.first().lineNumber();
380 else if (pos < 0 || pos >= toks.size())
383 tokenIndex_ = toks.size();
387 lineNumber_ = toks.last().lineNumber();
399 lineNumber_ = toks[tokenIndex_].lineNumber();
410 reserveCapacity(tokenIndex_ + 1, lazy);
413 toks[tokenIndex_] = t;
420 reserveCapacity(tokenIndex_ + 1, lazy);
423 toks[tokenIndex_] = std::move(t);
430 reserveCapacity(tokenIndex_ + newTokens.size(), lazy);
433 for (
const token& t : newTokens)
435 toks[tokenIndex_] = t;
443 reserveCapacity(tokenIndex_ + newTokens.size(), lazy);
446 for (
token& t : newTokens)
448 toks[tokenIndex_] = std::move(t);
460 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 ...
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.
float floatScalar
A typedef for float.
virtual void print(Ostream &os) const
Print stream description to Ostream.
static const versionNumber currentVersion
The current version number (2.0)
Input/output from string buffers.
A token holds an item read from Istream.
virtual Istream & read(token &tok)
Return next token from stream.
void operator=(const ITstream &is)
Copy assignment, with rewind()
word format(conversionProperties.get< word >("format"))
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
ITstream(const ITstream &is)
Copy construct.
Representation of a major/minor version number.
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.
word name(const complex &c)
Return string representation of complex.
void reset()
Reset token to UNDEFINED and clear any allocated storage.
void operator=(const UList< T > &a)
Assignment to UList operator. Takes linear time.
void resize(const label newSize)
Adjust allocated size of list.
streamFormat
Data format (ascii | binary)
static tokenList parse(const UList< char > &input, streamFormat format=ASCII)
void seek(label pos)
Move the 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.
const std::string version
OpenFOAM version (name or stringified number) as a std::string.
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 and return true.
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.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
label lineNumber() const
Const access to the current stream line number.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
label lineNumber() const
The line number for the token.
dimensionedScalar pos(const dimensionedScalar &ds)