summaryrefslogtreecommitdiffstats
path: root/logic/minecraft/onesix/OneSixVersionFormat.h
blob: 45a961e40fe04a24424e14fdb87ccbbb20dbeefe (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
25
#pragma once

#include <minecraft/VersionFile.h>
#include <minecraft/MinecraftProfile.h>
#include <minecraft/Library.h>
#include <QJsonDocument>

class OneSixVersionFormat
{
public:
	// whole profiles from single file
	static std::shared_ptr<MinecraftProfile> profileFromSingleJson(const QJsonObject &obj);

	// version files / profile patches
	static VersionFilePtr versionFileFromJson(const QJsonDocument &doc, const QString &filename, const bool requireOrder);
	static QJsonDocument profilePatchToJson(const ProfilePatchPtr &patch, bool saveOrder);

	// libraries
	static LibraryPtr libraryFromJson(const QJsonObject &libObj, const QString &filename);
	static QJsonObject libraryToJson(Library *library);

	// jar mods
	static JarmodPtr jarModFromJson(const QJsonObject &libObj, const QString &filename, const QString &originalName);
	static QJsonObject jarModtoJson(Jarmod * jarmod);
};