From f7abb9021e071abee27b0fba2c1ffe989be2003e Mon Sep 17 00:00:00 2001 From: rtk0c Date: Sat, 21 Aug 2021 19:12:02 -0700 Subject: DataArchive system which saves in native endian (for better performance working with local files), but is also able to load in any endian depending on archive's header information --- core/src/Utils/IO/Archive.hpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 core/src/Utils/IO/Archive.hpp (limited to 'core/src/Utils/IO/Archive.hpp') diff --git a/core/src/Utils/IO/Archive.hpp b/core/src/Utils/IO/Archive.hpp new file mode 100644 index 0000000..72f79c6 --- /dev/null +++ b/core/src/Utils/IO/Archive.hpp @@ -0,0 +1,22 @@ +#pragma once + +#include "Utils/IO/DataStream.hpp" + +#include +#include + +class DataArchive +{ +private: + DataStream mStream; + +public: + static std::optional SaveFile(const std::filesystem::path& path); + static std::optional LoadFile(const std::filesystem::path& path); + + const DataStream& GetStream()const; + DataStream& GetStream(); + +private: + DataArchive(DataStream stream); +}; -- cgit v1.2.3-70-g09d2