Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
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/>.
27\*---------------------------------------------------------------------------*/
28
29#include "dictionaryEntry.H"
30
31// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32
34(
35 const keyType& key,
36 const dictionary& parentDict,
37 const dictionary& dict
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 * * * * * * * * * * * * * //
61}
62
73 << "Attempt to return stream of primitives from a dictionary entry: "
74 << entry::keyword() << nl
76
77 // Need to return something - send back an empty stream
79}
80
83{
84 return this;
85}
86
91}
92
95{
96 return *this;
97}
98
99
101{
102 return *this;
103}
104
105
106// ************************************************************************* //
An input stream of tokens.
Definition ITstream.H:56
static ITstream & empty_stream()
Return reference to an empty ITstream, for functions needing to return an ITstream reference but whic...
Definition ITstream.C:63
A keyword and a list of tokens is a 'dictionaryEntry'.
dictionaryEntry(const dictionaryEntry &)=delete
No copy construct.
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
This entry is not a primitive, calling this function generates a FatalError.
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:133
dictionary()
Default construct, a top-level empty dictionary.
Definition dictionary.C:68
friend class entry
Declare friendship with the entry class for IO.
Definition dictionary.H:338
label endLineNumber() const
Return line number of last token in dictionary.
Definition dictionary.C:209
label startLineNumber() const
Return line number of first token in dictionary.
Definition dictionary.C:198
const keyType & keyword() const noexcept
Return keyword.
Definition entry.H:231
A class for handling keywords in dictionaries.
Definition keyType.H:69
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition error.H:629
errorManip< error > abort(error &err)
Definition errorManip.H:139
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
const direction noexcept
Definition scalarImpl.H:265
constexpr char nl
The newline '\n' character (0x0a).
Definition Ostream.H:50