-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatparser.h
More file actions
55 lines (39 loc) · 995 Bytes
/
datparser.h
File metadata and controls
55 lines (39 loc) · 995 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef DATPARSER_H
#define DATPARSER_H
#include <QFile>
#include <QString>
#include <QStringList>
#include <QList>
#include <QJsonObject>
#include <QJsonDocument>
#include <QJsonArray>
#include <QFileInfo>
#include "parser.h"
class DatParser : public Parser
{
public:
enum Key {
CRC32 = 0,
SHA1,
MD5,
};
DatParser(const QString file);
~DatParser();
void parse();
QJsonDocument toJsonDocument() const;
bool save();
void setObjectKey(const DatParser::Key key);
private:
QString getKey(QStringList &list);
QString getValue(QStringList &list);
QList<QStringList> getRomData(QString str);
QString romValue(const QString &second_val, const QStringList &str_list, int i);
bool generateKeysFile();
void parse(const QString file);
QJsonDocument json_doc;
QJsonObject json_object;
unsigned object_key;
unsigned unknown_doc_key_increment;
QStringList export_keys;
};
#endif // DATPARSER_H