From 8f0dda5eab181b0f14f2652b4e984aaaae3f258c Mon Sep 17 00:00:00 2001 From: rtk0c Date: Mon, 27 Jun 2022 18:27:13 -0700 Subject: Start from a clean slate --- core/src/Utils/IO/TslArrayIntegration.hpp | 50 ------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 core/src/Utils/IO/TslArrayIntegration.hpp (limited to 'core/src/Utils/IO/TslArrayIntegration.hpp') diff --git a/core/src/Utils/IO/TslArrayIntegration.hpp b/core/src/Utils/IO/TslArrayIntegration.hpp deleted file mode 100644 index af1197c..0000000 --- a/core/src/Utils/IO/TslArrayIntegration.hpp +++ /dev/null @@ -1,50 +0,0 @@ -#pragma once - -#include "Utils/IO/DataStream.hpp" -#include "Utils/IO/Helper.hpp" -#include "Utils/IO/StringIntegration.hpp" - -#include -#include -#include -#include - -// TODO support custom key types - -namespace DataStreamAdapters { -template -struct TslArrayMap -{ - template - static void ReadFromDataStream(InputDataStream& stream, tsl::array_map& map) - { - static_assert(std::is_default_constructible_v); - static_assert(std::is_move_constructible_v); - - uint64_t size; - stream.Read(size); - map.reserve(size); - - for (uint64_t i = 0; i < size; ++i) { - std::string key; - stream.ReadObjectAdapted(key); - - TValue value; - ReadHelper(stream, value); - - map.insert(key, std::move(value)); - } - } - - template - static void WriteToDataStream(OutputDataStream& stream, const tsl::array_map& map) - { - stream.Write((uint64_t)map.size()); - - for (auto it = map.begin(); it != map.end(); ++it) { - stream.WriteObjectAdapted(it.key_sv()); - WriteHelper(stream, it.value()); - } - } -}; -} // namespace DataStreamAdapters -- cgit v1.2.3-70-g09d2