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

@ -58,11 +58,13 @@ void Foam::Function1Types::ramp::writeData(Ostream& os) const
{
Function1<scalar>::writeData(os);
os << token::END_STATEMENT << nl;
os << indent << word(this->name() + "Coeffs") << nl;
os << indent << token::BEGIN_BLOCK << incrIndent << nl;
os.writeKeyword("start") << start_ << token::END_STATEMENT << nl;
os.writeKeyword("duration") << duration_ << token::END_STATEMENT << nl;
os << decrIndent << indent << token::END_BLOCK << endl;
os.beginBlock(word(this->name() + "Coeffs"));
os.writeEntry("start", start_);
os.writeEntry("duration", duration_);
os.endBlock();
}