Datafile: Added ::commit, dependent on _dirty flag

This commit is contained in:
Paul Beckingham 2016-03-20 17:05:19 -04:00
parent fb6b33cd7d
commit 2d0051d696
2 changed files with 18 additions and 1 deletions

View file

@ -49,16 +49,30 @@ Interval Datafile::getLatestInterval () const
////////////////////////////////////////////////////////////////////////////////
void Datafile::addExclusion (const std::string& exclusion)
{
_dirty = true;
}
////////////////////////////////////////////////////////////////////////////////
void Datafile::addInterval (const Interval& interval)
{
_dirty = true;
}
////////////////////////////////////////////////////////////////////////////////
void Datafile::modifyInterval (const Interval& interval)
{
_dirty = true;
}
////////////////////////////////////////////////////////////////////////////////
void Datafile::commit ()
{
if (_dirty)
{
_dirty = false;
}
}
////////////////////////////////////////////////////////////////////////////////

View file

@ -44,10 +44,13 @@ public:
void addInterval (const Interval&);
void modifyInterval (const Interval&);
void commit ();
std::string dump () const;
private:
std::string _name {};
std::string _name {};
bool _dirty {false};
};
#endif