00001 #ifndef __XMLNODE_H__
00002 #define __XMLNODE_H__
00003
00004 #include <libxml/tree.h>
00005 #include <vector>
00006 #include <string>
00007
00008 namespace freedaisy {
00010 class XMLNode {
00011 public:
00013 XMLNode();
00015 XMLNode(std::string name);
00017 XMLNode(xmlNodePtr src);
00019
00022 XMLNode(XMLNode *src);
00023
00025
00031 std::string operator[](std::string attr);
00032
00034 std::string getName();
00035
00037 std::string getContent();
00038
00040
00043 void setContent(std::string content);
00044
00045 int hasAttr(std::string name);
00046
00048
00051 std::string getAttr(std::string name);
00052
00054
00058 void setAttr(std::string name, std::string attr);
00059
00061 void addChild(XMLNode* cur);
00062
00064 std::vector<XMLNode> getChildren();
00065
00067
00070 std::vector<XMLNode> getNextNodes(bool withme = false);
00071
00073 XMLNode getParent();
00074
00076 void unlink();
00077
00078 xmlNodePtr getC();
00079 protected:
00080 xmlNodePtr _xmlnode;
00081 };
00082 }
00083
00084 #endif