00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef _XmlAgent_h
00014 #define _XmlAgent_h
00015
00016 #include <Y2.h>
00017 #include <scr/SCRAgent.h>
00018 #include <libxml/parser.h>
00019 #include <libxml/tree.h>
00020 #include <libxml/parserInternals.h>
00021 #include <libxml/xinclude.h>
00022 #include <libxml/xmlerror.h>
00023
00027 class XmlAgent : public SCRAgent
00028 {
00029 private:
00034 public:
00038 XmlAgent();
00042 virtual ~XmlAgent();
00043
00049 virtual YCPValue Read(const YCPPath &path,
00050 const YCPValue& arg=YCPNull (),
00051 const YCPValue& opt = YCPNull());
00052
00056 virtual YCPValue Execute(const YCPPath &path, const YCPValue& value, const YCPValue& arg );
00057
00061 virtual YCPList Dir(const YCPPath& path);
00062
00066 virtual YCPBoolean Write(const YCPPath &path,
00067 const YCPValue& value,
00068 const YCPValue& arg = YCPNull());
00069
00073 virtual YCPValue otherCommand(const YCPTerm& term);
00074
00075 protected:
00076 YCPList Cdata;
00077 YCPMap ListEntries;
00078 xmlNsPtr configNamespace;
00079
00080 virtual YCPValue ParseNodesAsMap(xmlNodePtr tree);
00081 virtual YCPValue ParseNodesAsList(xmlNodePtr tree);
00082 virtual YCPValue SetType(xmlNodePtr node);
00083 virtual YCPValue Xmlrpc(xmlNodePtr tree);
00084 virtual YCPList getParams (xmlNodePtr paramsNode);
00085 virtual YCPValue getValue( xmlNodePtr paramNode);
00086 virtual YCPMap getStruct(xmlNodePtr structNode);
00087 virtual YCPValue getArray(xmlNodePtr structNode);
00088 virtual xmlNodePtr ParseYCPMap (YCPMap map, xmlNodePtr parent, xmlDocPtr doc);
00089 virtual xmlNodePtr ParseYCPList (YCPList list, xmlNodePtr parent, const char *listname, xmlDocPtr doc);
00090 virtual bool isCDATA(YCPString section);
00091 };
00092
00093 #endif