Go to the documentation of this file.
36 template<
class T,
unsigned N>
40 if (token::compound::isCompound(tag))
42 os << tag << token::SPACE;
50 template<
class T,
unsigned N>
59 template<
class T,
unsigned N>
68 os.writeKeyword(keyword);
71 os << token::END_STATEMENT <<
endl;
75 template<
class T,
unsigned N>
100 (
N <= unsigned(shortLen))
112 os << token::BEGIN_LIST;
115 for (
unsigned i=0; i<
N; ++i)
117 if (i)
os << token::SPACE;
122 os << token::END_LIST;
129 os <<
nl << token::BEGIN_LIST <<
nl;
132 for (
unsigned i=0; i<
N; ++i)
138 os << token::END_LIST <<
nl;
146 template<
class T,
unsigned N>
160 Detail::readContiguous<T>
169 "FixedList<T, N>::readList(Istream&) : "
170 "reading the binary block"
179 "FixedList<T, N>::readList(Istream&) : "
180 "reading first token"
186 list = dynamicCast<token::Compound<List<T>>>
201 <<
"incorrect first token, expected <label> "
202 "or '(' or '{', found "
215 if (delimiter == token::BEGIN_LIST)
217 for (
unsigned i=0; i<
N; ++i)
223 "FixedList<T, N>::readList(Istream&) : "
237 "FixedList<T, N>::readList(Istream&) : "
238 "reading the single entry"
241 for (
unsigned i=0; i<
N; ++i)
label labelToken() const
Return label value.
Istream & readList(Istream &is)
Read from Istream, discarding contents of existing List.
bool isLabel() const noexcept
Token is LABEL.
A class for handling words, derived from Foam::string.
void writeEntry(Ostream &os) const
Write the FixedList with its compound type.
char readBeginList(const char *funcName)
Begin read of list data, starts with '(' or '{'.
const char * cdata_bytes() const noexcept
Return pointer to the underlying array serving as data storage,.
bool fatalCheck(const char *operation) const
Check IOstream status for given operation.
streamFormat format() const noexcept
Get the current stream format.
char readEndList(const char *funcName)
End read of list data, ends with ')' or '}'.
static std::streamsize size_bytes() noexcept
Number of contiguous bytes for the list data,.
Ostream & endl(Ostream &os)
Add newline and flush stream.
A token holds an item read from Istream.
InfoProxy< token > info() const
Return info proxy for printing token information to a stream.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
bool isPunctuation() const noexcept
Token is PUNCTUATION.
OBJstream os(runTime.globalPath()/outputName)
compound & transferCompoundToken()
Return reference to compound and mark internally as released.
errorManipArg< error, int > exit(error &err, const int errNo=1)
char * data_bytes() noexcept
Return pointer to the underlying array serving as data storage,.
Ostream & writeList(Ostream &os, const label shortLen=0) const
Write List, with line-breaks in ASCII when length exceeds shortLen.
A traits class, which is primarily used for primitives.
void putBack(const token &tok)
Put back a token. Only a single put back is permitted.
A 1D vector of objects of type <T> with a fixed length <N>.
bool isCompound() const noexcept
Token is COMPOUND.
FixedList()=default
Default construct.
#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,...
const Vector< label > N(dict.get< Vector< label >>("N"))
void checkSize(const label size) const
Check size is identical to template parameter N.
A template class to specify that a data type can be considered as being contiguous in memory.