diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-05-11 12:37:21 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-06-09 01:38:30 +0200 |
commit | 69c3e7111f93290d1278d6116e9fd50079b4fe79 (patch) | |
tree | cbaed3022e8705f1da29777afea0fca16c1abe60 /logic/minecraft/RawLibrary.h | |
parent | 92abe4c603e1f4931cd02ae6b752cb7054d8e30d (diff) | |
download | MultiMC-69c3e7111f93290d1278d6116e9fd50079b4fe79.tar MultiMC-69c3e7111f93290d1278d6116e9fd50079b4fe79.tar.gz MultiMC-69c3e7111f93290d1278d6116e9fd50079b4fe79.tar.lz MultiMC-69c3e7111f93290d1278d6116e9fd50079b4fe79.tar.xz MultiMC-69c3e7111f93290d1278d6116e9fd50079b4fe79.zip |
Make 1.6+ work with new instance format.
Diffstat (limited to 'logic/minecraft/RawLibrary.h')
-rw-r--r-- | logic/minecraft/RawLibrary.h | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/logic/minecraft/RawLibrary.h b/logic/minecraft/RawLibrary.h index 46178d8e..f5a28c61 100644 --- a/logic/minecraft/RawLibrary.h +++ b/logic/minecraft/RawLibrary.h @@ -1,9 +1,14 @@ #pragma once #include <QString> #include <QPair> +#include <QList> +#include <QStringList> +#include <QMap> #include <memory> -#include "OneSixRule.h" +#include "logic/minecraft/OneSixRule.h" +#include "logic/minecraft/OpSys.h" +#include "logic/net/URLConstants.h" class RawLibrary; typedef std::shared_ptr<RawLibrary> RawLibraryPtr; @@ -11,24 +16,36 @@ typedef std::shared_ptr<RawLibrary> RawLibraryPtr; class RawLibrary { public: /* methods */ + /// read and create a basic library static RawLibraryPtr fromJson(const QJsonObject &libObj, const QString &filename); + /// read and create a MultiMC '+' library. Those have some extra fields. + static RawLibraryPtr fromJsonPlus(const QJsonObject &libObj, const QString &filename); + QJsonObject toJson(); + + QString fullname(); + QString version(); + QString group(); public: /* data */ - QString name; - QString url; - QString hint; - QString absoluteUrl; + QString m_name; + QString m_base_url = "https://" + URLConstants::LIBRARY_BASE; + /// type hint - modifies how the library is treated + QString m_hint; + /// absolute URL. takes precedence over m_download_path, if defined + QString m_absolute_url; bool applyExcludes = false; - QStringList excludes; + QStringList extract_excludes; - bool applyNatives = false; - QList<QPair<OpSys, QString>> natives; + /// Returns true if the library is native + bool isNative() const; + /// native suffixes per OS + QMap<OpSys, QString> m_native_suffixes; bool applyRules = false; - QList<std::shared_ptr<Rule>> rules; + QList<std::shared_ptr<Rule>> m_rules; - // user for '+' libraries + // used for '+' libraries enum InsertType { Apply, |