diff options
Diffstat (limited to '')
-rw-r--r-- | src/common/string_util.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/common/string_util.h b/src/common/string_util.h index ce18a33cf..c351f1a0c 100644 --- a/src/common/string_util.h +++ b/src/common/string_util.h @@ -5,6 +5,7 @@ #pragma once #include <cstddef> +#include <span> #include <string> #include <vector> #include "common/common_types.h" @@ -17,7 +18,7 @@ namespace Common { /// Make a string uppercase [[nodiscard]] std::string ToUpper(std::string str); -[[nodiscard]] std::string StringFromBuffer(const std::vector<u8>& data); +[[nodiscard]] std::string StringFromBuffer(std::span<const u8> data); [[nodiscard]] std::string StripSpaces(const std::string& s); [[nodiscard]] std::string StripQuotes(const std::string& s); @@ -35,12 +36,12 @@ bool SplitPath(const std::string& full_path, std::string* _pPath, std::string* _ [[nodiscard]] std::string ReplaceAll(std::string result, const std::string& src, const std::string& dest); -[[nodiscard]] std::string UTF16ToUTF8(const std::u16string& input); -[[nodiscard]] std::u16string UTF8ToUTF16(const std::string& input); +[[nodiscard]] std::string UTF16ToUTF8(std::u16string_view input); +[[nodiscard]] std::u16string UTF8ToUTF16(std::string_view input); #ifdef _WIN32 -[[nodiscard]] std::string UTF16ToUTF8(const std::wstring& input); -[[nodiscard]] std::wstring UTF8ToUTF16W(const std::string& str); +[[nodiscard]] std::string UTF16ToUTF8(std::wstring_view input); +[[nodiscard]] std::wstring UTF8ToUTF16W(std::string_view str); #endif |