35 template<
class T,
class Addr>
44 const label len = list.
size();
46 if (
os.format() == IOstreamOption::BINARY && is_contiguous_v<T>)
55 os.beginRawWrite(len*
sizeof(
T));
58 for (label i=0; i < len; ++i)
62 reinterpret_cast<const char*>(&(list[i])),
71 else if (is_contiguous_v<T> && len > 1 && list.
uniform())
74 os << len << token::BEGIN_BLOCK << list[0] << token::END_BLOCK;
78 (len <= 1 || !shortLen)
89 os << len << token::BEGIN_LIST;
92 for (label i=0; i < len; ++i)
94 if (i)
os << token::SPACE;
99 os << token::END_LIST;
106 os <<
nl << len <<
nl << token::BEGIN_LIST <<
nl;
109 for (label i=0; i < len; ++i)
115 os << token::END_LIST <<
nl;
constexpr char nl
The newline '\n' character (0x0a)
Base for lists with indirect addressing, templated on the list contents type and the addressing type...
bool uniform() const
True if all entries have identical values, and list is non-empty.
label size() const noexcept
The number of elements in the list.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
Ostream & writeList(Ostream &os, const label shortLen=0) const
Write List, with line-breaks in ASCII when length exceeds shortLen.
Can suppress additional line breaks separate ASCII data content when the data elements are primitives...