Database: Added ::initialize

This commit is contained in:
Paul Beckingham 2016-03-01 20:13:25 -05:00
parent b6ad3c741c
commit f2d9c61878
2 changed files with 20 additions and 0 deletions

View file

@ -26,7 +26,25 @@
#include <cmake.h>
#include <Database.h>
#include <FS.h>
#include <sstream>
#include <iostream> // TODO Remove
////////////////////////////////////////////////////////////////////////////////
void Database::initialize (const std::string& location)
{
_location = location;
Directory d (_location);
for (const auto& file : d.list ())
{
if (1 /* looks like one of our data files */)
{
_data_files.push_back (file);
std::cout << "# data file " << file << "\n";
}
}
}
////////////////////////////////////////////////////////////////////////////////
std::string Database::dump () const

View file

@ -34,9 +34,11 @@ class Database
{
public:
Database () = default;
void initialize (const std::string&);
std::string dump () const;
private:
std::string _location {"~/.timewarrior"};
std::vector <std::string> _data_files {};
};