mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add MetaDataRef:get_keys (#12841)
This commit is contained in:
parent
1a045da0dd
commit
cd8a7fe472
20 changed files with 125 additions and 0 deletions
|
@ -396,6 +396,21 @@ bool ModMetadataDatabaseFiles::getModEntries(const std::string &modname, StringM
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ModMetadataDatabaseFiles::getModKeys(const std::string &modname,
|
||||
std::vector<std::string> *storage)
|
||||
{
|
||||
Json::Value *meta = getOrCreateJson(modname);
|
||||
if (!meta)
|
||||
return false;
|
||||
|
||||
std::vector<std::string> keys = meta->getMemberNames();
|
||||
storage->reserve(storage->size() + keys.size());
|
||||
for (std::string &key : keys)
|
||||
storage->push_back(std::move(key));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ModMetadataDatabaseFiles::getModEntry(const std::string &modname,
|
||||
const std::string &key, std::string *value)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue