STYLE: use Ostream writeEntry when writing key/value entries

- makes for clearer code

ENH: make writeIfDifferent part of Ostream
This commit is contained in:
Mark Olesen
2017-11-06 00:49:24 +01:00
parent 0ca0a6264b
commit c0ba7bf05a
232 changed files with 854 additions and 1291 deletions

View File

@ -345,18 +345,19 @@ Foam::tmp<Foam::Field<Type>> Foam::Function1Types::TableBase<Type>::y() const
template<class Type>
void Foam::Function1Types::TableBase<Type>::writeEntries(Ostream& os) const
{
if (bounding_ != bounds::repeatableBounding::CLAMP)
{
os.writeEntry
(
"outOfBounds",
bounds::repeatableBoundingNames[bounding_]
);
}
if (interpolationScheme_ != "linear")
{
os.writeEntry("interpolationScheme", interpolationScheme_);
}
os.writeEntryIfDifferent<word>
(
"outOfBounds",
bounds::repeatableBoundingNames[bounds::repeatableBounding::CLAMP],
bounds::repeatableBoundingNames[bounding_]
);
os.writeEntryIfDifferent<word>
(
"interpolationScheme",
"linear",
interpolationScheme_
);
}