mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Improved basicSource I/O
This commit is contained in:
@ -369,11 +369,17 @@ public:
|
||||
|
||||
// I-O
|
||||
|
||||
//- Write the source header information
|
||||
virtual void writeHeader(Ostream&) const;
|
||||
|
||||
//- Write the source footer information
|
||||
virtual void writeFooter(Ostream&) const;
|
||||
|
||||
//- Write the source properties
|
||||
virtual void writeData(Ostream&) const = 0;
|
||||
virtual void writeData(Ostream&) const;
|
||||
|
||||
//- Read source dictionary
|
||||
virtual bool read(const dictionary& dict) = 0;
|
||||
virtual bool read(const dictionary& dict);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -27,11 +27,21 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::basicSource::writeData(Ostream& os) const
|
||||
void Foam::basicSource::writeHeader(Ostream& os) const
|
||||
{
|
||||
os << indent << name_ << nl
|
||||
<< indent << token::BEGIN_BLOCK << incrIndent << nl;
|
||||
}
|
||||
|
||||
|
||||
void Foam::basicSource::writeFooter(Ostream& os) const
|
||||
{
|
||||
os << decrIndent << indent << token::END_BLOCK << endl;
|
||||
}
|
||||
|
||||
|
||||
void Foam::basicSource::writeData(Ostream& os) const
|
||||
{
|
||||
os.writeKeyword("active") << active_ << token::END_STATEMENT << nl;
|
||||
os.writeKeyword("timeStart") << timeStart_ << token::END_STATEMENT << nl;
|
||||
os.writeKeyword("duration") << duration_ << token::END_STATEMENT << nl;
|
||||
@ -70,8 +80,6 @@ void Foam::basicSource::writeData(Ostream& os) const
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
os << decrIndent << indent << token::END_BLOCK << endl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user