35 template<
class LListBase,
class T>
44 template<
class LListBase,
class T>
56 is.
fatalCheck(
"LList::readList : reading first token");
60 const label len = tok.labelToken();
67 if (delimiter == token::BEGIN_LIST)
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 " 123 template<
class LListBase,
class T>
132 const label len = this->size();
136 (len <= 1 || !shortLen)
141 os << len << token::BEGIN_LIST;
145 for (
const T& val : *
this)
147 if (space)
os << token::SPACE;
153 os << token::END_LIST;
158 os <<
nl << len <<
nl << token::BEGIN_LIST <<
nl;
161 for (
const T& val : *
this)
167 os << token::END_LIST;
175 template<
class LListBase,
class T>
178 return list.readList(is);
182 template<
class LListBase,
class T>
183 Foam::Ostream& Foam::operator<<(Ostream& os, const LList<LListBase, T>& list)
185 return list.writeList(
os, -1);
errorManipArg< error, int > exit(error &err, const int errNo=1)
char readEndList(const char *funcName)
End read of list data, ends with ')' or '}'.
Template class for non-intrusive linked lists.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
constexpr char nl
The newline '\n' character (0x0a)
A token holds an item read from Istream.
Istream & readList(Istream &is)
Read list from Istream.
Ostream & writeList(Ostream &os, const label shortLen=0) const
Write LList with line-breaks when length exceeds shortLen.
void putBack(const token &tok)
Put back a token (copy). Only a single put back is permitted.
Istream & operator>>(Istream &, directionInfo &)
LList()=default
Default construct.
void push_back(const T &elem)
Add copy at back of list.
char readBeginList(const char *funcName)
Begin read of list data, starts with '(' or '{'.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
void clear()
Delete contents of list.
bool fatalCheck(const char *operation) const
Check IOstream status for given operation.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...