From ab7e0b08fa8c31cf1d468ab4b3c660e2b1836811 Mon Sep 17 00:00:00 2001 From: Fishbone Date: Sun, 2 Jun 2013 16:19:21 +0000 Subject: Added WhatsApp-protocol git-svn-id: http://svn.miranda-ng.org/main/trunk@4861 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- .../WhatsApp/src/WhatsAPI++/ProtocolTreeNode.h | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 protocols/WhatsApp/src/WhatsAPI++/ProtocolTreeNode.h (limited to 'protocols/WhatsApp/src/WhatsAPI++/ProtocolTreeNode.h') 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 +#include +#include + +using namespace std; + +class ProtocolTreeNode { +public: + vector* data; + string tag; + map *attributes; + vector *children; + + ProtocolTreeNode(const string& tag, map *attributes, ProtocolTreeNode* child); + ProtocolTreeNode(const string& tag, map *attributes, vector* data = NULL, vector *children = NULL); + string toString(); + ProtocolTreeNode* getChild(const string& id); + ProtocolTreeNode* getChild(size_t id); + string* getAttributeValue(const string& attribute); + + vector* getAllChildren(); + vector* 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 -- cgit v1.2.3