1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-22 17:18:39 +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

@ -19,12 +19,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#pragma once
#include <set>
#include <string>
#include <string_view>
#include <vector>
#include "irr_v3d.h"
#include "irrlichttypes.h"
#include "util/basic_macros.h"
#include "util/string.h"
class Database
@ -40,7 +39,7 @@ class MapDatabase : public Database
public:
virtual ~MapDatabase() = default;
virtual bool saveBlock(const v3s16 &pos, const std::string &data) = 0;
virtual bool saveBlock(const v3s16 &pos, std::string_view data) = 0;
virtual void loadBlock(const v3s16 &pos, std::string *block) = 0;
virtual bool deleteBlock(const v3s16 &pos) = 0;
@ -97,7 +96,7 @@ public:
virtual bool getModEntry(const std::string &modname,
const std::string &key, std::string *value) = 0;
virtual bool setModEntry(const std::string &modname,
const std::string &key, const std::string &value) = 0;
const std::string &key, std::string_view value) = 0;
virtual bool removeModEntry(const std::string &modname, const std::string &key) = 0;
virtual bool removeModEntries(const std::string &modname) = 0;
virtual void listMods(std::vector<std::string> *res) = 0;