inputMode.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2016 OpenFOAM Foundation
9 Copyright (C) 2017 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::functionEntries::inputMode
29
30Description
31 Specify the global input mode when reading further dictionaries,
32 expects a single word to follow.
33
34 An example of \c \#inputMode directive:
35 \verbatim
36 #inputMode merge
37 \endverbatim
38
39 The possible input modes:
40 - \par merge
41 merge sub-dictionaries when possible
42 - \par overwrite
43 keep last entry and silently remove previous ones
44 - \par protect
45 keep initial entry and silently ignore subsequent ones
46 - \par warn
47 keep initial entry and warn about subsequent ones
48 - \par error
49 issue a FatalError for duplicate entries
50 - \par default
51 The default treatment - currently identical to \b merge.
52
53SourceFiles
54 inputMode.C
55
56\*---------------------------------------------------------------------------*/
57
58#ifndef functionEntries_inputMode_H
59#define functionEntries_inputMode_H
60
61#include "entry.H"
62#include "functionEntry.H"
63#include "Enum.H"
64
65// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
66
67namespace Foam
68{
69namespace functionEntries
70{
71
72/*---------------------------------------------------------------------------*\
73 Class inputMode Declaration
74\*---------------------------------------------------------------------------*/
76class inputMode
77:
78 public functionEntry
79{
80public:
81
82 //- Text representations of the selectable input modes
84
85 //- Change the global input-mode.
86 static bool execute(dictionary& unused, Istream& is);
87};
88
89
90/*---------------------------------------------------------------------------*\
91 Class inputModeDefault Declaration
92\*---------------------------------------------------------------------------*/
93
94//- Temporarily change inputMode to %protect for the following entry
96:
97 public functionEntry
98{
99public:
100
101 //- Execute in a sub-dict context
102 static bool execute(dictionary& parentDict, Istream& is);
103};
104
105
106/*---------------------------------------------------------------------------*\
107 Class inputModeMerge Declaration
108\*---------------------------------------------------------------------------*/
109
110//- Temporarily change inputMode to %merge for the following entry
111class inputModeMerge
112:
113 public functionEntry
114{
115public:
116
117 //- Execute in a sub-dict context
118 static bool execute(dictionary& parentDict, Istream& is);
119};
120
121
122/*---------------------------------------------------------------------------*\
123 Class inputModeOverwrite Declaration
124\*---------------------------------------------------------------------------*/
125
126//- Temporarily change inputMode to %overwrite for the following entry
128:
129 public functionEntry
130{
131public:
132
133 //- Execute in a sub-dict context
134 static bool execute(dictionary& parentDict, Istream& is);
135};
136
137
138/*---------------------------------------------------------------------------*\
139 Class inputModeWarn Declaration
140\*---------------------------------------------------------------------------*/
141
142//- Temporarily change inputMode to %warn for the following entry
143class inputModeWarn
144:
145 public functionEntry
146{
147public:
148
149 //- Execute in a sub-dict context
150 static bool execute(dictionary& parentDict, Istream& is);
151};
152
153
154/*---------------------------------------------------------------------------*\
155 Class inputModeError Declaration
156\*---------------------------------------------------------------------------*/
157
158//- Temporarily change inputMode to %error for the following entry
159class inputModeError
160:
161 public functionEntry
162{
163public:
164
165 //- Execute in a sub-dict context
166 static bool execute(dictionary& parentDict, Istream& is);
167};
168
169
170// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171
172} // End namespace functionEntries
173} // End namespace Foam
174
175// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176
177#endif
178
179// ************************************************************************* //
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Definition: Enum.H:61
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Temporarily change inputMode to protect for the following entry.
Definition: inputMode.H:97
static bool execute(dictionary &parentDict, Istream &is)
Execute in a sub-dict context.
Definition: inputMode.C:141
Temporarily change inputMode to error for the following entry.
Definition: inputMode.H:161
static bool execute(dictionary &parentDict, Istream &is)
Execute in a sub-dict context.
Definition: inputMode.C:181
Temporarily change inputMode to merge for the following entry.
Definition: inputMode.H:113
static bool execute(dictionary &parentDict, Istream &is)
Execute in a sub-dict context.
Definition: inputMode.C:151
Temporarily change inputMode to overwrite for the following entry.
Definition: inputMode.H:129
static bool execute(dictionary &parentDict, Istream &is)
Execute in a sub-dict context.
Definition: inputMode.C:161
Temporarily change inputMode to warn for the following entry.
Definition: inputMode.H:145
static bool execute(dictionary &parentDict, Istream &is)
Execute in a sub-dict context.
Definition: inputMode.C:171
Specify the global input mode when reading further dictionaries, expects a single word to follow.
Definition: inputMode.H:78
static bool execute(dictionary &unused, Istream &is)
Change the global input-mode.
Definition: inputMode.C:114
static const Enum< entry::inputMode > selectableNames
Text representations of the selectable input modes.
Definition: inputMode.H:82
A functionEntry causes entries to be added/manipulated on the specified dictionary given an input str...
Definition: functionEntry.H:69
Namespace for OpenFOAM.