41 if (token::compound::isCompound(tag))
43 os << tag << token::SPACE;
50 else if (
os.format() == IOstream::ASCII)
53 os << 0 << token::BEGIN_LIST << token::END_LIST;
70 os.writeKeyword(keyword);
73 os << token::END_STATEMENT <<
endl;
86 const label len = list.
size();
103 os << len << token::BEGIN_BLOCK << list[0] << token::END_BLOCK;
107 (len <= 1 || !shortLen)
122 os << len << token::BEGIN_LIST;
125 for (label i=0; i < len; ++i)
127 if (i)
os << token::SPACE;
132 os << token::END_LIST;
139 os <<
nl << len <<
nl << token::BEGIN_LIST <<
nl;
142 for (label i=0; i < len; ++i)
148 os << token::END_LIST << nl;
162 const label len = list.
size();
168 is.
fatalCheck(
"UList<T>::readList(Istream&) : reading first token");
183 const label inputLen = elems.
size();
189 <<
"incorrect length for UList. Read "
190 << inputLen <<
" expected " << len
194 for (label i = 0; i < len; ++i)
196 list[i] = std::move(elems[i]);
209 <<
"incorrect length for UList. Read "
210 << inputLen <<
" expected " << len
220 Detail::readContiguous<T>
229 "UList<T>::readList(Istream&) : "
230 "reading binary block"
241 if (delimiter == token::BEGIN_LIST)
243 for (label i=0; i<len; ++i)
249 "UList<T>::readList(Istream&) : "
263 "UList<T>::readList(Istream&) : "
264 "reading the single entry"
267 for (label i=0; i<len; ++i)
286 if (sll.size() != len)
289 <<
"incorrect length for UList. Read "
290 << sll.size() <<
" expected " << len
295 for (label i = 0; i < len; ++i)
303 <<
"incorrect first token, expected <int> or '(', found "
Non-intrusive singly-linked list.
streamFormat format() const noexcept
Get the current stream format.
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. Only a single put back is permitted.
Template class for non-intrusive linked lists.
T removeHead()
Remove and return first entry.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void transfer(List< T > &list)
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
char * data_bytes() noexcept
Return pointer to the underlying array serving as data storage,.
bool uniform() const
True if all entries have identical values, and list is non-empty.
const char * cdata_bytes() const noexcept
Return pointer to the underlying array serving as data storage,.
void writeEntry(Ostream &os) const
Write the UList with its compound type.
void size(const label n)
Older name for setAddressableSize.
Ostream & writeList(Ostream &os, const label shortLen=0) const
Write List, with line-breaks in ASCII when length exceeds shortLen.
Istream & readList(Istream &is)
Read List contents from Istream.
std::streamsize size_bytes() const noexcept
Number of contiguous bytes for the List data.
A traits class, which is primarily used for primitives.
A templated class for holding compound tokens.
A token holds an item read from Istream.
compound & transferCompoundToken()
Return reference to compound and mark internally as released.
bool isPunctuation() const noexcept
Token is PUNCTUATION.
bool isLabel() const noexcept
Token is LABEL.
label labelToken() const
Return label value.
InfoProxy< token > info() const
Return info proxy for printing token information to a stream.
bool isCompound() const noexcept
Token is COMPOUND.
A class for handling words, derived from Foam::string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
OBJstream os(runTime.globalPath()/outputName)
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
To & dynamicCast(From &r)
A template class to specify that a data type can be considered as being contiguous in memory.