aboutsummaryrefslogtreecommitdiff
path: root/launcher/meta/JsonFormat.h
diff options
context:
space:
mode:
authorTheKodeToad <TheKodeToad@proton.me>2023-08-16 20:46:16 +0100
committerTheKodeToad <TheKodeToad@proton.me>2023-08-16 22:23:38 +0100
commit3e2733d840d24ce4f46b49bca0b8656d4d6e3d87 (patch)
tree386113207514b8071b0122b318c10439259ca83c /launcher/meta/JsonFormat.h
parent57430fd189aed592a170d597de61b3acabaaa43d (diff)
parentc88088c91a92a371a9bc2b7384c2897157772b7e (diff)
downloadPrismLauncher-3e2733d840d24ce4f46b49bca0b8656d4d6e3d87.tar.gz
PrismLauncher-3e2733d840d24ce4f46b49bca0b8656d4d6e3d87.tar.bz2
PrismLauncher-3e2733d840d24ce4f46b49bca0b8656d4d6e3d87.zip
Merge branch 'develop' into better-launch
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
Diffstat (limited to 'launcher/meta/JsonFormat.h')
-rw-r--r--launcher/meta/JsonFormat.h52
1 files changed, 17 insertions, 35 deletions
diff --git a/launcher/meta/JsonFormat.h b/launcher/meta/JsonFormat.h
index 63128a4e..d474bcc3 100644
--- a/launcher/meta/JsonFormat.h
+++ b/launcher/meta/JsonFormat.h
@@ -18,43 +18,25 @@
#include <QJsonObject>
#include <memory>
+#include <set>
#include "Exception.h"
#include "meta/BaseEntity.h"
-#include <set>
-namespace Meta
-{
+namespace Meta {
class Index;
class Version;
class VersionList;
-enum class MetadataVersion
-{
- Invalid = -1,
- InitialRelease = 1
-};
+enum class MetadataVersion { Invalid = -1, InitialRelease = 1 };
-class ParseException : public Exception
-{
-public:
+class ParseException : public Exception {
+ public:
using Exception::Exception;
};
-struct Require
-{
- bool operator==(const Require & rhs) const
- {
- return uid == rhs.uid;
- }
- bool operator<(const Require & rhs) const
- {
- return uid < rhs.uid;
- }
- bool deepEquals(const Require & rhs) const
- {
- return uid == rhs.uid
- && equalsVersion == rhs.equalsVersion
- && suggests == rhs.suggests;
- }
+struct Require {
+ bool operator==(const Require& rhs) const { return uid == rhs.uid; }
+ bool operator<(const Require& rhs) const { return uid < rhs.uid; }
+ bool deepEquals(const Require& rhs) const { return uid == rhs.uid && equalsVersion == rhs.equalsVersion && suggests == rhs.suggests; }
QString uid;
QString equalsVersion;
QString suggests;
@@ -62,17 +44,17 @@ struct Require
using RequireSet = std::set<Require>;
-void parseIndex(const QJsonObject &obj, Index *ptr);
-void parseVersion(const QJsonObject &obj, Version *ptr);
-void parseVersionList(const QJsonObject &obj, VersionList *ptr);
+void parseIndex(const QJsonObject& obj, Index* ptr);
+void parseVersion(const QJsonObject& obj, Version* ptr);
+void parseVersionList(const QJsonObject& obj, VersionList* ptr);
-MetadataVersion parseFormatVersion(const QJsonObject &obj, bool required = true);
-void serializeFormatVersion(QJsonObject &obj, MetadataVersion version);
+MetadataVersion parseFormatVersion(const QJsonObject& obj, bool required = true);
+void serializeFormatVersion(QJsonObject& obj, MetadataVersion version);
// FIXME: this has a different shape than the others...FIX IT!?
-void parseRequires(const QJsonObject &obj, RequireSet * ptr, const char * keyName = "requires");
-void serializeRequires(QJsonObject & objOut, RequireSet* ptr, const char * keyName = "requires");
+void parseRequires(const QJsonObject& obj, RequireSet* ptr, const char* keyName = "requires");
+void serializeRequires(QJsonObject& objOut, RequireSet* ptr, const char* keyName = "requires");
MetadataVersion currentFormatVersion();
-}
+} // namespace Meta
Q_DECLARE_METATYPE(std::set<Meta::Require>)