Implement the support for adhoc commands

We have two basic example commands. But it’s not entirely finished because
there are some error checks that we don’t do.

ref #2521
This commit is contained in:
Florent Le Coz
2014-05-30 03:58:17 +02:00
parent 1c93afc9a7
commit eb9a201870
8 changed files with 370 additions and 5 deletions
+20 -1
View File
@@ -34,6 +34,21 @@ public:
{
node.parent = nullptr;
}
/**
* The copy constructor do not copy the children or parent attributes. The
* copied node is identical to the original except that it is not attached
* to any other node.
*/
XmlNode(const XmlNode& node):
name(node.name),
parent(nullptr),
closed(node.closed),
attributes(node.attributes),
children{},
inner(node.inner),
tail(node.tail)
{
}
~XmlNode();
@@ -103,6 +118,11 @@ public:
* node as no such attribute.
*/
const std::string get_tag(const std::string& name) const;
/**
* Remove the attribute of the node. Does nothing if that attribute is not
* present. Returns true if the tag was removed, false if it was absent.
*/
bool del_tag(const std::string& name);
/**
* Use this to set an attribute's value, like node["id"] = "12";
*/
@@ -117,7 +137,6 @@ private:
std::string inner;
std::string tail;
XmlNode(const XmlNode&) = delete;
XmlNode& operator=(const XmlNode&) = delete;
XmlNode& operator=(XmlNode&&) = delete;
};