OpenFOAM
v2406
The open source CFD toolbox
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
-------------------------------------------------------------------------------
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
#include "
IOstreams.H
"
31
32
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
33
34
Foam::dictionaryEntry::dictionaryEntry
35
(
36
const
dictionary
& parentDict,
37
Istream
& is
38
)
39
:
40
entry
(
keyType
(is)),
41
dictionary
(parentDict,
dictionary
(is))
42
{
43
is.
fatalCheck
(
FUNCTION_NAME
);
44
}
45
46
47
Foam::dictionaryEntry::dictionaryEntry
48
(
49
const
keyType
&
key
,
50
const
dictionary
& parentDict,
51
Istream
& is
52
)
53
:
54
entry
(
key
),
55
dictionary
(
key
, parentDict, is)
56
{
57
is.
fatalCheck
(
FUNCTION_NAME
);
58
}
59
60
61
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
62
63
void
Foam::dictionaryEntry::write
(
Ostream
&
os
)
const
64
{
65
dictionary::writeEntry
(
keyword
(),
os
);
66
}
67
68
69
// * * * * * * * * * * * * * * Ostream operator * * * * * * * * * * * * * * //
70
71
Foam::Ostream
& Foam::operator<<
72
(
73
Ostream&
os
,
74
const
dictionaryEntry&
e
75
)
76
{
77
e
.write(
os
);
78
return
os
;
79
}
80
81
82
template
<>
83
Foam::Ostream
& Foam::operator<<
84
(
85
Ostream&
os
,
86
const
InfoProxy<dictionaryEntry>& iproxy
87
)
88
{
89
const
auto
&
e
= *iproxy;
90
91
os
<<
" dictionaryEntry '"
<<
e
.keyword() <<
"'"
<<
endl
;
92
93
return
os
;
94
}
95
96
97
// ************************************************************************* //
Foam::dictionary::writeEntry
void writeEntry(Ostream &os) const
Write sub-dictionary with its dictName as its header.
Definition:
dictionaryIO.C:157
Foam::keyType
A class for handling keywords in dictionaries.
Definition:
keyType.H:66
Foam::dictionaryEntry::dictionaryEntry
dictionaryEntry(const dictionaryEntry &)=delete
No copy construct.
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition:
dictionary.H:129
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition:
Istream.H:57
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition:
Ostream.H:531
IOstreams.H
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
Foam::constant::electromagnetic::e
const dimensionedScalar e
Elementary charge.
Definition:
createFields.H:11
Foam::entry::keyword
const keyType & keyword() const noexcept
Return keyword.
Definition:
entry.H:231
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition:
Ostream.H:56
os
OBJstream os(runTime.globalPath()/outputName)
FUNCTION_NAME
#define FUNCTION_NAME
Definition:
messageStream.H:399
Foam::dictionaryEntry::write
virtual void write(Ostream &os) const
Write.
Definition:
dictionaryEntryIO.C:56
dictionaryEntry.H
Foam::IOstream::fatalCheck
bool fatalCheck(const char *operation) const
Check IOstream status for given operation.
Definition:
IOstream.C:51
Foam::glTF::key
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
Foam::entry
A keyword and a list of tokens is an 'entry'.
Definition:
entry.H:63
src
OpenFOAM
db
dictionary
dictionaryEntry
dictionaryEntryIO.C
Generated by
1.8.14