From 1ae51ff94d0f1f27a4e4cc657371578db13c3ca1 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Fri, 8 Feb 2019 20:26:14 +0100 Subject: Make code compile again (fix bitrot dating back from 2013). --- src/xmlparser.cc | 78 ++++++++++++++++++++++++++++++++------------------------ 1 file changed, 44 insertions(+), 34 deletions(-) (limited to 'src/xmlparser.cc') 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; + } } -- cgit v1.2.3