From 9d4f517fb4447054c93043b552a21c2c69dea9c6 Mon Sep 17 00:00:00 2001 From: Akos Polster Date: Sun, 3 Oct 2010 22:25:07 +0200 Subject: [PATCH] Add xmlhandler. --- model/xmlhandler.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 model/xmlhandler.h diff --git a/model/xmlhandler.h b/model/xmlhandler.h new file mode 100644 index 0000000..bcf23b6 --- /dev/null +++ b/model/xmlhandler.h @@ -0,0 +1,31 @@ +#ifndef XMLHANDLER_H +#define XMLHANDLER_H + +#include + +/** Generic XML handler. */ +class XmlHandler: public QXmlContentHandler +{ +public: + bool endDocument() {return true;} + bool endPrefixMapping(const QString &) {return true;} + QString errorString() const {return QString();} + bool ignorableWhitespace(const QString &) {return true;} + bool processingInstruction(const QString &, const QString &) { + return true; + } + void setDocumentLocator(QXmlLocator *) {} + bool skippedEntity(const QString &) {return true;} + bool startDocument() {return true;} + bool startPrefixMapping(const QString &, const QString &) {return true;} + + bool characters(const QString &ch) { + currentText += ch; + return true; + } + +protected: + QString currentText; +}; + +#endif // XMLHANDLER_H -- 1.7.9.5