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

Function write

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

Source from the content-addressed store, hash-verified

170// * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * * //
171
172void Foam::dictionary::write(Ostream& os, bool subDict) const
173{
174 if (subDict)
175 {
176 os << nl << indent << token::BEGIN_BLOCK << incrIndent << nl;
177 }
178
179 forAllConstIter(IDLList<entry>, *this, iter)
180 {
181 const entry& e = *iter;
182
183 // Write entry
184 os << e;
185
186 // Add extra new line between entries for "top-level" dictionaries
187 if (!subDict && parent() == dictionary::null && e != *last())
188 {
189 os << nl;
190 }
191
192 // Check stream before going to next entry.
193 if (!os.good())
194 {
195 WarningInFunction
196 << "Can't write entry " << iter().keyword()
197 << " for dictionary " << name()
198 << endl;
199 }
200 }
201
202 if (subDict)
203 {
204 os << decrIndent << indent << token::END_BLOCK << endl;
205 }
206}
207
208
209Foam::Ostream& Foam::operator<<(Ostream& os, const dictionary& dict)

Callers 10

dictionary.CFile · 0.70
dimensionSetIO.CFile · 0.50
writeNowFunction · 0.50
writeDataFunction · 0.50
writeDataFunction · 0.50
UOPstream.CFile · 0.50
endlFunction · 0.50
checkWritePrefixFunction · 0.50
prefixOSstream.CFile · 0.50
Ostream.CFile · 0.50

Calls 3

forAllConstIterFunction · 0.50
nameFunction · 0.50
goodMethod · 0.45

Tested by

no test coverage detected