diff options
Diffstat (limited to 'api/logic/meta/Version.h')
-rw-r--r-- | api/logic/meta/Version.h | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/api/logic/meta/Version.h b/api/logic/meta/Version.h index 2f92ee9f..33bd5b35 100644 --- a/api/logic/meta/Version.h +++ b/api/logic/meta/Version.h @@ -1,4 +1,4 @@ -/* Copyright 2015-2017 MultiMC Contributors +/* Copyright 2015-2018 MultiMC Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,6 +28,8 @@ #include "multimc_logic_export.h" +#include "JsonFormat.h" + namespace Meta { using VersionPtr = std::shared_ptr<class Version>; @@ -48,10 +50,6 @@ public: /* con/des */ { return m_uid; } - QString parentUid() const - { - return m_parentUid; - } QString version() const { return m_version; @@ -65,7 +63,7 @@ public: /* con/des */ { return m_time; } - const QHash<QString, QString> &requires() const + const Meta::RequireSet &requires() const { return m_requires; } @@ -77,17 +75,22 @@ public: /* con/des */ { return m_recommended; } + bool isLoaded() const + { + return m_data != nullptr; + } - void merge(const std::shared_ptr<BaseEntity> &other) override; + void merge(const VersionPtr &other); + void mergeFromList(const VersionPtr &other); void parse(const QJsonObject &obj) override; QString localFilename() const override; public: // for usage by format parsers only - void setParentUid(const QString &parentUid); void setType(const QString &type); void setTime(const qint64 time); - void setRequires(const QHash<QString, QString> &requires); + void setRequires(const Meta::RequireSet &requires, const Meta::RequireSet &conflicts); + void setVolatile(bool volatile_); void setRecommended(bool recommended); void setProvidesRecommendations(); void setData(const VersionFilePtr &data); @@ -102,11 +105,12 @@ private: bool m_recommended = false; QString m_name; QString m_uid; - QString m_parentUid; QString m_version; QString m_type; qint64 m_time = 0; - QHash<QString, QString> m_requires; + Meta::RequireSet m_requires; + Meta::RequireSet m_conflicts; + bool m_volatile = false; VersionFilePtr m_data; }; } |