|
|
@ -16,6 +16,10 @@ std::u8string BufferToU8String(std::span<const u8> buffer) {
|
|
|
|
return std::u8string{buffer.begin(), std::ranges::find(buffer, u8{0})};
|
|
|
|
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) {
|
|
|
|
std::string ToUTF8String(std::u8string_view u8_string) {
|
|
|
|
return std::string{u8_string.begin(), u8_string.end()};
|
|
|
|
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})};
|
|
|
|
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) {
|
|
|
|
std::string PathToUTF8String(const std::filesystem::path& path) {
|
|
|
|
return ToUTF8String(path.u8string());
|
|
|
|
return ToUTF8String(path.u8string());
|
|
|
|
}
|
|
|
|
}
|
|
|
|