Database: Added ::validateAddition

This commit is contained in:
Paul Beckingham 2016-04-20 08:22:25 -04:00
parent 18524fa8c8
commit 0debcf935b
2 changed files with 11 additions and 0 deletions

View file

@ -111,6 +111,7 @@ void Database::addInterval (const Interval& interval)
{
// TODO Need to verify that interval.tags do not overlap with stored data.
// Unless the tags that overlap are allowed to overlap.
validateAddition (interval);
auto intervalRange = interval.range ();
for (auto& segment : segmentRange (intervalRange))
@ -272,3 +273,12 @@ void Database::initializeDatafiles ()
}
////////////////////////////////////////////////////////////////////////////////
// Responsible for checking that the proposed interval "fits" with existing data
// and does not overlap tags unless configured to.
//
// The method either silently succeeds or throws an error.
void Database::validateAddition (const Interval& interval) const
{
}
////////////////////////////////////////////////////////////////////////////////

View file

@ -56,6 +56,7 @@ private:
unsigned int getDatafile (int, int);
std::vector <Daterange> segmentRange (const Daterange&);
void initializeDatafiles ();
void validateAddition (const Interval&) const;
private:
std::string _location {"~/.timewarrior/data"};