mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Database: Implemented ::getAllIntervals
This commit is contained in:
parent
10d5ad2816
commit
90525013a3
2 changed files with 17 additions and 0 deletions
|
@ -28,6 +28,7 @@
|
||||||
#include <Database.h>
|
#include <Database.h>
|
||||||
#include <FS.h>
|
#include <FS.h>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
#include <iterator>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
|
|
||||||
|
@ -78,6 +79,21 @@ Interval Database::getLatestInterval ()
|
||||||
return _files[0].getLatestInterval ();
|
return _files[0].getLatestInterval ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
std::vector <Interval> Database::getAllIntervals ()
|
||||||
|
{
|
||||||
|
std::vector <Interval> all;
|
||||||
|
for (auto& file : _files)
|
||||||
|
{
|
||||||
|
auto i = file.getAllIntervals ();
|
||||||
|
all.insert (all.end (),
|
||||||
|
std::make_move_iterator (i.begin ()),
|
||||||
|
std::make_move_iterator (i.end ()));
|
||||||
|
}
|
||||||
|
|
||||||
|
return all;
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
void Database::addExclusion (const std::string& exclusion)
|
void Database::addExclusion (const std::string& exclusion)
|
||||||
{
|
{
|
||||||
|
|
|
@ -40,6 +40,7 @@ public:
|
||||||
void commit ();
|
void commit ();
|
||||||
|
|
||||||
Interval getLatestInterval ();
|
Interval getLatestInterval ();
|
||||||
|
std::vector <Interval> getAllIntervals ();
|
||||||
|
|
||||||
void addExclusion (const std::string&);
|
void addExclusion (const std::string&);
|
||||||
void addInterval (const Interval&);
|
void addInterval (const Interval&);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue