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 02:50:28 +01:00
|
|
|
#include <ProblemProvider.h>
|
2016-02-27 21:02:56 +00:00
|
|
|
|
2021-07-25 18:11:59 +01:00
|
|
|
class MojangVersionFormat
|
2016-02-28 18:01:54 +00:00
|
|
|
{
|
2016-03-19 02:06:32 +00:00
|
|
|
friend class OneSixVersionFormat;
|
|
|
|
protected:
|
|
|
|
// 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:
|
|
|
|
// version files / profile patches
|
|
|
|
static VersionFilePtr versionFileFromJson(const QJsonDocument &doc, const QString &filename);
|
2016-03-19 02:06:32 +00:00
|
|
|
static QJsonDocument versionFileToJson(const VersionFilePtr &patch);
|
2016-03-07 01:01:28 +00:00
|
|
|
|
|
|
|
// libraries
|
2021-04-01 02:50:28 +01:00
|
|
|
static LibraryPtr libraryFromJson(ProblemContainer & problems, const QJsonObject &libObj, const QString &filename);
|
2016-03-07 01:01:28 +00:00
|
|
|
static QJsonObject libraryToJson(Library *library);
|
2016-02-28 18:01:54 +00:00
|
|
|
};
|