summaryrefslogtreecommitdiff
path: root/louloulibs
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2015-09-01 04:56:06 +0200
committerFlorent Le Coz <louiz@louiz.org>2015-09-01 04:56:06 +0200
commit38564d77c7679dd4de4562d321146322b6211d61 (patch)
tree0426c86e92e6b5ce71713e04c3d998fbb58db226 /louloulibs
parentd7e1214cbcff2d34f45687eff7c083a89bf04802 (diff)
downloadbiboumi-38564d77c7679dd4de4562d321146322b6211d61.tar.gz
biboumi-38564d77c7679dd4de4562d321146322b6211d61.tar.bz2
biboumi-38564d77c7679dd4de4562d321146322b6211d61.tar.xz
biboumi-38564d77c7679dd4de4562d321146322b6211d61.zip
Little cleanup of the XmlNode class
Use map instead of unordered map (it's not slower, and it's shorter). Use the default move constructor.
Diffstat (limited to 'louloulibs')
-rw-r--r--louloulibs/xmpp/xmpp_stanza.hpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/louloulibs/xmpp/xmpp_stanza.hpp b/louloulibs/xmpp/xmpp_stanza.hpp
index 3d5b0c5..ee6b25b 100644
--- a/louloulibs/xmpp/xmpp_stanza.hpp
+++ b/louloulibs/xmpp/xmpp_stanza.hpp
@@ -1,7 +1,7 @@
#ifndef XMPP_STANZA_INCLUDED
# define XMPP_STANZA_INCLUDED
-#include <unordered_map>
+#include <map>
#include <string>
#include <vector>
@@ -24,18 +24,9 @@ class XmlNode
public:
explicit XmlNode(const std::string& name, XmlNode* parent);
explicit XmlNode(const std::string& name);
- XmlNode(XmlNode&& node):
- name(std::move(node.name)),
- parent(node.parent),
- attributes(std::move(node.attributes)),
- children(std::move(node.children)),
- inner(std::move(node.inner)),
- tail(std::move(node.tail))
- {
- node.parent = nullptr;
- }
+ XmlNode(XmlNode&& node) = default;
/**
- * The copy constructor do not copy the parent attribute. The children
+ * The copy constructor does not copy the parent attribute. The children
* nodes are all copied recursively.
*/
XmlNode(const XmlNode& node):
@@ -134,7 +125,7 @@ public:
private:
std::string name;
XmlNode* parent;
- std::unordered_map<std::string, std::string> attributes;
+ std::map<std::string, std::string> attributes;
std::vector<XmlNode*> children;
std::string inner;
std::string tail;