1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-05 19:31:04 +00:00

Introduce std::string_view into wider use (#14368)

This commit is contained in:
sfan5 2024-02-17 15:35:33 +01:00 committed by GitHub
parent fa47af737f
commit 6ca214fefc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
74 changed files with 501 additions and 456 deletions

View file

@ -53,7 +53,7 @@ public:
bool getStringToRef(const std::string &name, std::string &str, u16 recursion = 0) const;
// Returns whether the metadata was (potentially) changed.
virtual bool setString(const std::string &name, const std::string &var) = 0;
virtual bool setString(const std::string &name, std::string_view var) = 0;
inline bool removeString(const std::string &name) { return setString(name, ""); }
@ -89,7 +89,7 @@ public:
size_t size() const;
bool contains(const std::string &name) const override;
virtual bool setString(const std::string &name, const std::string &var) override;
virtual bool setString(const std::string &name, std::string_view var) override;
const StringMap &getStrings(StringMap *) const override final;
const std::vector<std::string> &getKeys(std::vector<std::string> *place)
const override final;