mergeDictionaries.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2025 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 InNamespace
25  Foam
26 
27 Description
28  Function with which to merge one dictionary into another. Intended for
29  user-facing dictionary merging (e.g., by foamDictionary or similar).
30 
31  Supports prepending entries in the source dictionary with '~' to indicate
32  that they should be removed in the result. Also supports deactivating
33  wildcards and treating regex keywords as literal strings. Also permits a
34  table of shortcuts to be provided with which to rename entries.
35 
36  Returns whether or not anything changed.
37 
38 SourceFiles
39  mergeDictionaries.C
40 
41 \*---------------------------------------------------------------------------*/
42 
43 #ifndef mergeDictionaries_H
44 #define mergeDictionaries_H
45 
46 #include "dictionary.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
56 (
57  dictionary& tgtDict,
58  const dictionary& srcDict,
59  const bool wildcards = true,
60  const HashTable<wordList, word>& shortcuts = HashTable<wordList, word>(0)
61 );
62 
63 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 
65 } // End namespace Foam
66 
67 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68 
69 #endif
70 
71 // ************************************************************************* //
Namespace for OpenFOAM.
bool mergeDictionaries(dictionary &tgtDict, const dictionary &srcDict, const bool wildcards=true, const HashTable< wordList, word > &shortcuts=HashTable< wordList, word >(0))