summaryrefslogtreecommitdiff
path: root/libtemplate/xmlparser.h
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2014-09-27 09:25:14 +0200
committerlouis <louis.braun@gmx.de>2014-09-27 09:25:14 +0200
commitb0509b5182b6e0d04f05e6b3d5676b0d21f51966 (patch)
tree22b302342f22843e0815eb5f516c85f1478cbf0b /libtemplate/xmlparser.h
downloadvdr-plugin-skindesigner-0.0.1.tar.gz
vdr-plugin-skindesigner-0.0.1.tar.bz2
initial commit version 0.0.10.0.1
Diffstat (limited to 'libtemplate/xmlparser.h')
-rw-r--r--libtemplate/xmlparser.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/libtemplate/xmlparser.h b/libtemplate/xmlparser.h
new file mode 100644
index 0000000..ecdcca3
--- /dev/null
+++ b/libtemplate/xmlparser.h
@@ -0,0 +1,56 @@
+#ifndef __XMLPARSER_H
+#define __XMLPARSER_H
+
+#include <iostream>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string>
+#include <vector>
+#include <map>
+#include <set>
+#include <libxml/parser.h>
+#include <libxml/tree.h>
+#include <libxml/xmlerror.h>
+#include <vdr/plugin.h>
+
+#include "templateview.h"
+#include "templateviewlist.h"
+#include "templateviewtab.h"
+
+using namespace std;
+
+// --- cXmlParser -------------------------------------------------------------
+
+class cXmlParser {
+private:
+ cTemplateView *view;
+ cGlobals *globals;
+ xmlParserCtxtPtr ctxt;
+ xmlDocPtr doc;
+ xmlNodePtr root;
+ string GetPath(string xmlFile);
+ void ParseGlobalColors(xmlNodePtr node);
+ void InsertColor(string name, string value);
+ void ParseGlobalVariables(xmlNodePtr node);
+ void InsertVariable(string name, string type, string value);
+ void ParseGlobalFonts(xmlNodePtr node);
+ void ParseTranslations(xmlNodePtr node);
+ bool ParseSubView(xmlNodePtr node);
+ void ParseViewElement(const xmlChar * viewElement, xmlNodePtr node, bool debugVE, cTemplateView *subView = NULL);
+ void ParseViewList(xmlNodePtr parentNode, cTemplateView *subView = NULL);
+ void ParseViewTab(xmlNodePtr parentNode, cTemplateView *subView);
+ void ParseFunctionCalls(xmlNodePtr node, cTemplatePixmap *pix);
+ void ParseLoopFunctionCalls(xmlNodePtr node, cTemplateLoopFunction *loopFunc);
+ bool ParseAttributes(xmlAttrPtr attr, xmlNodePtr node, vector<pair<string, string> > &attribs);
+ bool DebugViewElement(xmlNodePtr node);
+public:
+ cXmlParser(void);
+ virtual ~cXmlParser(void);
+ bool ReadView(cTemplateView *view, string xmlFile);
+ bool ReadGlobals(cGlobals *globals, string xmlFile);
+ bool ParseView(void);
+ bool ParseGlobals(void);
+ void DeleteDocument(void);
+};
+
+#endif //__XMLPARSER_H \ No newline at end of file