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-2023 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 {
61 }
62 
63 
64 Foam::label Foam::dictionaryEntry::endLineNumber() const
65 {
67 }
68 
69 
71 {
73  << "Attempt to return dictionary entry as a primitive"
75 
76  // Need to return something - send back an empty stream
77  return ITstream::empty_stream();
78 }
79 
80 
82 {
83  return this;
84 }
85 
86 
88 {
89  return this;
90 }
91 
92 
94 {
95  return *this;
96 }
97 
98 
100 {
101  return *this;
102 }
103 
104 
105 // ************************************************************************* //
A class for handling keywords in dictionaries.
Definition: keyType.H:66
dictionary dict
label endLineNumber() const
Return line number of last token in dictionary.
Definition: dictionary.C:209
dictionaryEntry(const dictionaryEntry &)=delete
No copy construct.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual ITstream & stream() const
This entry is not a primitive, calling this function generates a FatalError.
A keyword and a list of tokens is a &#39;dictionaryEntry&#39;.
virtual label endLineNumber() const
Return line number of last token in dictionary.
errorManip< error > abort(error &err)
Definition: errorManip.H:139
const direction noexcept
Definition: Scalar.H:258
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:627
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
Definition: foamGltfBase.H:103
virtual label startLineNumber() const
Return line number of first token in dictionary.
static ITstream & empty_stream()
Return reference to an empty ITstream, for functions needing to return an ITstream reference but whic...
Definition: ITstream.C:68
virtual const dictionary & dict() const noexcept
Return dictionary (ie, this)
virtual const dictionary * dictPtr() const noexcept
Return pointer to this dictionary.
label startLineNumber() const
Return line number of first token in dictionary.
Definition: dictionary.C:198
An input stream of tokens.
Definition: ITstream.H:52
A keyword and a list of tokens is an &#39;entry&#39;.
Definition: entry.H:63
IOerror FatalIOError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL IO ERROR&#39; header text and ...