diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-03-05 01:50:05 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-03-05 01:50:05 +0100 |
commit | 47bc7e5ee377dacfeb7cf3d13f07cfd24db906fb (patch) | |
tree | e48d886f3aa1a14854f3c79efda00590a2d987c3 /logic/VersionFile.h | |
parent | 6b76af116eabfa2a1c64e6eb7c9ad84fe7fc0bfe (diff) | |
download | MultiMC-47bc7e5ee377dacfeb7cf3d13f07cfd24db906fb.tar MultiMC-47bc7e5ee377dacfeb7cf3d13f07cfd24db906fb.tar.gz MultiMC-47bc7e5ee377dacfeb7cf3d13f07cfd24db906fb.tar.lz MultiMC-47bc7e5ee377dacfeb7cf3d13f07cfd24db906fb.tar.xz MultiMC-47bc7e5ee377dacfeb7cf3d13f07cfd24db906fb.zip |
More refactor.
Diffstat (limited to 'logic/VersionFile.h')
-rw-r--r-- | logic/VersionFile.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/logic/VersionFile.h b/logic/VersionFile.h index 0475f927..504fcbff 100644 --- a/logic/VersionFile.h +++ b/logic/VersionFile.h @@ -20,6 +20,8 @@ public: virtual ~VersionBuildError() {}; }; +struct RawLibrary; +typedef std::shared_ptr<RawLibrary> RawLibraryPtr; struct RawLibrary { QString name; @@ -50,17 +52,19 @@ struct RawLibrary }; DependType dependType = Soft; - static RawLibrary fromJson(const QJsonObject &libObj, const QString &filename); + static RawLibraryPtr fromJson(const QJsonObject &libObj, const QString &filename); }; +struct VersionFile; +typedef std::shared_ptr<VersionFile> VersionFilePtr; struct VersionFile { public: /* methods */ - static VersionFile fromJson(const QJsonDocument &doc, const QString &filename, + static VersionFilePtr fromJson(const QJsonDocument &doc, const QString &filename, const bool requireOrder, const bool isFTB = false); - static std::shared_ptr<OneSixLibrary> createLibrary(const RawLibrary &lib); - int findLibrary(QList<std::shared_ptr<OneSixLibrary>> haystack, const QString &needle); + static OneSixLibraryPtr createLibrary(RawLibraryPtr lib); + int findLibrary(QList<OneSixLibraryPtr> haystack, const QString &needle); void applyTo(VersionFinal *version); public: /* data */ @@ -91,7 +95,7 @@ public: /* data */ QStringList removeTweakers; bool shouldOverwriteLibs = false; - QList<RawLibrary> overwriteLibs; - QList<RawLibrary> addLibs; + QList<RawLibraryPtr> overwriteLibs; + QList<RawLibraryPtr> addLibs; QList<QString> removeLibs; };
\ No newline at end of file |