summaryrefslogtreecommitdiffstats
path: root/src/common/fs/fs_util.cpp
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2022-02-14 00:53:21 +0100
committerMorph <39850852+Morph1984@users.noreply.github.com>2022-02-14 00:53:21 +0100
commit4390370a19190ba2223739bd4d98b460d0e680a8 (patch)
treee4249df78ef8c542cea1d51e8febc1f0e9800c7a /src/common/fs/fs_util.cpp
parentMerge pull request #7887 from lat9nq/stub-is-usb-full-key (diff)
downloadyuzu-4390370a19190ba2223739bd4d98b460d0e680a8.tar
yuzu-4390370a19190ba2223739bd4d98b460d0e680a8.tar.gz
yuzu-4390370a19190ba2223739bd4d98b460d0e680a8.tar.bz2
yuzu-4390370a19190ba2223739bd4d98b460d0e680a8.tar.lz
yuzu-4390370a19190ba2223739bd4d98b460d0e680a8.tar.xz
yuzu-4390370a19190ba2223739bd4d98b460d0e680a8.tar.zst
yuzu-4390370a19190ba2223739bd4d98b460d0e680a8.zip
Diffstat (limited to '')
-rw-r--r--src/common/fs/fs_util.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/common/fs/fs_util.cpp b/src/common/fs/fs_util.cpp
index 9f8671982..0068112e6 100644
--- a/src/common/fs/fs_util.cpp
+++ b/src/common/fs/fs_util.cpp
@@ -16,6 +16,10 @@ std::u8string BufferToU8String(std::span<const u8> buffer) {
return std::u8string{buffer.begin(), std::ranges::find(buffer, u8{0})};
}
+std::u8string_view BufferToU8StringView(std::span<const u8> buffer) {
+ return std::u8string_view{reinterpret_cast<const char8_t*>(buffer.data())};
+}
+
std::string ToUTF8String(std::u8string_view u8_string) {
return std::string{u8_string.begin(), u8_string.end()};
}
@@ -24,6 +28,10 @@ std::string BufferToUTF8String(std::span<const u8> buffer) {
return std::string{buffer.begin(), std::ranges::find(buffer, u8{0})};
}
+std::string_view BufferToUTF8StringView(std::span<const u8> buffer) {
+ return std::string_view{reinterpret_cast<const char*>(buffer.data())};
+}
+
std::string PathToUTF8String(const std::filesystem::path& path) {
return ToUTF8String(path.u8string());
}