From 9497b7e96cfac6e60a53fe05c0ca945ecc839533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 28 Feb 2016 19:01:54 +0100 Subject: NOISSUE even more version file refactors There is no end to them in sight --- logic/minecraft/onesix/OneSixVersionFormat.h | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'logic/minecraft/onesix/OneSixVersionFormat.h') diff --git a/logic/minecraft/onesix/OneSixVersionFormat.h b/logic/minecraft/onesix/OneSixVersionFormat.h index ab21a6a0..9d16cced 100644 --- a/logic/minecraft/onesix/OneSixVersionFormat.h +++ b/logic/minecraft/onesix/OneSixVersionFormat.h @@ -2,10 +2,24 @@ #include #include +#include #include -namespace OneSixVersionFormat { - std::shared_ptr readProfileFromSingleFile(const QJsonObject &obj); - VersionFilePtr fromJson(const QJsonDocument &doc, const QString &filename, const bool requireOrder); - QJsonDocument toJson(const ProfilePatchPtr &patch, bool saveOrder); -} +class OneSixVersionFormat +{ +public: + // whole profiles from single file + static std::shared_ptr 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 RawLibraryPtr libraryFromJson(const QJsonObject &libObj, const QString &filename); + static QJsonObject libraryToJson(RawLibrary *library); + + // jar mods + static JarmodPtr jarModFromJson(const QJsonObject &libObj, const QString &filename, const QString &originalName); + static QJsonObject jarModtoJson(Jarmod * jarmod); +}; -- cgit v1.2.3