From 0c9fb987a13418a03f32094694077d48c799e3c7 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Fri, 25 Oct 2024 13:30:12 +0300 Subject: [PATCH] update files::write_string signature --- src/files/files.cpp | 2 +- src/files/files.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/files/files.cpp b/src/files/files.cpp index 985cd2ba..f7d3f460 100644 --- a/src/files/files.cpp +++ b/src/files/files.cpp @@ -110,7 +110,7 @@ std::string files::read_string(const fs::path& filename) { return std::string((const char*)bytes.get(), size); } -bool files::write_string(const fs::path& filename, const std::string content) { +bool files::write_string(const fs::path& filename, std::string_view content) { std::ofstream file(filename); if (!file) { return false; diff --git a/src/files/files.hpp b/src/files/files.hpp index 99ccc936..4cf509d4 100644 --- a/src/files/files.hpp +++ b/src/files/files.hpp @@ -38,7 +38,7 @@ namespace files { uint append_bytes(const fs::path& file, const ubyte* data, size_t size); /// @brief Write string to the file - bool write_string(const fs::path& filename, const std::string content); + bool write_string(const fs::path& filename, std::string_view content); /// @brief Write dynamic data to the JSON file /// @param nice if true, human readable format will be used, otherwise