summaryrefslogtreecommitdiffstats
path: root/api/logic/modplatform/legacy_ftb/PrivatePackManager.h
diff options
context:
space:
mode:
Diffstat (limited to 'api/logic/modplatform/legacy_ftb/PrivatePackManager.h')
-rw-r--r--api/logic/modplatform/legacy_ftb/PrivatePackManager.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/api/logic/modplatform/legacy_ftb/PrivatePackManager.h b/api/logic/modplatform/legacy_ftb/PrivatePackManager.h
new file mode 100644
index 00000000..0232bac7
--- /dev/null
+++ b/api/logic/modplatform/legacy_ftb/PrivatePackManager.h
@@ -0,0 +1,44 @@
+#pragma once
+
+#include <QSet>
+#include <QString>
+#include <QFile>
+#include "multimc_logic_export.h"
+
+namespace LegacyFTB {
+
+class MULTIMC_LOGIC_EXPORT PrivatePackManager
+{
+public:
+ ~PrivatePackManager()
+ {
+ save();
+ }
+ void load();
+ void save() const;
+ bool empty() const
+ {
+ return currentPacks.empty();
+ }
+ const QSet<QString> &getCurrentPackCodes() const
+ {
+ return currentPacks;
+ }
+ void add(const QString &code)
+ {
+ currentPacks.insert(code);
+ dirty = true;
+ }
+ void remove(const QString &code)
+ {
+ currentPacks.remove(code);
+ dirty = true;
+ }
+
+private:
+ QSet<QString> currentPacks;
+ QString m_filename = "private_packs.txt";
+ mutable bool dirty = false;
+};
+
+}