/* * 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_ */