summaryrefslogtreecommitdiff
path: root/src/dictionary/DictionaryReader.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/dictionary/DictionaryReader.h')
-rw-r--r--src/dictionary/DictionaryReader.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/dictionary/DictionaryReader.h b/src/dictionary/DictionaryReader.h
new file mode 100644
index 0000000..ca2ff00
--- /dev/null
+++ b/src/dictionary/DictionaryReader.h
@@ -0,0 +1,44 @@
+#ifndef DICTIONARYREADER_H
+#define DICTIONARYREADER_H
+
+#include <QXmlStreamReader>
+#include <QList>
+#include <QString>
+
+class Dictionary;
+class CardPack;
+class Field;
+
+class DictionaryReader : public QXmlStreamReader
+{
+public:
+ DictionaryReader( Dictionary* aDict );
+ bool read( QIODevice* aDevice );
+
+private:
+ static const QString MinSupportedDictVersion;
+
+private:
+ void readDict();
+ void notifyObsoleteVersion( const QString& aOldVersion );
+ void readUnknownElement();
+ void readDictCurrentVersion();
+ void readFields();
+ void readField();
+ void readPacks();
+ void readPack();
+ void readEntries();
+ void readE();
+ void readDict04();
+ void readDict03();
+ void readE03();
+
+private:
+ Dictionary* m_dict;
+ QString m_dictVersion;
+ CardPack* m_curCardPack; ///< For 0.4
+ QList<const Field*> m_curAnsFieldList; ///< For 0.4
+
+};
+
+#endif // DICTIONARYREADER_H