summaryrefslogtreecommitdiffstats
path: root/api/logic/meta/JsonFormat.h
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2017-12-29 00:37:14 +0100
committerPetr Mrázek <peterix@gmail.com>2017-12-29 00:37:14 +0100
commit719f3e863a2bdbaeaba37e837e0f6b75de124e6c (patch)
treebff005dd7e36b08d355bfec58742d44265fc0dd6 /api/logic/meta/JsonFormat.h
parent50ca6cbb4daaa4acd300defc6b7ecc7ccb46cebf (diff)
downloadMultiMC-719f3e863a2bdbaeaba37e837e0f6b75de124e6c.tar
MultiMC-719f3e863a2bdbaeaba37e837e0f6b75de124e6c.tar.gz
MultiMC-719f3e863a2bdbaeaba37e837e0f6b75de124e6c.tar.lz
MultiMC-719f3e863a2bdbaeaba37e837e0f6b75de124e6c.tar.xz
MultiMC-719f3e863a2bdbaeaba37e837e0f6b75de124e6c.zip
NOISSUE add versioning to component metadata format and use it
Diffstat (limited to 'api/logic/meta/JsonFormat.h')
-rw-r--r--api/logic/meta/JsonFormat.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/api/logic/meta/JsonFormat.h b/api/logic/meta/JsonFormat.h
index 9b9dcd91..82ab0ce3 100644
--- a/api/logic/meta/JsonFormat.h
+++ b/api/logic/meta/JsonFormat.h
@@ -28,6 +28,12 @@ class Index;
class Version;
class VersionList;
+enum class MetadataVersion
+{
+ Invalid = -1,
+ InitialRelease = 0
+};
+
class ParseException : public Exception
{
public:
@@ -65,9 +71,13 @@ 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);
+
// 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");
+MetadataVersion currentFormatVersion();
}
Q_DECLARE_METATYPE(std::set<Meta::Require>); \ No newline at end of file