2016-02-27 21:02:56 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <minecraft/VersionFile.h>
|
2016-03-07 01:01:28 +00:00
|
|
|
#include <minecraft/Library.h>
|
2016-02-27 21:02:56 +00:00
|
|
|
#include <QJsonDocument>
|
2021-04-01 01:50:28 +00:00
|
|
|
#include <ProblemProvider.h>
|
2016-02-27 21:02:56 +00:00
|
|
|
|
2021-07-25 17:11:59 +00:00
|
|
|
class MojangVersionFormat
|
2016-02-28 18:01:54 +00:00
|
|
|
{
|
2016-03-19 02:06:32 +00:00
|
|
|
friend class OneSixVersionFormat;
|
|
|
|
protected:
|
2018-07-15 12:51:05 +00:00
|
|
|
// does not include libraries
|
|
|
|
static void readVersionProperties(const QJsonObject& in, VersionFile* out);
|
|
|
|
// does not include libraries
|
|
|
|
static void writeVersionProperties(const VersionFile* in, QJsonObject& out);
|
2016-02-28 18:01:54 +00:00
|
|
|
public:
|
2018-07-15 12:51:05 +00:00
|
|
|
// version files / profile patches
|
|
|
|
static VersionFilePtr versionFileFromJson(const QJsonDocument &doc, const QString &filename);
|
|
|
|
static QJsonDocument versionFileToJson(const VersionFilePtr &patch);
|
2016-03-07 01:01:28 +00:00
|
|
|
|
2018-07-15 12:51:05 +00:00
|
|
|
// libraries
|
2021-04-01 01:50:28 +00:00
|
|
|
static LibraryPtr libraryFromJson(ProblemContainer & problems, const QJsonObject &libObj, const QString &filename);
|
2018-07-15 12:51:05 +00:00
|
|
|
static QJsonObject libraryToJson(Library *library);
|
2016-02-28 18:01:54 +00:00
|
|
|
};
|