X-Git-Url: https://git.sven.stormbind.net/?a=blobdiff_plain;f=src%2Fxml-base.h;fp=src%2Fxml-base.h;h=7ec9a317cdec4476c29a03b9b249827d74274719;hb=d483bd8e6523c23c6f1d8908a2e0611c2bc9ff4f;hp=0000000000000000000000000000000000000000;hpb=7dfa3fe589d1722d49681f42cdb0bf1e6efb5223;p=sven%2Fvym.git diff --git a/src/xml-base.h b/src/xml-base.h new file mode 100644 index 0000000..7ec9a31 --- /dev/null +++ b/src/xml-base.h @@ -0,0 +1,50 @@ +#ifndef XML_BASE +#define XML_BASE + +//#include +#include + +#include "file.h" + +class VymModel; + +/*! \brief Base class for parsing maps from XML documents */ + +class parseBaseHandler : public QXmlDefaultHandler { + public: + parseBaseHandler(); + ~parseBaseHandler(); + QString errorProtocol(); + QString parseHREF(QString); + virtual bool startElement(const QString &, const QString &, + const QString &eName, + const QXmlAttributes &atts) = 0; + virtual bool endElement(const QString &, const QString &, + const QString &) = 0; + virtual bool characters(const QString &) = 0; + + virtual QString errorString() = 0; + bool fatalError(const QXmlParseException &); + void setModel(VymModel *); + void setTmpDir(QString); + void setInputFile(const QString &); + void setInputString(const QString &); + void setLoadMode(const LoadMode &, int p = -1); + bool readHtmlAttr(const QXmlAttributes &); + + protected: + QString errorProt; + + LoadMode loadMode; + int insertPos; + + bool isVymPart; + int branchDepth; + VymModel *model; + QString tmpDir; + QString inputFile; + QString inputString; + QString htmldata; + QString version; +}; +#endif