mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-26 15:11:01 +00:00
add explicit 16bit unicode
This commit is contained in:
@@ -465,6 +465,12 @@ namespace utils
|
||||
object = this->read_string<wchar_t>();
|
||||
}
|
||||
|
||||
template <>
|
||||
inline void buffer_deserializer::read<std::u16string>(std::u16string& object)
|
||||
{
|
||||
object = this->read_string<char16_t>();
|
||||
}
|
||||
|
||||
template <>
|
||||
inline void buffer_serializer::write<bool>(const bool& object)
|
||||
{
|
||||
@@ -482,4 +488,10 @@ namespace utils
|
||||
{
|
||||
this->write_string(object);
|
||||
}
|
||||
|
||||
template <>
|
||||
inline void buffer_serializer::write<std::u16string>(const std::u16string& object)
|
||||
{
|
||||
this->write_string(object);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,10 +35,10 @@ inline void deserialize(utils::buffer_deserializer& buffer, std::chrono::system_
|
||||
|
||||
inline void serialize(utils::buffer_serializer& buffer, const std::filesystem::path& path)
|
||||
{
|
||||
buffer.write_string<wchar_t>(path.wstring());
|
||||
buffer.write_string<char16_t>(path.u16string());
|
||||
}
|
||||
|
||||
inline void deserialize(utils::buffer_deserializer& buffer, std::filesystem::path& path)
|
||||
{
|
||||
path = buffer.read_string<wchar_t>();
|
||||
path = buffer.read_string<char16_t>();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user