51 label padding = (12 - label(key.size()));
58 while (--padding > 0);
83 static char paddedVersion[39] =
"";
91 std::size_t len = apiValue.length();
97 std::memset(paddedVersion,
' ', 38);
98 std::memcpy(paddedVersion, apiValue.c_str(), len);
99 paddedVersion[38] =
'\0';
103 "/*--------------------------------";
117 "----------------------------------*\\\n"
121 " OpenFOAM: The Open Source CFD Toolbox |\n"
122 "| \\\\ / O peration |"
123 " Version: " << paddedVersion <<
"|\n"
125 " Website: www.openfoam.com |\n"
126 "| \\\\/ M anipulation |"
128 "\\*-----------------------------------------"
129 "----------------------------------*/\n";
138 "// * * * * * * * * * * * * * * * * * "
139 "* * * * * * * * * * * * * * * * * * * * //\n";
148 "// *****************************************"
149 "******************************** //\n";
161 const word& objectType,
170 if (!
io.note().empty())
175 if (objectType.empty())
189 if (metaDataDict && !metaDataDict->
empty())
200 const word& objectType,
201 IOstreamOption streamOpt,
206 dict.set(
"version", streamOpt.version());
207 dict.set(
"format", streamOpt.format());
210 if (!
io.note().empty())
212 dict.set(
"note",
io.note());
215 if (objectType.empty())
225 dict.
set(
"location",
io.instance()/
io.db().dbDir()/
io.local());
229 if (metaDataDict && !metaDataDict->empty())
231 dict.add(
"meta", *metaDataDict);
241 const word& objectType
247 <<
"No stream open for write" <<
nl
289 const word& objectType,
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.
virtual const dictionary * findMetaData() const noexcept
Return pointer to meta-data (if any) or nullptr.
static Ostream & writeEndDivider(Ostream &os)
Write the standard end file divider.
static Ostream & writeBanner(Ostream &os, const bool noSyntaxHint=false)
Write the standard OpenFOAM file/dictionary banner.
static void writeHeaderContent(Ostream &os, const IOobject &io, const word &objectType, const dictionary *metaDataDict=nullptr)
Helper: write content for FoamFile IOobject header with optional meta information.
bool writeHeader(Ostream &os) const
Write header with current type().
A simple container for options an IOstream can normally have.
versionNumber version() const noexcept
Get the stream version.
streamFormat format() const noexcept
Get the current stream format.
virtual const fileName & name() const override
Read/write access to the name of the stream.
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.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
void writeEntry(Ostream &os) const
Write sub-dictionary with its dictName as its header.
entry * set(entry *entryPtr)
Assign a new entry, overwriting any existing entry.
@ END_STATEMENT
End entry [isseparator].
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
#define InfoInFunction
Report an information message using Foam::Info.
const int api
OpenFOAM api number (integer) corresponding to the value of OPENFOAM at the time of compilation.
const std::string buildArch
OpenFOAM build architecture information (machine endian, label/scalar sizes) as a std::string.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Ostream & endl(Ostream &os)
Add newline and flush stream.
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).