1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-06 17:41:04 +00:00

Add MetaDataRef:get_keys (#12841)

This commit is contained in:
Jude Melton-Houghton 2022-11-15 10:45:12 -05:00 committed by GitHub
parent 1a045da0dd
commit cd8a7fe472
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 125 additions and 0 deletions

View file

@ -60,6 +60,9 @@ public:
// May (not must!) put strings in `place` and return a reference to these strings.
virtual const StringMap &getStrings(StringMap *place) const = 0;
// May (not must!) put keys in `place` and return a reference to these keys.
virtual const std::vector<std::string> &getKeys(std::vector<std::string> *place) const = 0;
// Add support for variable names in values. Uses place like getString.
const std::string &resolveString(const std::string &str, std::string *place,
u16 recursion = 0) const;
@ -88,6 +91,8 @@ public:
bool contains(const std::string &name) const override;
virtual bool setString(const std::string &name, const std::string &var) override;
const StringMap &getStrings(StringMap *) const override final;
const std::vector<std::string> &getKeys(std::vector<std::string> *place)
const override final;
// Simple version of getters, possible due to in-memory storage: