31 Foam::functionEntries::inputModeEntry::inputMode
32 Foam::functionEntries::inputModeEntry::mode_(MERGE);
36 namespace functionEntries
48 const label lineNumber,
55 if (!
operator[](0).isWord())
59 <<
" while reading function " <<
typeName
75 return mode_ == MERGE;
81 return mode_ == OVERWRITE;
87 return mode_ == PROTECT;
92 return mode_ == ERROR;
104 const word&
mode = operator[](0).wordToken();
106 if (
mode ==
"merge" ||
mode ==
"default")
110 else if (
mode ==
"overwrite")
114 else if (
mode ==
"protect")
118 else if (
mode ==
"warn")
122 else if (
mode ==
"error")
129 <<
"unsupported input mode '" <<
mode
130 <<
"' ... defaulting to 'merge'"
Macros for easy insertion into run-time selection tables.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
T & operator[](const label)
Return element of UList.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Specify the input mode when reading dictionaries, expects a single word to follow.
static bool overwrite()
Return true if the inputMode is overwrite.
static bool protect()
Return true if the inputMode is protect.
static bool merge()
Return true if the inputMode is merge.
static bool error()
Return true if the inputMode is error.
static void clear()
Reset the inputMode to default (ie, merge)
virtual bool execute(dictionary &contextDict, Istream &)
Expand the functionEntry into the contextDict.
inputModeEntry(const label lineNumber, const dictionary &parentDict, Istream &is)
Construct from line number, dictionary and Istream.
A functionEntry causes entries to be added/manipulated on the specified dictionary given an input str...
A token holds items read from Istream.
Template function which returns the un-mangled name of a given type. Useful for types which do not ha...
A class for handling words, derived from string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define WarningInFunction
Report a warning using Foam::Warning.
defineFunctionTypeNameAndDebug(includeFvConstraintEntry, 0)
addToRunTimeSelectionTable(functionEntry, includeFvConstraintEntry, dictionary)
errorManipArg< error, int > exit(error &err, const int errNo=1)
mode_t mode(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file mode.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.