summaryrefslogtreecommitdiff
path: root/protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeReader.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-01-25 17:45:10 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-01-25 17:45:10 +0000
commitdac1f42ef81ac1119430fd294a6b35b0b8cd6837 (patch)
treee3b972fc4bb56a3158e57adc70df6655f6a34dcf /protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeReader.cpp
parent357ae09c7eba86e783583566816285750933beaa (diff)
- class KeyStream extracted to the separate module;
- xml attributes redesigned to produce efficient code; - many small improvements git-svn-id: http://svn.miranda-ng.org/main/trunk@11905 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeReader.cpp')
-rw-r--r--protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeReader.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeReader.cpp b/protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeReader.cpp
index 573afb4680..16e9238a4f 100644
--- a/protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeReader.cpp
+++ b/protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeReader.cpp
@@ -5,7 +5,8 @@
* Author: Antonio
*/
-#include <algorithm>
+#include "../common.h" // #TODO Remove Miranda-dependency
+
#include "BinTreeNodeReader.h"
#include "WAException.h"
#include "ProtocolTreeNode.h"
@@ -69,13 +70,13 @@ ProtocolTreeNode* BinTreeNodeReader::nextTreeInternal()
int attribCount = (size - 2 + size % 2) / 2;
std::map<string, string>* attribs = readAttributes(attribCount);
if (size % 2 == 1) {
- ProtocolTreeNode* ret = new ProtocolTreeNode(*tag, attribs);
+ ProtocolTreeNode* ret = new ProtocolTreeNode(*tag); ret->attributes = attribs;
delete tag;
return ret;
}
b = this->in->read();
if (isListTag(b)) {
- ProtocolTreeNode* ret = new ProtocolTreeNode(*tag, attribs, NULL, readList(b));
+ ProtocolTreeNode* ret = new ProtocolTreeNode(*tag, NULL, readList(b)); ret->attributes = attribs;
delete tag;
return ret;
}
@@ -91,7 +92,7 @@ ProtocolTreeNode* BinTreeNodeReader::nextTreeInternal()
data = (std::vector<unsigned char>*) obj->data;
}
- ProtocolTreeNode* ret = new ProtocolTreeNode(*tag, attribs, data);
+ ProtocolTreeNode* ret = new ProtocolTreeNode(*tag, data); ret->attributes = attribs;
delete obj;
delete tag;
return ret;