1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-13 16:45:20 +02:00

Use a database for mod storage (#11763)

This commit is contained in:
Jude Melton-Houghton
2022-01-07 13:28:49 -05:00
committed by GitHub
parent b81948a14c
commit bf22569019
21 changed files with 798 additions and 127 deletions

View File

@@ -25,6 +25,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "irr_v3d.h"
#include "irrlichttypes.h"
#include "util/basic_macros.h"
#include "util/string.h"
class Database
{
@@ -84,3 +85,15 @@ public:
virtual void listNames(std::vector<std::string> &res) = 0;
virtual void reload() = 0;
};
class ModMetadataDatabase : public Database
{
public:
virtual ~ModMetadataDatabase() = default;
virtual bool getModEntries(const std::string &modname, StringMap *storage) = 0;
virtual bool setModEntry(const std::string &modname,
const std::string &key, const std::string &value) = 0;
virtual bool removeModEntry(const std::string &modname, const std::string &key) = 0;
virtual void listMods(std::vector<std::string> *res) = 0;
};