mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Database: Added ::validateAddition
This commit is contained in:
parent
18524fa8c8
commit
0debcf935b
2 changed files with 11 additions and 0 deletions
|
@ -111,6 +111,7 @@ void Database::addInterval (const Interval& interval)
|
||||||
{
|
{
|
||||||
// TODO Need to verify that interval.tags do not overlap with stored data.
|
// TODO Need to verify that interval.tags do not overlap with stored data.
|
||||||
// Unless the tags that overlap are allowed to overlap.
|
// Unless the tags that overlap are allowed to overlap.
|
||||||
|
validateAddition (interval);
|
||||||
|
|
||||||
auto intervalRange = interval.range ();
|
auto intervalRange = interval.range ();
|
||||||
for (auto& segment : segmentRange (intervalRange))
|
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
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -56,6 +56,7 @@ private:
|
||||||
unsigned int getDatafile (int, int);
|
unsigned int getDatafile (int, int);
|
||||||
std::vector <Daterange> segmentRange (const Daterange&);
|
std::vector <Daterange> segmentRange (const Daterange&);
|
||||||
void initializeDatafiles ();
|
void initializeDatafiles ();
|
||||||
|
void validateAddition (const Interval&) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string _location {"~/.timewarrior/data"};
|
std::string _location {"~/.timewarrior/data"};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue