Database: Implemented ::getAllIntervals

This commit is contained in:
Paul Beckingham 2016-03-22 00:21:54 -04:00
parent 10d5ad2816
commit 90525013a3
2 changed files with 17 additions and 0 deletions

View file

@ -28,6 +28,7 @@
#include <Database.h>
#include <FS.h>
#include <sstream>
#include <iterator>
#include <iomanip>
#include <ctime>
@ -78,6 +79,21 @@ Interval Database::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)
{

View file

@ -40,6 +40,7 @@ public:
void commit ();
Interval getLatestInterval ();
std::vector <Interval> getAllIntervals ();
void addExclusion (const std::string&);
void addInterval (const Interval&);