#ifndef DATABASE_H #define DATABASE_H #include #include #include class ModEntry : public QObject { Q_OBJECT public: int m_id; QString m_archivePath; QString m_installedPath; ModEntry() : m_id{0} {} /* ModEntry(const ModEntry &other) : QObject() { m_id = other.m_id; m_archivePath = other.m_archivePath; m_installedPath = other.m_installedPath; } ModEntry &operator=(const ModEntry &other) { m_id = other.m_id; m_archivePath = other.m_archivePath; m_installedPath = other.m_installedPath; return *this; } */ }; class ModLibrary : public QObject { Q_OBJECT public: int m_id; QString m_filename; QList m_entries; ModLibrary() : m_id{0} {} ~ModLibrary() { for( ModEntry *ent : m_entries ) ent->deleteLater(); } /* ModLibrary(const ModLibrary &other) : QObject() { m_id = other.m_id; m_filename = other.m_filename; m_entries = other.m_entries; } ModLibrary &operator=(const ModLibrary &other) { m_id = other.m_id; m_filename = other.m_filename; m_entries = other.m_entries; return *this; } friend bool operator<(const ModLibrary &a, const ModLibrary &b) { return a.m_id < b.m_id; } */ }; class Database : public QObject { Q_OBJECT bool m_open; QSqlDatabase m_database; QStringList m_overrides; public: explicit Database(QObject *parent = nullptr); //~Database(); void setDatabase(QSqlDatabase &db); bool open(const QString &dbpath); void readOverrides(); QList archiveList(int profileId); QStringList proxyList(int profileId); QList modManifest(int id); bool isProxyOverride(const QString &filepath); bool registerProxyOverride(const QString &filepath); bool unregisterProxyOverride(const QString &filepath); }; #endif // DATABASE_H