mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
Rename "mod metadata" to "mod storage" everywhere
This commit is contained in:
parent
8817af07fb
commit
7c21347a40
22 changed files with 480 additions and 474 deletions
|
@ -217,22 +217,22 @@ std::vector<ModSpec> flattenMods(const std::map<std::string, ModSpec> &mods)
|
|||
}
|
||||
|
||||
|
||||
ModMetadata::ModMetadata(const std::string &mod_name, ModMetadataDatabase *database):
|
||||
ModStorage::ModStorage(const std::string &mod_name, ModStorageDatabase *database):
|
||||
m_mod_name(mod_name), m_database(database)
|
||||
{
|
||||
}
|
||||
|
||||
void ModMetadata::clear()
|
||||
void ModStorage::clear()
|
||||
{
|
||||
m_database->removeModEntries(m_mod_name);
|
||||
}
|
||||
|
||||
bool ModMetadata::contains(const std::string &name) const
|
||||
bool ModStorage::contains(const std::string &name) const
|
||||
{
|
||||
return m_database->hasModEntry(m_mod_name, name);
|
||||
}
|
||||
|
||||
bool ModMetadata::setString(const std::string &name, const std::string &var)
|
||||
bool ModStorage::setString(const std::string &name, const std::string &var)
|
||||
{
|
||||
if (var.empty())
|
||||
return m_database->removeModEntry(m_mod_name, name);
|
||||
|
@ -240,21 +240,21 @@ bool ModMetadata::setString(const std::string &name, const std::string &var)
|
|||
return m_database->setModEntry(m_mod_name, name, var);
|
||||
}
|
||||
|
||||
const StringMap &ModMetadata::getStrings(StringMap *place) const
|
||||
const StringMap &ModStorage::getStrings(StringMap *place) const
|
||||
{
|
||||
place->clear();
|
||||
m_database->getModEntries(m_mod_name, place);
|
||||
return *place;
|
||||
}
|
||||
|
||||
const std::vector<std::string> &ModMetadata::getKeys(std::vector<std::string> *place) const
|
||||
const std::vector<std::string> &ModStorage::getKeys(std::vector<std::string> *place) const
|
||||
{
|
||||
place->clear();
|
||||
m_database->getModKeys(m_mod_name, place);
|
||||
return *place;
|
||||
}
|
||||
|
||||
const std::string *ModMetadata::getStringRaw(const std::string &name, std::string *place) const
|
||||
const std::string *ModStorage::getStringRaw(const std::string &name, std::string *place) const
|
||||
{
|
||||
return m_database->getModEntry(m_mod_name, name, place) ? place : nullptr;
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include "metadata.h"
|
||||
#include "subgames.h"
|
||||
|
||||
class ModMetadataDatabase;
|
||||
class ModStorageDatabase;
|
||||
|
||||
#define MODNAME_ALLOWED_CHARS "abcdefghijklmnopqrstuvwxyz0123456789_"
|
||||
|
||||
|
@ -110,12 +110,12 @@ std::map<std::string, ModSpec> getModsInPath(const std::string &path,
|
|||
std::vector<ModSpec> flattenMods(const std::map<std::string, ModSpec> &mods);
|
||||
|
||||
|
||||
class ModMetadata : public IMetadata
|
||||
class ModStorage : public IMetadata
|
||||
{
|
||||
public:
|
||||
ModMetadata() = delete;
|
||||
ModMetadata(const std::string &mod_name, ModMetadataDatabase *database);
|
||||
~ModMetadata() = default;
|
||||
ModStorage() = delete;
|
||||
ModStorage(const std::string &mod_name, ModStorageDatabase *database);
|
||||
~ModStorage() = default;
|
||||
|
||||
const std::string &getModName() const { return m_mod_name; }
|
||||
|
||||
|
@ -135,5 +135,5 @@ protected:
|
|||
|
||||
private:
|
||||
std::string m_mod_name;
|
||||
ModMetadataDatabase *m_database;
|
||||
ModStorageDatabase *m_database;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue