51 label padding = (12 - label(key.size()));
58 while (--padding > 0);
68void Foam::decomposedBlockData::writeHeaderContent
71 IOstreamOption streamOptContainer,
72 const word& objectType,
74 const fileName& location,
75 const word& objectName
88 if (objectType.empty())
98 if (!location.empty())
113 bool ok =
io.readHeader(headerDict, is);
118 if (headerDict.readIfPresent(
"data.class",
io.headerClassName()))
129 headerStream.name() = is.name();
131 ok =
io.readHeader(headerStream);
143 const word& objectType,
146 const word& objectName,
157 decomposedBlockData::writeHeaderContent
167 if (!extraEntries.empty())
169 extraEntries.writeEntries(
os);
184 IOstreamOption streamOptData,
188 dict.set(
"data.format", streamOptData.format());
189 dict.set(
"data.class",
io.type());
192 if (
const auto* meta =
io.findMetaData(); meta && !meta->empty())
194 dict.add(
"meta", *meta);
202 IOstreamOption streamOptData,
213 decomposedBlockData::writeHeaderContent
217 decomposedBlockData::typeName,
219 (
io.instance()/
io.db().dbDir()/
io.local()),
230 if (
const auto* meta =
io.findMetaData(); meta && !meta->empty())
232 meta->writeEntry(
"meta",
os);
Input/output streams with (internal or external) character storage.
bool empty() const noexcept
True if the list is empty.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
static bool bannerEnabled() noexcept
Status of output file banner.
static Ostream & writeDivider(Ostream &os)
Write the standard file section divider.
static Ostream & writeBanner(Ostream &os, const bool noSyntaxHint=false)
Write the standard OpenFOAM file/dictionary banner.
const string & note() const noexcept
Return the optional note.
A simple container for options an IOstream can normally have.
streamFormat format() const noexcept
Get the current stream format.
virtual const fileName & name() const
The name of the stream.
Similar to IStringStream but using an externally managed buffer for its input. This allows the input ...
virtual const fileName & name() const override
The name of the input serial stream. (eg, the name of the Fstream file name).
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual Ostream & endBlock()
Write end block group.
virtual Ostream & beginBlock(const keyType &kw)
Write begin block group with the given name.
static bool readBlockEntry(Istream &is, List< char > &charData)
Helper: read block of (binary) character data.
static void writeHeader(Ostream &os, IOstreamOption streamOptContainer, const word &objectType, const string ¬e, const fileName &location, const word &objectName, const dictionary &extraEntries)
Helper: write FoamFile IOobject header.
static void writeExtraHeaderContent(dictionary &dict, IOstreamOption streamOptData, const IOobject &io)
Helper: generate additional entries for FoamFile header.
static bool isCollatedType(const word &objectType)
True if object type is a known collated type.
static bool readHeader(IOobject &io, Istream &is)
Read header as per IOobject with additional handling of decomposedBlockData.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry if present, and assign to T val. FatalIOError if it is found and the number of tokens i...
void writeEntries(Ostream &os, const bool extraNewLine=false) const
Write dictionary entries.
A class for handling file names.
@ END_STATEMENT
End entry [isseparator].
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
const std::string buildArch
OpenFOAM build architecture information (machine endian, label/scalar sizes) as a std::string.
static void writeHeaderEntry(Ostream &os, const word &key, const T &value)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
constexpr char nl
The newline '\n' character (0x0a).