Introduce path_key util

It represents a canonical path that can be used as key
for unordered containers
This commit is contained in:
momo5502
2025-01-13 19:00:01 +01:00
parent fa5cc9c049
commit b76dc7cf24
4 changed files with 84 additions and 18 deletions

View File

@@ -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>();
}
}