summaryrefslogtreecommitdiff
path: root/src/tasktree.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/tasktree.h')
-rw-r--r--src/tasktree.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/tasktree.h b/src/tasktree.h
index 41a29be..d5e215f 100644
--- a/src/tasktree.h
+++ b/src/tasktree.h
@@ -34,18 +34,24 @@
#include "task.h"
-typedef struct node node_t;
+class node;
+typedef std::list<class node*> NodeList;
-typedef std::list<struct node*> NodeList;
-
-struct node {
+class node
+{
+public:
taskid_t id;
- node_t* parent;
+ node* parent;
task_t data;
NodeList children;
+
+ std::string toXML(std::string prefix);
};
+typedef node node_t;
+
class TaskTree {
+ friend class XmlParser;
public:
TaskTree();
~TaskTree();
@@ -62,6 +68,9 @@ public:
void toStdOut();
+ std::string toXML();
+ void fromXML(std::string xml);
+
private:
node_t* createNode(taskid_t id);
void insertChild(node_t* parent, node_t* child);