- Began serious TDB2 development by adding TDB2::dump, which shows
  all the file-related data in debug mode.
This commit is contained in:
Paul Beckingham
2011-07-11 23:19:21 -04:00
parent f059c27bf0
commit 5b4c46fe42
3 changed files with 107 additions and 38 deletions

View File

@@ -32,6 +32,7 @@
#include <vector>
#include <string>
#include <stdio.h>
#include <ViewText.h>
#include <File.h>
#include <Task.h>
@@ -44,9 +45,9 @@ public:
void target (const std::string&);
std::vector <Task>& get_tasks ();
std::vector <std::string>& get_lines ();
std::string& get_contents ();
const std::vector <Task>& get_tasks ();
const std::vector <std::string>& get_lines ();
const std::string& get_contents ();
void add_task (const Task&);
void modify_task (const Task&);
@@ -54,18 +55,20 @@ public:
void clear_lines ();
void commit ();
private:
public:
void load_tasks ();
void load_lines ();
void load_contents ();
private:
public:
bool _read_only;
bool _dirty;
bool _loaded_tasks;
bool _loaded_lines;
bool _loaded_contents;
std::vector <Task> _tasks;
std::vector <Task> _added_tasks;
std::vector <Task> _removed_tasks;
std::vector <Task> _modified_tasks;
std::vector <std::string> _lines;
std::vector <std::string> _added_lines;
@@ -73,7 +76,6 @@ private:
File _file;
};
// TDB2 Class represents all the files in the task database.
class TDB2
{
@@ -87,6 +89,9 @@ public:
void commit ();
int gc ();
void dump ();
void dump_file (ViewText&, const std::string&, TF2&);
public:
TF2 pending;
TF2 completed;