Work on import engines : remove libxml dependency in favor of QtXml
This commit is contained in:
@@ -20,11 +20,12 @@
|
||||
#ifndef XMLIMPORTENGINE_H
|
||||
#define XMLIMPORTENGINE_H
|
||||
|
||||
#include <libxml/parser.h>
|
||||
#include <QXmlDefaultHandler>
|
||||
#include <QXmlAttributes>
|
||||
|
||||
#include "ImportEngine.hpp"
|
||||
|
||||
class XMLImportEngine : public ImportEngine {
|
||||
class XMLImportEngine : public ImportEngine, public QXmlDefaultHandler {
|
||||
public:
|
||||
XMLImportEngine();
|
||||
~XMLImportEngine();
|
||||
@@ -32,13 +33,14 @@ public:
|
||||
virtual bool HandleFile(const QString& path, User* user, Database* db, KissCount* kiss);
|
||||
|
||||
private:
|
||||
xmlSAXHandler _sax;
|
||||
QXmlSimpleReader _sax;
|
||||
|
||||
static void XmlStartElement(void* user_data, const xmlChar* name_, const xmlChar** attrs_);
|
||||
static void LoadAccount(XMLImportEngine* _this, const char** attrs);
|
||||
static void LoadAccountAmount(XMLImportEngine* _this, const char** attrs);
|
||||
static void LoadCategory(XMLImportEngine* _this, const char** attrs);
|
||||
static void LoadOperation(XMLImportEngine* _this, const char** attrs);
|
||||
bool startElement (const QString& namespaceURI, const QString& localName, const QString& qName, const QXmlAttributes& atts);
|
||||
|
||||
void LoadAccount(const QXmlAttributes& atts);
|
||||
void LoadAccountAmount(const QXmlAttributes& atts);
|
||||
void LoadCategory(const QXmlAttributes& atts);
|
||||
void LoadOperation(const QXmlAttributes& atts);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user