summaryrefslogtreecommitdiff
path: root/src/xmpp/xmpp_stanza.hpp
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2014-05-27 01:01:38 +0200
committerFlorent Le Coz <louiz@louiz.org>2014-05-30 03:58:17 +0200
commiteb9a20187098185cc10ad192e91a90dbba12633a (patch)
treeb8bc59e7120d0c965642de875a8498f50bfd9da4 /src/xmpp/xmpp_stanza.hpp
parent1c93afc9a7ec33d90c81062c3f1077b5cf84c212 (diff)
downloadbiboumi-eb9a20187098185cc10ad192e91a90dbba12633a.tar.gz
biboumi-eb9a20187098185cc10ad192e91a90dbba12633a.tar.bz2
biboumi-eb9a20187098185cc10ad192e91a90dbba12633a.tar.xz
biboumi-eb9a20187098185cc10ad192e91a90dbba12633a.zip
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
Diffstat (limited to 'src/xmpp/xmpp_stanza.hpp')
-rw-r--r--src/xmpp/xmpp_stanza.hpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/xmpp/xmpp_stanza.hpp b/src/xmpp/xmpp_stanza.hpp
index cc8d53a..e55d555 100644
--- a/src/xmpp/xmpp_stanza.hpp
+++ b/src/xmpp/xmpp_stanza.hpp
@@ -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();
@@ -104,6 +119,11 @@ public:
*/
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";
*/
std::string& operator[](const std::string& name);
@@ -117,7 +137,6 @@ private:
std::string inner;
std::string tail;
- XmlNode(const XmlNode&) = delete;
XmlNode& operator=(const XmlNode&) = delete;
XmlNode& operator=(XmlNode&&) = delete;
};