diff options
author | Jedidiah Barber <contact@jedbarber.id.au> | 2021-07-14 11:49:10 +1200 |
---|---|---|
committer | Jedidiah Barber <contact@jedbarber.id.au> | 2021-07-14 11:49:10 +1200 |
commit | d24f813f3f2a05c112e803e4256b53535895fc98 (patch) | |
tree | 601e6ae9a1cd44bcfdcf91739a5ca36aedd827c9 /src/dictionary/DictionaryReader.h |
Diffstat (limited to 'src/dictionary/DictionaryReader.h')
-rw-r--r-- | src/dictionary/DictionaryReader.h | 44 |
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 |