summaryrefslogtreecommitdiffstats
path: root/logic/VersionFactory.h
blob: 0c0ee2d40a3a1934f1e3686f698f3a42f65afcd4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#pragma once
#include <QtCore>

struct OneSixVersion;
class Rule;

class FullVersionFactory
{
public:
	enum Error
	{
		AllOK, // all parsed OK
		ParseError, // the file was corrupted somehow
		UnsupportedVersion // the file was meant for a launcher version we don't support (yet)
	} m_error;
	QString error_string;

public:
	FullVersionFactory();
	QSharedPointer<OneSixVersion> parse(QByteArray data);
private:
	QSharedPointer<OneSixVersion> parse4(QJsonObject root, QSharedPointer<OneSixVersion> product);
	QList<QSharedPointer<Rule> > parse4rules(QJsonObject & baseObj);
};