42 const entry& srcEntry,
70 tgtDict.
add(srcEntry.
clone(tgtDict).ptr(),
true);
94 else if (shortcuts.
size())
100 const word&
name = shortcutNames[indices[i]];
126 const bool wildcards,
132 bool changed =
false;
140 tgtKeysSet.
insert(keys[i]);
147 const keyType& srcKey = srcIter().keyword();
149 if (srcKey[0] ==
'~')
151 word eraseKey = srcKey(1, srcKey.size()-1);
153 if (tgtDict.
remove(eraseKey))
157 tgtKeysSet.
erase(eraseKey);
162 else if (!wildcards || !(srcKey.
isPattern() || shortcuts.
found(srcKey)))
195 tgtDict.
add(srcIter().
clone(tgtDict).ptr());
202 if (tgtKeysSet.
size() > 0)
209 const keyType& srcKey = srcIter().keyword();
211 if (srcKey[0] ==
'~')
213 word eraseKey = srcKey(1, srcKey.size()-1);
231 tgtKeysSet.
erase(tgtKeys[matches[i]]);
254 const word& tgtKey = tgtKeys[matches[i]];
Various functions to operate on Lists.
#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 HashTable with keys but without contents.
bool insert(const Key &key)
Insert a new entry.
An STL-conforming hash table.
bool erase(const iterator &)
Erase a hashedEntry specified by given iterator.
List< Key > toc() const
Return the table of contents.
label size() const
Return number of elements in table.
bool found(const Key &) const
Return true if hashedEntry is found in table.
Template class for intrusive linked lists.
void append(const T &)
Append an element at the end of the list.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
const entry * lookupEntryPtr(const word &, bool recursive, bool patternMatch) const
Find and return an entry data stream pointer if present.
const entry & lookupEntry(const word &, bool recursive, bool patternMatch) const
Find and return an entry data stream if present otherwise error.
List< keyType > keys(bool patterns=false) const
Return the list of available keys or patterns.
bool remove(const word &)
Remove an entry specified by keyword.
bool add(entry *, bool mergeEntry=false)
Add a new entry.
A keyword and a list of tokens is an 'entry'.
virtual bool isDict() const
Return true if this entry is a dictionary.
const keyType & keyword() const
Return keyword.
virtual const dictionary & dict() const =0
Return dictionary if this entry is a dictionary.
virtual autoPtr< entry > clone(const dictionary &parentDict) const =0
Construct on freestore as copy with reference to the.
A class for handling keywords in dictionaries.
bool isPattern() const
Should be treated as a match rather than a literal string.
A class for handling words, derived from string.
Function with which to merge one dictionary into another. Intended for user-facing dictionary merging...
labelList findMatches(const bool wildcards, const HashTable< wordList, word > &shortcuts, const wordList &shortcutNames, const wordList &tgtKeys, const keyType &srcKey)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool findStrings(const wordReListMatcher &matcher, const std::string &str)
Return true if string matches one of the regular expressions.
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element and return index,.
bool mergeDictionaries(dictionary &tgtDict, const dictionary &srcDict, const bool wildcards=true, const HashTable< wordList, word > &shortcuts=HashTable< wordList, word >(0))
bool addEntry(dictionary &tgtDict, entry &tgtEntry, const entry &srcEntry, const bool wildcards, const HashTable< wordList, word > &shortcuts)
Operations on lists of strings.