diff options
author | Fishbone <fishbone@miranda-ng.org> | 2013-06-02 16:19:21 +0000 |
---|---|---|
committer | Fishbone <fishbone@miranda-ng.org> | 2013-06-02 16:19:21 +0000 |
commit | ab7e0b08fa8c31cf1d468ab4b3c660e2b1836811 (patch) | |
tree | 52977603ea0f431adff16573d3d5b46a95843c7f /protocols/WhatsApp/src/WhatsAPI++/ProtocolTreeNode.h | |
parent | 8320783f99419db1e40346fdb292c19ee008948b (diff) |
Added WhatsApp-protocol
git-svn-id: http://svn.miranda-ng.org/main/trunk@4861 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/WhatsApp/src/WhatsAPI++/ProtocolTreeNode.h')
-rw-r--r-- | protocols/WhatsApp/src/WhatsAPI++/ProtocolTreeNode.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/protocols/WhatsApp/src/WhatsAPI++/ProtocolTreeNode.h b/protocols/WhatsApp/src/WhatsAPI++/ProtocolTreeNode.h new file mode 100644 index 0000000000..3156c8b7e7 --- /dev/null +++ b/protocols/WhatsApp/src/WhatsAPI++/ProtocolTreeNode.h @@ -0,0 +1,41 @@ +/*
+* ProtocolTreeNode.h
+*
+* Created on: 26/06/2012
+* Author: Antonio
+*/
+
+#if !defined(PROTOCOLNODE_H)
+#define PROTOCOLNODE_H
+
+#include <string>
+#include <vector>
+#include <map>
+
+using namespace std;
+
+class ProtocolTreeNode {
+public:
+ vector<unsigned char>* data;
+ string tag;
+ map<string, string> *attributes;
+ vector<ProtocolTreeNode*> *children;
+
+ ProtocolTreeNode(const string& tag, map<string, string> *attributes, ProtocolTreeNode* child);
+ ProtocolTreeNode(const string& tag, map<string, string> *attributes, vector<unsigned char>* data = NULL, vector<ProtocolTreeNode*> *children = NULL);
+ string toString();
+ ProtocolTreeNode* getChild(const string& id);
+ ProtocolTreeNode* getChild(size_t id);
+ string* getAttributeValue(const string& attribute);
+
+ vector<ProtocolTreeNode*>* getAllChildren();
+ vector<ProtocolTreeNode*>* getAllChildren(const string& tag);
+ std::string* getDataAsString();
+
+ static bool tagEquals(ProtocolTreeNode *node, const string& tag);
+ static void require(ProtocolTreeNode *node, const string& tag);
+
+ virtual ~ProtocolTreeNode();
+};
+
+#endif /* PROTOCOLNODE_H_ */
\ No newline at end of file |