46 parentDict.
name().size()
78 global_(parentDict.topDict().global())
86 if (!ifs || !ifs.
good())
89 <<
"Included dictionary file " << fName
90 <<
" cannot be found for dictionary " << parentDict.
name()
119 <<
"Istream not OK for reading dictionary "
143 <<
"Istream not OK after reading dictionary " <<
name()
168 word varName = keyword(1, keyword.size()-1);
235 <<
"Can't write entry " << iter().keyword()
236 <<
" for dictionary " <<
name()
250 dict.write(os,
true);
265 const wordRe unsetPattern(
"<.*>");
272 if (iter().isStream())
276 bool isUnset =
false;
281 if (its[i].isWord() && unsetPattern.
match(its[i].wordToken()))
310 iter().keyword() +
'/' + subUnsetArgs[i].
first(),
333 if (foFiles[
f].ext().empty())
359 const word& configName,
361 const word& configFilesDir,
371 /configFilesDir/region/configName
403 if (!dictFile.empty())
434 const word& configType,
435 const string& argString,
438 const word& configFilesDir,
463 <<
"configuration file name not specified"
465 <<
"Available configured objects:"
472 <<
"Cannot find configuration file "
473 << funcType <<
nl <<
nl
474 <<
"Available configured objects:"
484 ISstream& fileStream = fileStreamPtr();
494 if (funcsDict.
found(funcType) && funcsDict.
isDict(funcType))
496 funcDictPtr = &funcsDict.
subDict(funcType);
513 if (namedArgs[i].
first() ==
"field")
520 namedArgs[i].
first() ==
"fields"
521 || namedArgs[i].
first() ==
"objects"
528 if (fieldArgs.
size() == 1)
530 funcDict.
set(
"field", fieldArgs[0].
first());
533 if (fieldArgs.
size() >= 1)
535 funcDict.
set(
"fields", fieldArgs);
536 funcDict.
set(
"objects", fieldArgs);
544 namedArgs[i].
first() !=
"field"
545 && namedArgs[i].
first() !=
"fields"
546 && namedArgs[i].
first() !=
"objects"
547 && namedArgs[i].
first() !=
"funcName"
548 && namedArgs[i].
first() !=
"name"
555 dAk.
second() +
' ' + namedArgs[i].second() +
';'
564 funcDict.
set(
"region", region);
570 word entryName(string::validate<word>(argString));
575 namedArgs[i].
first() ==
"funcName"
576 || namedArgs[i].
first() ==
"name"
579 entryName = namedArgs[i].second();
580 entryName.
strip(
" \n");
586 bool hasUnsetError =
false;
591 unsetArgs[i].
first() !=
"fields"
592 && unsetArgs[i].
first() !=
"objects"
595 hasUnsetError =
true;
613 <<
"Essential value for keyword '" << unsetArgs[i].
first()
614 <<
"' not set" <<
nl;
618 <<
nl <<
"In " << configType <<
" entry:" <<
nl
619 <<
" " << argString.c_str() <<
nl
620 <<
nl <<
"In " << contextTypeAndValue.
first().c_str() <<
":" <<
nl
621 <<
" " << contextTypeAndValue.
second().c_str() <<
nl;
631 args[i].strip(
" \n");
636 namedArgs[i].second().strip(
" \n");
639 + namedArgs[i].
first() +
" = " + namedArgs[i].second();
643 unsetArgs[i].second().strip(
" \n");
646 + unsetArgs[i].
first() +
" = " + unsetArgs[i].second();
650 <<
nl <<
"The " << configType <<
" entry should be:" <<
nl
651 <<
" " << funcType <<
'(' <<
argList.c_str() <<
')'
658 funcArgsDict.
add(entryName, funcDict);
661 funcArgsDict.
write(os);
671 parentDict.
merge(funcArgsDict);
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
A HashTable with keys but without contents.
bool insert(const Key &key)
Insert a new entry.
List< Key > sortedToc() const
Return the table of contents as a sorted list.
Template class for intrusive linked lists.
static constexpr const char * foamFile
Keyword for the FoamFile header sub-dictionary.
virtual const fileName & name() const
Return the name of the stream.
bool bad() const
Return true if stream is corrupted.
bool good() const
Return true if next operation might succeed.
bool eof() const
Return true if end of input seen.
Input from memory buffer stream.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
void putBack(const token &)
Put back token.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void append(const T &)
Append an element at the end of the list.
void size(const label)
Override size to be inconsistent with allocated storage.
Output to memory buffer stream.
string str() const
Return the string.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
An ordered pair of two objects of type <T> with first() and second() elements.
const Type & second() const
Return second.
const Type & first() const
Return first.
A 2-tuple for storing two objects of different types.
T * last()
Return the last entry.
T * first()
Return the first entry.
T & first()
Return the first element of the list.
Extract command arguments and options from the supplied argc and argv parameters.
label size() const
Return the number of arguments.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
const fileName & name() const
Return the dictionary name.
includedDictionary(const fileName &fName, const dictionary &parentDict)
Construct an included dictionary for the given parent.
A list of keyword definitions, which are a keyword followed by any number of values (e....
dictionary()
Construct top-level dictionary null.
virtual bool global() const
Return true if the dictionary global,.
bool read(Istream &, const bool keepHeader=false)
Read dictionary from Istream, optionally keeping the header.
const entry * lookupEntryPtr(const word &, bool recursive, bool patternMatch) const
Find and return an entry data stream pointer if present.
bool substituteKeyword(const word &keyword)
Substitute the given keyword prepended by '$' with the.
void set(entry *)
Assign a new entry, overwrite any existing entry.
void write(Ostream &, const bool subDict=true) const
Write dictionary, normally with sub-dictionary formatting.
bool remove(const word &)
Remove an entry specified by keyword.
bool isDict(const word &) const
Check if entry is a sub-dictionary.
const dictionary & parent() const
Return the parent dictionary.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
bool add(entry *, bool mergeEntry=false)
Add a new entry.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
const dictionary & scopedDict(const word &) const
Find and return a sub-dictionary by scoped lookup.
static const dictionary null
Null dictionary.
static autoPtr< dictionary > New(Istream &)
Construct top-level dictionary on freestore from Istream.
bool merge(const dictionary &)
Merge entries from the given dictionary.
A keyword and a list of tokens is an 'entry'.
static bool New(dictionary &parentDict, Istream &)
Construct from Istream and insert into dictionary.
virtual const dictionary & dict() const =0
Return dictionary if this entry is a dictionary.
static int disableFunctionEntries
A class for handling file names.
static const fileName null
An empty fileName.
static void clear()
Reset the cache of #calc include file names.
static void clear()
Reset the inputMode to default (ie, merge)
void strip(const string &)
Strip characters from the start and end of the string.
A token holds items read from Istream.
Tuple of a word and dictionary, used to read in per-field options for function objects in the followi...
A wordRe is a word, but can also have a regular expression for matching words.
bool compile() const
Compile the regular expression.
bool match(const std::string &, bool literalMatch=false) const
Smart match as regular expression or as a string.
A class for handling words, derived from string.
static const word null
An empty word.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Functions to search 'etc' directories for configuration files etc.
#define WarningInFunction
Report a warning using Foam::Warning.
#define InfoInFunction
Report an information message using Foam::Info.
string expandEnvVar(const string &, const bool allowEmpty=false)
Expand all occurrences of environment variables and paths.
bool isFile(const fileName &, const bool checkVariants=true, const bool followLink=true)
Does the name exist as a file in the file system?
const fileOperation & fileHandler()
Get current file handler.
errorManipArg< error, int > exit(error &err, const int errNo=1)
List< word > wordList
A List of words.
fileName findConfigFile(const word &configName, const fileName &configFilesPath, const word &configFilesDir, const word ®ion=word::null)
Search for configuration file for given region.
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
void listConfigFiles(const fileName &dir, HashSet< word > &foMap)
bool readConfigFile(const word &configType, const string &argString, dictionary &parentDict, const fileName &configFilesPath, const word &configFilesDir, const Pair< string > &contextTypeAndValue, const word ®ion=word::null)
Read the specified configuration file.
void dictArgList(const string &argString, word &configName, wordReList &args, List< Tuple2< word, string >> &namedArgs)
Parse dictionary substitution argument list.
wordList listAllConfigFiles(const fileName &configFilesPath)
Return the list of configuration files in.
labelList second(const UList< labelPair > &p)
Ostream & incrIndent(Ostream &os)
Increment the indent level.
Pair< word > dictAndKeyword(const word &scopedName)
Extracts dict name and keyword.
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Istream & operator>>(Istream &, pistonPointEdgeData &)
Foam::List< Foam::Tuple2< Foam::word, Foam::string > > unsetConfigEntries(const dictionary &configDict)
fileNameList findEtcDirs(const fileName &local=fileName::null)
Search for directories from user/group/shipped directories.
Ostream & operator<<(Ostream &os, const fvConstraints &constraints)
Ostream & indent(Ostream &os)
Indent stream.
fileNameList readDir(const fileName &, const fileType=fileType::file, const bool filterVariants=true, const bool followLink=true)
Read a directory and return the entries as a string list.
fileName search(const word &file, const fileName &directory)
Recursively search the given directory for the file.
Foam::argList args(argc, argv)