From 1d468ac35ad88d8c77cc83f25e3704d9bd7df01b Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Wed, 2 Aug 2023 18:35:35 +0200 Subject: chore: reformat Signed-off-by: Sefa Eyeoglu --- launcher/meta/JsonFormat.h | 52 +++++++++++++++------------------------------- 1 file changed, 17 insertions(+), 35 deletions(-) (limited to 'launcher/meta/JsonFormat.h') 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 #include +#include #include "Exception.h" #include "meta/BaseEntity.h" -#include -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; -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) -- cgit