summaryrefslogtreecommitdiff
path: root/protocols/WhatsApp/src/WhatsAPI++/ProtocolTreeNode.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-01-26 16:19:13 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-01-26 16:19:13 +0000
commitde6c7df3c362fa0104e7d908c29614266caaa9d6 (patch)
tree0824b5afcbe12e17e9bb36221fce4b7c87ecd03c /protocols/WhatsApp/src/WhatsAPI++/ProtocolTreeNode.cpp
parent53867c8c7ca7a578d8f36b619f352700ba34c9ad (diff)
fixed user search & addition
git-svn-id: http://svn.miranda-ng.org/main/trunk@11918 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/WhatsApp/src/WhatsAPI++/ProtocolTreeNode.cpp')
-rw-r--r--protocols/WhatsApp/src/WhatsAPI++/ProtocolTreeNode.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/protocols/WhatsApp/src/WhatsAPI++/ProtocolTreeNode.cpp b/protocols/WhatsApp/src/WhatsAPI++/ProtocolTreeNode.cpp
index cb3bc19258..7ef362ef4b 100644
--- a/protocols/WhatsApp/src/WhatsAPI++/ProtocolTreeNode.cpp
+++ b/protocols/WhatsApp/src/WhatsAPI++/ProtocolTreeNode.cpp
@@ -12,35 +12,35 @@
static std::string nilstr;
-ProtocolTreeNode::ProtocolTreeNode(const string& tag, vector<unsigned char>* data, vector<ProtocolTreeNode*> *children)
+ProtocolTreeNode::ProtocolTreeNode(const string &_tag, vector<unsigned char>* _data, vector<ProtocolTreeNode*> *_children) :
+ tag(_tag)
{
- this->tag = tag;
- this->data = data;
- this->attributes = NULL;
- this->children = children;
+ data = _data;
+ attributes = NULL;
+ children = _children;
}
-ProtocolTreeNode::ProtocolTreeNode(const string& tag, ProtocolTreeNode* child)
+ProtocolTreeNode::ProtocolTreeNode(const string &_tag, ProtocolTreeNode *_child) :
+ tag(_tag)
{
- this->tag = tag;
this->data = NULL;
this->attributes = NULL;
- this->children = new std::vector<ProtocolTreeNode*>(1);
- (*this->children)[0] = child;
+ this->children = new std::vector<ProtocolTreeNode*>();
+ children->push_back(_child);
}
ProtocolTreeNode::~ProtocolTreeNode()
{
- if (this->attributes != NULL)
- delete this->attributes;
+ delete this->attributes;
+
if (this->children != NULL) {
for (size_t i = 0; i < this->children->size(); i++)
if (this->children->at(i) != NULL)
delete this->children->at(i);
delete this->children;
}
- if (this->data != NULL)
- delete data;
+
+ delete data;
}