dictionaryEntry.C
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-2015 OpenFOAM Foundation
9 Copyright (C) 2017-2021 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
27\*---------------------------------------------------------------------------*/
28
29#include "dictionaryEntry.H"
30
31// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32
34(
35 const keyType& key,
36 const dictionary& parentDict,
37 const dictionary& dict
38)
39:
40 entry(key),
41 dictionary(parentDict, dict)
42{}
43
44
46(
47 const dictionary& parentDict,
48 const dictionaryEntry& dictEnt
49)
50:
51 entry(dictEnt),
52 dictionary(parentDict, dictEnt)
53{}
54
55
56// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
57
59{
60 if (size())
61 {
62 return first()->startLineNumber();
63 }
64
65 return -1;
66}
67
68
70{
71 if (size())
72 {
73 return last()->endLineNumber();
74 }
75
76 return -1;
77}
78
79
81{
83 << "Attempt to return dictionary entry as a primitive"
85
86 return lookup("");
87}
88
89
91{
92 return this;
93}
94
95
97{
98 return this;
99}
100
101
103{
104 return *this;
105}
106
107
109{
110 return *this;
111}
112
113
114// ************************************************************************* //
An input stream of tokens.
Definition: ITstream.H:56
A keyword and a list of tokens is a 'dictionaryEntry'.
virtual const dictionary & dict() const noexcept
Return dictionary (ie, this)
virtual const dictionary * dictPtr() const noexcept
Return pointer to this dictionary.
virtual label endLineNumber() const
Return line number of last token in dictionary.
virtual ITstream & stream() const
virtual label startLineNumber() const
Return line number of first token in dictionary.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A keyword and a list of tokens is an 'entry'.
Definition: entry.H:70
A class for handling keywords in dictionaries.
Definition: keyType.H:71
Lookup type of boundary radiation properties.
Definition: lookup.H:66
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:473
errorManip< error > abort(error &err)
Definition: errorManip.H:144
IOerror FatalIOError
const direction noexcept
Definition: Scalar.H:223
dictionary dict