From: Akos Polster Date: Sun, 3 Oct 2010 20:25:07 +0000 (+0200) Subject: Add xmlhandler. X-Git-Url: http://vcs.maemo.org/git/?a=commitdiff_plain;h=9d4f517fb4447054c93043b552a21c2c69dea9c6;p=dorian Add xmlhandler. --- 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