mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-26 23:11:01 +00:00
Introduce path_key util
It represents a canonical path that can be used as key for unordered containers
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
#include <chrono>
|
||||
#include <filesystem>
|
||||
#include <utils/path_key.hpp>
|
||||
|
||||
namespace utils
|
||||
{
|
||||
@@ -44,4 +45,14 @@ namespace utils
|
||||
{
|
||||
path = buffer.read_string<char16_t>();
|
||||
}
|
||||
|
||||
inline void serialize(buffer_serializer& buffer, const path_key& path)
|
||||
{
|
||||
buffer.write(path.get());
|
||||
}
|
||||
|
||||
inline void deserialize(buffer_deserializer& buffer, path_key& path)
|
||||
{
|
||||
path = buffer.read<std::filesystem::path>();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user