feat: add verion_type / release_type to IndexedVersion

Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
Rachel Powers
2023-05-26 13:50:22 -07:00
parent f24211e8b5
commit c156034069
5 changed files with 93 additions and 3 deletions

View File

@ -23,6 +23,7 @@
#include <QString>
#include <QVariant>
#include <QVector>
#include <optional>
class QIODevice;
@ -51,11 +52,34 @@ struct DonationData {
QString url;
};
struct IndexedVersionType {
enum class Enum {
Release = 1,
Beta,
Alpha,
UNKNOWN
};
IndexedVersionType(const QString& type);
IndexedVersionType(int type);
IndexedVersionType(const IndexedVersionType::Enum& type);
IndexedVersionType(const IndexedVersionType& type);
static const QString toString (const IndexedVersionType::Enum& type);
static const IndexedVersionType::Enum enumFromString(const QString& type);
bool isValid() const {return m_type != IndexedVersionType::Enum::UNKNOWN; }
bool operator==(const IndexedVersionType& other) const { return m_type == other.m_type; }
bool operator==(const IndexedVersionType::Enum& type) const { return m_type == type; }
bool operator<(const IndexedVersionType& other) const { return m_type < other.m_type; }
bool operator<(const IndexedVersionType::Enum& type) const { return m_type < type; }
IndexedVersionType::Enum m_type;
};
struct IndexedVersion {
QVariant addonId;
QVariant fileId;
QString version;
QString version_number = {};
std::optional<IndexedVersionType> verison_type = {};
QStringList mcVersion;
QString downloadUrl;
QString date;