73 const std::streamsize
count(this->size());
103 return writeChars(
os, this->cdata(), std::streamsize(this->size()));
113 const label len = list.
size();
119 is.
fatalCheck(
"UList<char>::readList(Istream&) : reading first token");
121 if (tok.isCompound())
130 tok.transferCompoundToken(is)
134 const label inputLen = elems.
size();
140 <<
"incorrect length for UList. Read " 141 << inputLen <<
" expected " << len
145 this->deepCopy(elems);
151 const label inputLen = tok.labelToken();
157 <<
"incorrect length for UList. Read " 158 << inputLen <<
" expected " << len
169 is.
read(list.
data(), std::streamsize(len));
175 "UList<char>::readList(Istream&) : " 176 "reading binary block" 183 <<
"incorrect first token, expected <int>, found " virtual Ostream & write(const char c)
Write character.
void size(const label n)
Older name for setAddressableSize.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void transfer(List< T > &list)
Transfer the contents of the argument List into this list and annul the argument list.
virtual bool check(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)...
constexpr char nl
The newline '\n' character (0x0a)
A token holds an item read from Istream.
T * data() noexcept
Return pointer to the underlying array serving as data storage.
Istream & readList(Istream &is)
Read List contents from Istream.
A templated class for holding compound tokens.
Ostream & writeList(Ostream &os, const label shortLen=0) const
Write List, with line-breaks in ASCII when length exceeds shortLen.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
virtual Istream & read(token &)=0
Return next token from stream.
static Ostream & writeChars(Ostream &os, const char *chars, std::streamsize count)
A class for handling words, derived from Foam::string.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
Type & dynamicCast(U &obj)
A dynamic_cast (for references) that generates FatalError on failed casts.
bool fatalCheck(const char *operation) const
Check IOstream status for given operation.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
void writeEntry(Ostream &os) const
Write the UList with its compound type.
streamFormat format() const noexcept
Get the current stream format.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...