dictionaryEntryIO.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) 2016-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#include "IOstreams.H"
31
32// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
33
35(
36 const dictionary& parentDict,
37 Istream& is
38)
39:
40 entry(keyType(is)),
41 dictionary(parentDict, dictionary(is))
42{
44}
45
46
48(
49 const keyType& key,
50 const dictionary& parentDict,
51 Istream& is
52)
53:
54 entry(key),
55 dictionary(key, parentDict, is)
56{
58}
59
60
61// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
62
64{
65 dictionary::writeEntry(keyword(), os);
66}
67
68
69// * * * * * * * * * * * * * * Ostream operator * * * * * * * * * * * * * * //
70
72{
73 e.write(os);
74 return os;
75}
76
77
78template<>
79Foam::Ostream& Foam::operator<<
80(
81 Ostream& os,
83)
84{
85 const dictionaryEntry& e = ip.t_;
86
87 os << " dictionaryEntry '" << e.keyword() << "'" << endl;
88
89 return os;
90}
91
92
93// ************************************************************************* //
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
bool fatalCheck(const char *operation) const
Check IOstream status for given operation.
Definition: IOstream.C:64
A helper class for outputting values to Ostream.
Definition: InfoProxy.H:52
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
A keyword and a list of tokens is a 'dictionaryEntry'.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
void writeEntry(Ostream &os) const
Write sub-dictionary with its dictName as its header.
Definition: dictionaryIO.C:164
A keyword and a list of tokens is an 'entry'.
Definition: entry.H:70
virtual bool write()
Write the output fields.
A class for handling keywords in dictionaries.
Definition: keyType.H:71
virtual bool write(const bool valid=true) const
Write using setting from DB.
OBJstream os(runTime.globalPath()/outputName)
#define FUNCTION_NAME
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
volScalarField & e
Definition: createFields.H:11