MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / read

Function read

src/OpenFOAM/db/dictionary/dictionaryIO.C:80–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
79
80bool Foam::dictionary::read(Istream& is, const bool keepHeader)
81{
82 // Check for empty dictionary
83 if (is.eof())
84 {
85 return true;
86 }
87
88 if (!is.good())
89 {
90 FatalIOErrorInFunction(is)
91 << "Istream not OK for reading dictionary "
92 << exit(FatalIOError);
93
94 return false;
95 }
96
97 token currToken(is);
98 if (currToken != token::BEGIN_BLOCK)
99 {
100 is.putBack(currToken);
101 }
102
103 while (!is.eof() && entry::New(*this, is))
104 {}
105
106 // normally remove the FoamFile header entry if it exists
107 if (!keepHeader)
108 {
109 remove("FoamFile");
110 }
111
112 if (is.bad())
113 {
114 InfoInFunction
115 << "Istream not OK after reading dictionary " << name()
116 << endl;
117
118 return false;
119 }
120
121 return true;
122}
123
124
125bool Foam::dictionary::read(Istream& is)

Callers 1

dictionaryIO.CFile · 0.70

Calls 8

eofMethod · 0.80
removeFunction · 0.70
exitFunction · 0.50
NewFunction · 0.50
nameFunction · 0.50
goodMethod · 0.45
badMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected