83 keepHeader = keepHeader || hashedEntries_.found(
"FoamFile");
94 <<
"Istream not OK for reading dictionary " <<
name()
107 <<
"Dictionary input cannot start with '}'" <<
nl
131 <<
"Istream not OK after reading dictionary " <<
name()
143 return this->
read(is,
false);
155 dict.name() = is.name();
186 bool separator =
false;
188 for (
const entry&
e : *
this)
203 <<
"Cannot write entry " <<
e.keyword()
204 <<
" for dictionary " <<
name()
219 writeEntries(
os, !subDict);
bool good() const noexcept
True if next operation might succeed.
bool bad() const noexcept
True if stream is corrupted.
virtual const fileName & name() const
The name of the stream.
bool eof() const noexcept
True if end of input seen.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
void putBack(const token &tok)
Put back a token (copy). Only a single put back is permitted.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual Ostream & beginBlock(const keyType &kw)
Write begin block group with the given name.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const fileName & name() const noexcept
The dictionary name.
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
dictionary()
Default construct, a top-level empty dictionary.
bool remove(const word &keyword)
Remove an entry specified by keyword.
static autoPtr< dictionary > New(Istream &is)
Construct top-level dictionary on freestore from Istream.
friend class entry
Declare friendship with the entry class for IO.
void writeEntries(Ostream &os, const bool extraNewLine=false) const
Write dictionary entries.
void writeEntry(Ostream &os) const
Write sub-dictionary with its dictName as its header.
const dictionary & parent() const noexcept
Return the parent dictionary.
void write(Ostream &os, const bool subDict=true) const
Write dictionary, normally with sub-dictionary formatting.
bool read(Istream &is)
Read dictionary from Istream (discards the header). Reads entries until EOF or when the first token i...
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
A keyword and a list of tokens is an 'entry'.
static void resetInputMode()
Reset the globalInputMode to merge.
static bool New(dictionary &parentDict, Istream &is, const inputMode inpMode=inputMode::GLOBAL, const int endChar=0)
Construct from an Istream and insert into the dictionary.
@ GLOBAL
Use global value from globalInputMode variable.
A class for handling file names.
A class for handling keywords in dictionaries.
A token holds an item read from Istream.
@ BEGIN_BLOCK
Begin block [isseparator].
@ END_BLOCK
End block [isseparator].
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
OBJstream os(runTime.globalPath()/outputName)
const word dictName("faMeshDefinition")
#define WarningInFunction
Report a warning using Foam::Warning.
#define InfoInFunction
Report an information message using Foam::Info.
bool read(const char *buf, int32_t &val)
Same as readInt32.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
Ostream & endl(Ostream &os)
Add newline and flush stream.
Istream & operator>>(Istream &, directionInfo &)
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a).