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,
175 if (objectType.empty())
189 if (metaDataDict && !metaDataDict->empty())
200 const word& objectType,
201 IOstreamOption streamOpt,
202 const dictionary* metaDataDict
206 dict.
set(
"version", streamOpt.version());
207 dict.
set(
"format", streamOpt.format());
215 if (objectType.empty())
218 dict.
set(
"class", word(
"dictionary"));
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,
void writeEntry(Ostream &os) const
Write sub-dictionary with its dictName as its header.
virtual Ostream & write(const char c)
Write character.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
const word & name() const noexcept
Return the object name.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static Ostream & writeDivider(Ostream &os)
Write the standard file section divider.
const string & note() const noexcept
Return the optional note.
virtual void indent()
Add indentation characters.
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
A simple container for options an IOstream can normally have.
bool writeHeader(Ostream &os) const
Write header with current type()
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
A class for handling words, derived from Foam::string.
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)
const int api
OpenFOAM api number (integer) corresponding to the value of OPENFOAM at the time of compilation...
static Ostream & writeEndDivider(Ostream &os)
Write the standard end file divider.
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.
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.
const std::string buildArch
OpenFOAM build architecture information (machine endian, label/scalar sizes) as a std::string...
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
bool good() const noexcept
True if next operation might succeed.
versionNumber version() const noexcept
Get the stream version.
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.
const fileName & local() const noexcept
Read access to local path component.
Defines the attributes of an object for which implicit objectRegistry management is supported...
streamFormat format() const noexcept
Get the current stream format.
InfoProxy< IOstream > info() const
Return info proxy.
#define InfoInFunction
Report an information message using Foam::Info.