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
|
|
|
|
2016-03-03 00:40:12 +00:00
|
|
|
#include "multimc_logic_export.h"
|
|
|
|
|
|
|
|
class MULTIMC_LOGIC_EXPORT MojangVersionFormat
|
2016-02-28 18:01:54 +00:00
|
|
|
{
|
2016-03-19 02:06:32 +00:00
|
|
|
friend class OneSixVersionFormat;
|
|
|
|
protected:
|
2018-07-15 13:51:05 +01: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 13:51:05 +01: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 13:51:05 +01:00
|
|
|
// libraries
|
2021-04-01 02:50:28 +01:00
|
|
|
static LibraryPtr libraryFromJson(ProblemContainer & problems, const QJsonObject &libObj, const QString &filename);
|
2018-07-15 13:51:05 +01:00
|
|
|
static QJsonObject libraryToJson(Library *library);
|
2016-02-28 18:01:54 +00:00
|
|
|
};
|