This commit is contained in:
2025-05-13 02:50:08 +03:00
parent 20b4502be5
commit 9af2bb814e
102 changed files with 259423 additions and 2 deletions
+49
View File
@@ -0,0 +1,49 @@
#ifndef InputArchive_h__
#define InputArchive_h__
#include "Archive.h"
#include "Object.h"
#include <vector>
#include <cstdint>
#include <algorithm>
#include <fstream>
class InputArchive : public Archive {
public:
InputArchive(std::shared_ptr<std::istream> stream)
:_stream(stream) {
}
virtual bool is_loading() const override {
return true;
}
virtual void serialize(void* data, size_t size) override {
_stream->read(reinterpret_cast<char*>(data), size);
if(!_stream)
{
}
}
size_type get_offset() const override
{
return _stream->tellg();
}
void set_offset(size_type offset) override {
_stream->seekg(offset, std::ios::beg);
}
~InputArchive() {}
std::shared_ptr<std::istream> GetStream(){
return _stream;
}
private:
std::shared_ptr<std::istream> _stream;
};
#endif // InputArchive_h__