51 label padding = (12 - label(
key.size()));
58 while (--padding > 0);
68 void 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())
128 ISpanStream headerStream(charData);
129 headerStream.name() = is.name();
142 IOstreamOption streamOptContainer,
143 const word& objectType,
145 const fileName& location,
146 const word& objectName,
147 const dictionary& extraEntries
157 decomposedBlockData::writeHeaderContent
167 if (!extraEntries.empty())
169 extraEntries.writeEntries(
os);
184 IOstreamOption streamOptData,
188 dict.
set(
"data.format", streamOptData.format());
193 if (metaDataDict && !metaDataDict->empty())
195 dict.
add(
"meta", *metaDataDict);
203 IOstreamOption streamOptData,
214 decomposedBlockData::writeHeaderContent
217 static_cast<IOstreamOption>(
os),
218 decomposedBlockData::typeName,
231 if (metaDataDict && !metaDataDict->empty())
void writeEntry(Ostream &os) const
Write sub-dictionary with its dictName as its header.
Input/output streams with (internal or external) character storage.
virtual Ostream & write(const char c) override
Write character.
virtual const dictionary * findMetaData() const noexcept
Return pointer to meta-data (if any) or nullptr.
const word & name() const noexcept
Return the object name.
constexpr char nl
The newline '\n' character (0x0a)
static Ostream & writeDivider(Ostream &os)
Write the standard file section divider.
const string & note() const noexcept
Return the optional note.
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
static void writeExtraHeaderContent(dictionary &dict, IOstreamOption streamOptData, const IOobject &io)
Helper: generate additional entries for FoamFile header.
A class for handling words, derived from Foam::string.
static bool readBlockEntry(Istream &is, List< char > &charData)
Helper: read block of (binary) character data.
virtual Ostream & endBlock()
Write end block group.
const objectRegistry & db() const noexcept
Return the local objectRegistry.
static void writeHeaderEntry(Ostream &os, const word &key, const T &value)
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.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
static bool bannerEnabled() noexcept
Status of output file banner.
const fileName & instance() const noexcept
Read access to instance path component.
const std::string buildArch
OpenFOAM build architecture information (machine endian, label/scalar sizes) as a std::string...
virtual void indent() override
Add indentation characters.
const word & headerClassName() const noexcept
Return name of the class name read from header.
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
virtual Ostream & beginBlock(const keyType &kw)
Write begin block group with the given name.
virtual const fileName & dbDir() const
Local directory path of this objectRegistry relative to the time.
static Ostream & writeBanner(Ostream &os, const bool noSyntaxHint=false)
Write the standard OpenFOAM file/dictionary banner.
entry * set(entry *entryPtr)
Assign a new entry, overwriting any existing entry.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
const fileName & local() const noexcept
Read access to local path component.
bool readHeader(Istream &is)
Read header ('FoamFile' dictionary) and set the IOobject and stream characteristics.
streamFormat format() const noexcept
Get the current stream format.
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.