summaryrefslogtreecommitdiff
path: root/src/xmlparser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/xmlparser.cc')
-rw-r--r--src/xmlparser.cc78
1 files changed, 44 insertions, 34 deletions
diff --git a/src/xmlparser.cc b/src/xmlparser.cc
index 03a54a1..a087c62 100644
--- a/src/xmlparser.cc
+++ b/src/xmlparser.cc
@@ -41,46 +41,56 @@ XmlParser::~XmlParser()
void XmlParser::characterData(const std::string &data)
{
- cdata += data;
+ cdata += data;
}
void XmlParser::startTag(std::string name, attributes_t &attr)
{
- if(name == "tasktree") {
- tree->nextid = atoi(xml_decode(attr["nextid"]).c_str());
- }
-
- if(name == "task") {
- taskid_t id = atoi(xml_decode(attr["id"]).c_str());
-
- node_t* parent = NULL;
- if(parents.size() != 0) parent = tree->id2node.at(parents.top());
-
- node = tree->createNode(id);
- tree->insertChild(parent, node);
- }
-
- if(name == "children") {
- parents.push(node->id);
- }
-
- if(name == "attribute") {
- attr_name = attr["name"];
- }
-
- cdata = "";
+ if(name == "tasktree")
+ {
+ tree->nextid = atoi(xml_decode(attr["nextid"]).c_str());
+ }
+
+ if(name == "task")
+ {
+ taskid_t id = atoi(xml_decode(attr["id"]).c_str());
+
+ node_t* parent = NULL;
+ if(parents.size() != 0)
+ {
+ parent = tree->id2node.at(parents.top());
+ }
+
+ node = tree->createNode(id);
+ tree->insertChild(parent, node);
+ }
+
+ if(name == "children")
+ {
+ parents.push(node->id);
+ }
+
+ if(name == "attribute")
+ {
+ attr_name = attr["name"];
+ }
+
+ cdata = "";
}
void XmlParser::endTag(std::string name)
{
- if(name == "task") {
- }
-
- if(name == "children") {
- parents.pop();
- }
-
- if(name == "attribute") {
- node->data.attributes[attr_name] = cdata;
- }
+ if(name == "task")
+ {
+ }
+
+ if(name == "children")
+ {
+ parents.pop();
+ }
+
+ if(name == "attribute")
+ {
+ node->data.attributes[attr_name] = cdata;
+ }
}