1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-12 16:15: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

@@ -31,6 +31,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "config.h"
#include "metadata.h"
class ModMetadataDatabase;
#define MODNAME_ALLOWED_CHARS "abcdefghijklmnopqrstuvwxyz0123456789_"
struct ModSpec
@@ -149,20 +151,16 @@ class ModMetadata : public Metadata
{
public:
ModMetadata() = delete;
ModMetadata(const std::string &mod_name);
ModMetadata(const std::string &mod_name, ModMetadataDatabase *database);
~ModMetadata() = default;
virtual void clear();
bool save(const std::string &root_path);
bool load(const std::string &root_path);
bool isModified() const { return m_modified; }
const std::string &getModName() const { return m_mod_name; }
virtual bool setString(const std::string &name, const std::string &var);
private:
std::string m_mod_name;
bool m_modified = false;
ModMetadataDatabase *m_database;
};