mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Database: Added ::initialize
This commit is contained in:
parent
b6ad3c741c
commit
f2d9c61878
2 changed files with 20 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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 {};
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue