diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2022-02-14 00:53:21 +0100 |
---|---|---|
committer | Morph <39850852+Morph1984@users.noreply.github.com> | 2022-02-14 00:53:21 +0100 |
commit | 4390370a19190ba2223739bd4d98b460d0e680a8 (patch) | |
tree | e4249df78ef8c542cea1d51e8febc1f0e9800c7a /src/common/fs/fs_util.h | |
parent | Merge pull request #7887 from lat9nq/stub-is-usb-full-key (diff) | |
download | yuzu-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 'src/common/fs/fs_util.h')
-rw-r--r-- | src/common/fs/fs_util.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/common/fs/fs_util.h b/src/common/fs/fs_util.h index 1ec82eb35..1620d38c9 100644 --- a/src/common/fs/fs_util.h +++ b/src/common/fs/fs_util.h @@ -38,6 +38,15 @@ concept IsChar = std::same_as<T, char>; [[nodiscard]] std::u8string BufferToU8String(std::span<const u8> buffer); /** + * Same as BufferToU8String, but returns a string view of the buffer. + * + * @param buffer Buffer of bytes + * + * @returns UTF-8 encoded std::u8string_view. + */ +[[nodiscard]] std::u8string_view BufferToU8StringView(std::span<const u8> buffer); + +/** * Converts a std::u8string or std::u8string_view to a UTF-8 encoded std::string. * * @param u8_string UTF-8 encoded u8string @@ -58,6 +67,15 @@ concept IsChar = std::same_as<T, char>; [[nodiscard]] std::string BufferToUTF8String(std::span<const u8> buffer); /** + * Same as BufferToUTF8String, but returns a string view of the buffer. + * + * @param buffer Buffer of bytes + * + * @returns UTF-8 encoded std::string_view. + */ +[[nodiscard]] std::string_view BufferToUTF8StringView(std::span<const u8> buffer); + +/** * Converts a filesystem path to a UTF-8 encoded std::string. * * @param path Filesystem path |