diff options
author | rtk0c <[email protected]> | 2021-08-21 19:12:02 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2021-08-21 19:12:02 -0700 |
commit | f7abb9021e071abee27b0fba2c1ffe989be2003e (patch) | |
tree | ac66ce9cdb01decf0b735ab0fd54037c6882c8d6 /core/src/Utils/IO/Archive.hpp | |
parent | 16539032ceec2746aa3778b1c5db9e4485d274d0 (diff) |
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
Diffstat (limited to 'core/src/Utils/IO/Archive.hpp')
-rw-r--r-- | core/src/Utils/IO/Archive.hpp | 22 |
1 files changed, 22 insertions, 0 deletions
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 <filesystem> +#include <optional> + +class DataArchive +{ +private: + DataStream mStream; + +public: + static std::optional<DataArchive> SaveFile(const std::filesystem::path& path); + static std::optional<DataArchive> LoadFile(const std::filesystem::path& path); + + const DataStream& GetStream()const; + DataStream& GetStream(); + +private: + DataArchive(DataStream stream); +}; |