]> git.sur5r.net Git - minitube/blob - lib/updater/src/impl/parser.h
New upstream version 3.5
[minitube] / lib / updater / src / impl / parser.h
1 #ifndef UPDATER_IMPL_PARSER_H
2 #define UPDATER_IMPL_PARSER_H
3
4 #include <QtCore>
5
6 namespace updater {
7
8 class DefaultUpdater;
9
10 /**
11  * Implement this interface to parse your custom manifest format
12  */
13 class Parser {
14 public:
15     /// Parse your manifest and set relevant Updater properties
16     virtual void parse(const QByteArray &bytes) = 0;
17
18     void setUpdater(DefaultUpdater *value) { updater = value; }
19     bool hasError() const { return error; };
20     QString getErrorMessage() const { return errorMessage; };
21
22 protected:
23     Parser(){};
24     DefaultUpdater *updater = nullptr;
25     bool error = false;
26     QString errorMessage;
27 };
28
29 } // namespace updater
30
31 #endif // UPDATER_IMPL_PARSER_H