PrismLauncher/launcher/modplatform/legacy_ftb/PrivatePackManager.h
Sefa Eyeoglu 1d468ac35a
chore: reformat
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2023-08-02 18:35:35 +02:00

34 lines
702 B
C++

#pragma once
#include <QFile>
#include <QSet>
#include <QString>
namespace LegacyFTB {
class 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;
};
} // namespace LegacyFTB