#ifndef TREENODE_H
#define TREENODE_H
#include <vector>
#include <string>
/**
 *  TreeNode, A node which consists of a name value and a list of child nodes. TreeNode is used for XML Parsing output.
 */
class TreeNode {
	public:
		TreeNode(string name,string value,vector<TreeNode *> * childVec);
		TreeNode(string name,string value);
		TreeNode();
		/**
		 * list of Child nodes
		 * */
		vector<TreeNode*> * children;	
		/**
		 * the name of the TreeNode
		 * */
		string name;
		/**
		 * it's value
		 * */
		string value;
		/**
		 * getChildren Returns a list of child nodes.
		 * */
		vector<TreeNode*> * getChildren(); 
		/**
		 * Returns the name of the treeNode
		 * */
		string getName();
		/**
		 * Returns the value of the treeNode
		 * */
		string getValue();
		/**
		 * getChild
		 * gets the 1st Child with the node name name,
		 * throws an string * exception if the node is 
		 * not found
		 * */
		TreeNode * getChild(const string & name); 
		/**
		 * Does a child by name exist?
		 * */
		bool existChild(const string & name); //Does a subchild exist?
		/**
		 * Destructor
		 * */
		virtual ~TreeNode();
		/**
		 * remove all children
		 * */
		void clearChildren();
	private:
		void init(string name,string value,vector<TreeNode*> * vecChild);

};
#endif
