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