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

@ -173,10 +173,8 @@ void Foam::csvTableReader<Type>::write(Ostream& os) const
{
tableReader<Type>::write(os);
os.writeKeyword("hasHeaderLine")
<< headerLine_ << token::END_STATEMENT << nl;
os.writeKeyword("timeColumn")
<< timeColumn_ << token::END_STATEMENT << nl;
os.writeEntry("hasHeaderLine", headerLine_);
os.writeEntry("timeColumn", timeColumn_);
// Force writing labelList in ascii
os.writeKeyword("valueColumns");
@ -186,10 +184,13 @@ void Foam::csvTableReader<Type>::write(Ostream& os) const
os << componentColumns_;
os.format(IOstream::BINARY);
}
else
{
os << componentColumns_;
}
os << token::END_STATEMENT << nl;
os.writeKeyword("separator")
<< string(separator_) << token::END_STATEMENT << nl;
os.writeEntry("separator", string(separator_));
}