35template<
class LListBase,
class T>
44template<
class LListBase,
class T>
56 is.
fatalCheck(
"LList::readList : reading first token");
60 const label len = tok.labelToken();
69 for (label i=0; i<len; ++i)
83 for (label i=0; i<len; ++i)
93 else if (tok.isPunctuation(token::BEGIN_LIST))
98 while (!tok.isPunctuation(token::END_LIST))
113 <<
"incorrect first token, expected <int> or '(', found "
115 <<
exit(FatalIOError);
123template<
class LListBase,
class T>
132 const label len = this->size();
136 (len <= 1 || !shortLen)
145 for (
const T& val : *
this)
158 os << nl << len << nl << token::BEGIN_LIST << nl;
161 for (
const T& val : *
this)
167 os << token::END_LIST;
175template<
class LListBase,
class T>
178 return list.readList(is);
182template<
class LListBase,
class T>
185 return list.writeList(
os, -1);
bool fatalCheck(const char *operation) const
Check IOstream status for given operation.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
char readEndList(const char *funcName)
End read of list data, ends with ')' or '}'.
char readBeginList(const char *funcName)
Begin read of list data, starts with '(' or '{'.
void putBack(const token &tok)
Put back a token (copy). Only a single put back is permitted.
Template class for non-intrusive linked lists.
LList()=default
Default construct.
friend Istream & operator>>(Istream &, LList< LListBase, T > &lst)
Read list from Istream.
void push_back(const T &elem)
Add copy at back of list.
Ostream & writeList(Ostream &os, const label shortLen=0) const
Write LList with line-breaks when length exceeds shortLen.
void clear()
Delete contents of list.
Istream & readList(Istream &is)
Read list from Istream.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A token holds an item read from Istream.
bool isPunctuation() const noexcept
Token is PUNCTUATION.
@ BEGIN_LIST
Begin list [isseparator].
@ END_LIST
End list [isseparator].
bool isLabel() const noexcept
Integral token is convertible to Foam::label.
label labelToken() const
Return integer type as label value or Error.
InfoProxy< token > info() const noexcept
Return info proxy, for printing token information to a stream.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
OBJstream os(runTime.globalPath()/outputName)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
Istream & operator>>(Istream &, directionInfo &)
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
errorManipArg< error, int > exit(error &err, const int errNo=1)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
constexpr char nl
The newline '\n' character (0x0a).