- Implemented most of the layered I/O for the pending.data file.
- Needs File::xxxxx support that doesn't exist yet.
This commit is contained in:
Paul Beckingham
2011-04-15 01:29:22 -04:00
parent b72173bb0e
commit e9273cd6c3
2 changed files with 183 additions and 0 deletions

View File

@@ -30,12 +30,48 @@
#include <map>
#include <vector>
#include <string>
#include <stdio.h>
#include <File.h>
#include <Task.h>
class TDB2
{
public:
TDB2 ();
~TDB2 ();
void set_location (const std::string&);
std::vector <Task>& get_pending_tasks ();
std::vector <std::string>& get_pending_lines ();
std::string& get_pending_contents ();
void add (const Task&);
void modify (const Task&);
void commit ();
private:
void load_pending_tasks ();
void load_pending_lines ();
void load_pending_contents ();
private:
std::string _location;
bool _loaded_pending_tasks;
bool _loaded_pending_lines;
bool _loaded_pending_contents;
bool _dirty_pending_tasks;
bool _dirty_pending_lines;
bool _dirty_pending_contents;
std::vector <Task> _pending_tasks;
std::vector <std::string> _pending_lines;
std::string _pending_contents;
File _pending_file;
std::string _completed_contents;
std::string _backlog_contents;
std::string _undo_contents;
};