Skip to content
Snippets Groups Projects
Commit 557b6701 authored by andy's avatar andy
Browse files

ENH: Improved basicSource I/O

parent 11f421d4
Branches
Tags
No related merge requests found
......@@ -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;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment