00001
00002
00003 #ifndef __XMLNODE_H__
00004 #define __XMLNODE_H__
00005
00006 #include <libxml/tree.h>
00007 #include <vector>
00008 #include <string>
00009
00010 namespace freedaisy {
00012 class XMLNode {
00013 public:
00015 XMLNode();
00017 XMLNode(std::string name);
00019 XMLNode(xmlNodePtr src);
00021
00024 XMLNode(XMLNode *src);
00025
00027
00033 std::string operator[](std::string attr);
00034
00036 std::string getName();
00037
00039 std::string getContent();
00040
00042
00045 void setContent(std::string content);
00046
00047 int hasAttr(std::string name);
00048
00050
00053 std::string getAttr(std::string name);
00054
00056
00060 void setAttr(std::string name, std::string attr);
00061
00063 void addChild(XMLNode* cur);
00064
00066 std::vector<XMLNode> getChildren();
00067
00069
00072 std::vector<XMLNode> getNextNodes(bool withme = false);
00073
00075 XMLNode getParent();
00076
00078 void unlink();
00079
00080 xmlNodePtr getC();
00081 protected:
00082 xmlNodePtr _xmlnode;
00083 };
00084 }
00085
00086 #endif