Gvas: separate Binary{Reader,Writer}.
The functionality has been moved to BinaryIo::{Reader,Writer} to prepare for exporting build parts.
This commit is contained in:
parent
3bc750436f
commit
3c79f39046
50 changed files with 280 additions and 234 deletions
24
src/BinaryIo/BinaryIo.h
Normal file
24
src/BinaryIo/BinaryIo.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
#pragma once
|
||||
|
||||
// MassBuilderSaveTool
|
||||
// Copyright (C) 2021-2024 Guillaume Jacquemin
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
namespace BinaryIo {
|
||||
|
||||
class Reader;
|
||||
class Writer;
|
||||
|
||||
}
|
|
@ -21,11 +21,11 @@
|
|||
|
||||
#include "../Logger/Logger.h"
|
||||
|
||||
#include "BinaryReader.h"
|
||||
#include "Reader.h"
|
||||
|
||||
namespace Gvas {
|
||||
namespace BinaryIo {
|
||||
|
||||
BinaryReader::BinaryReader(Containers::StringView filename) {
|
||||
Reader::Reader(Containers::StringView filename) {
|
||||
_file = std::fopen(filename.data(), "rb");
|
||||
|
||||
if(!_file) {
|
||||
|
@ -33,93 +33,93 @@ BinaryReader::BinaryReader(Containers::StringView filename) {
|
|||
}
|
||||
}
|
||||
|
||||
BinaryReader::~BinaryReader() {
|
||||
Reader::~Reader() {
|
||||
closeFile();
|
||||
}
|
||||
|
||||
bool
|
||||
BinaryReader::open() {
|
||||
Reader::open() {
|
||||
return _file;
|
||||
}
|
||||
|
||||
bool
|
||||
BinaryReader::eof() {
|
||||
Reader::eof() {
|
||||
return std::feof(_file) != 0;
|
||||
}
|
||||
|
||||
std::int64_t
|
||||
BinaryReader::position() {
|
||||
Reader::position() {
|
||||
return _ftelli64(_file);
|
||||
}
|
||||
|
||||
bool
|
||||
BinaryReader::seek(std::int64_t position) {
|
||||
Reader::seek(std::int64_t position) {
|
||||
return _fseeki64(_file, position, SEEK_SET) == 0;
|
||||
}
|
||||
|
||||
void
|
||||
BinaryReader::closeFile() {
|
||||
Reader::closeFile() {
|
||||
std::fclose(_file);
|
||||
_file = nullptr;
|
||||
}
|
||||
|
||||
bool
|
||||
BinaryReader::readChar(char& value) {
|
||||
Reader::readChar(char& value) {
|
||||
return std::fread(&value, sizeof(char), 1, _file) == 1;
|
||||
}
|
||||
|
||||
bool
|
||||
BinaryReader::readInt8(std::int8_t& value) {
|
||||
Reader::readInt8(std::int8_t& value) {
|
||||
return std::fread(&value, sizeof(std::int8_t), 1, _file) == 1;
|
||||
}
|
||||
|
||||
bool
|
||||
BinaryReader::readUint8(std::uint8_t& value) {
|
||||
Reader::readUint8(std::uint8_t& value) {
|
||||
return std::fread(&value, sizeof(std::uint8_t), 1, _file) == 1;
|
||||
}
|
||||
|
||||
bool
|
||||
BinaryReader::readInt16(std::int16_t& value) {
|
||||
Reader::readInt16(std::int16_t& value) {
|
||||
return std::fread(&value, sizeof(std::int16_t), 1, _file) == 1;
|
||||
}
|
||||
|
||||
bool
|
||||
BinaryReader::readUint16(std::uint16_t& value) {
|
||||
Reader::readUint16(std::uint16_t& value) {
|
||||
return std::fread(&value, sizeof(std::uint16_t), 1, _file) == 1;
|
||||
}
|
||||
|
||||
bool
|
||||
BinaryReader::readInt32(std::int32_t& value) {
|
||||
Reader::readInt32(std::int32_t& value) {
|
||||
return std::fread(&value, sizeof(std::int32_t), 1, _file) == 1;
|
||||
}
|
||||
|
||||
bool
|
||||
BinaryReader::readUint32(std::uint32_t& value) {
|
||||
Reader::readUint32(std::uint32_t& value) {
|
||||
return std::fread(&value, sizeof(std::uint32_t), 1, _file) == 1;
|
||||
}
|
||||
|
||||
bool
|
||||
BinaryReader::readInt64(std::int64_t& value) {
|
||||
Reader::readInt64(std::int64_t& value) {
|
||||
return std::fread(&value, sizeof(std::int64_t), 1, _file) == 1;
|
||||
}
|
||||
|
||||
bool
|
||||
BinaryReader::readUint64(std::uint64_t& value) {
|
||||
Reader::readUint64(std::uint64_t& value) {
|
||||
return std::fread(&value, sizeof(std::uint64_t), 1, _file) == 1;
|
||||
}
|
||||
|
||||
bool
|
||||
BinaryReader::readFloat(float& value) {
|
||||
Reader::readFloat(float& value) {
|
||||
return std::fread(&value, sizeof(float), 1, _file) == 1;
|
||||
}
|
||||
|
||||
bool
|
||||
BinaryReader::readDouble(double& value) {
|
||||
Reader::readDouble(double& value) {
|
||||
return std::fread(&value, sizeof(double), 1, _file) == 1;
|
||||
}
|
||||
|
||||
bool
|
||||
BinaryReader::readArray(Containers::Array<char>& array, std::size_t count) {
|
||||
Reader::readArray(Containers::Array<char>& array, std::size_t count) {
|
||||
if(array.size() < count) {
|
||||
array = Containers::Array<char>{ValueInit, count};
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ BinaryReader::readArray(Containers::Array<char>& array, std::size_t count) {
|
|||
}
|
||||
|
||||
bool
|
||||
BinaryReader::readUEString(Containers::String& str) {
|
||||
Reader::readUEString(Containers::String& str) {
|
||||
std::uint32_t length = 0;
|
||||
if(!readUint32(length) || length == 0) {
|
||||
return false;
|
||||
|
@ -140,7 +140,7 @@ BinaryReader::readUEString(Containers::String& str) {
|
|||
}
|
||||
|
||||
std::int32_t
|
||||
BinaryReader::peekChar() {
|
||||
Reader::peekChar() {
|
||||
std::int32_t c;
|
||||
c = std::fgetc(_file);
|
||||
std::ungetc(c, _file);
|
|
@ -25,12 +25,18 @@
|
|||
|
||||
using namespace Corrade;
|
||||
|
||||
namespace Gvas {
|
||||
namespace BinaryIo {
|
||||
|
||||
class BinaryReader {
|
||||
class Reader {
|
||||
public:
|
||||
explicit BinaryReader(Containers::StringView filename);
|
||||
~BinaryReader();
|
||||
explicit Reader(Containers::StringView filename);
|
||||
~Reader();
|
||||
|
||||
Reader(const Reader& other) = delete;
|
||||
Reader& operator=(const Reader& other) = delete;
|
||||
|
||||
Reader(Reader&& other) = default;
|
||||
Reader& operator=(Reader&& other) = default;
|
||||
|
||||
bool open();
|
||||
bool eof();
|
|
@ -18,52 +18,52 @@
|
|||
|
||||
#include "../Logger/Logger.h"
|
||||
|
||||
#include "BinaryWriter.h"
|
||||
#include "Writer.h"
|
||||
|
||||
using namespace Containers::Literals;
|
||||
|
||||
namespace Gvas {
|
||||
namespace BinaryIo {
|
||||
|
||||
BinaryWriter::BinaryWriter(Containers::StringView filename) {
|
||||
Writer::Writer(Containers::StringView filename) {
|
||||
_file = std::fopen(filename.data(), "wb");
|
||||
if(!_file) {
|
||||
LOG_ERROR_FORMAT("Couldn't open {} for reading: {}", filename, std::strerror(errno));
|
||||
}
|
||||
}
|
||||
|
||||
BinaryWriter::~BinaryWriter() {
|
||||
Writer::~Writer() {
|
||||
closeFile();
|
||||
}
|
||||
|
||||
bool
|
||||
BinaryWriter::open() {
|
||||
Writer::open() {
|
||||
return _file;
|
||||
}
|
||||
|
||||
void
|
||||
BinaryWriter::closeFile() {
|
||||
Writer::closeFile() {
|
||||
std::fflush(_file);
|
||||
std::fclose(_file);
|
||||
_file = nullptr;
|
||||
}
|
||||
|
||||
std::int64_t
|
||||
BinaryWriter::position() {
|
||||
Writer::position() {
|
||||
return _ftelli64(_file);
|
||||
}
|
||||
|
||||
Containers::ArrayView<const char>
|
||||
BinaryWriter::array() const {
|
||||
Writer::array() const {
|
||||
return _data;
|
||||
}
|
||||
|
||||
std::size_t
|
||||
BinaryWriter::arrayPosition() const {
|
||||
Writer::arrayPosition() const {
|
||||
return _index;
|
||||
}
|
||||
|
||||
bool
|
||||
BinaryWriter::flushToFile() {
|
||||
Writer::flushToFile() {
|
||||
bool ret = writeArray(_data);
|
||||
std::fflush(_file);
|
||||
_data = Containers::Array<char>{};
|
||||
|
@ -72,62 +72,62 @@ BinaryWriter::flushToFile() {
|
|||
}
|
||||
|
||||
bool
|
||||
BinaryWriter::writeChar(char value) {
|
||||
Writer::writeChar(char value) {
|
||||
return std::fwrite(&value, sizeof(char), 1, _file) == 1;
|
||||
}
|
||||
|
||||
bool
|
||||
BinaryWriter::writeInt8(std::int8_t value) {
|
||||
Writer::writeInt8(std::int8_t value) {
|
||||
return std::fwrite(&value, sizeof(std::int8_t), 1, _file) == 1;
|
||||
}
|
||||
|
||||
bool
|
||||
BinaryWriter::writeUint8(std::uint8_t value) {
|
||||
Writer::writeUint8(std::uint8_t value) {
|
||||
return std::fwrite(&value, sizeof(std::uint8_t), 1, _file) == 1;
|
||||
}
|
||||
|
||||
bool
|
||||
BinaryWriter::writeInt16(std::int16_t value) {
|
||||
Writer::writeInt16(std::int16_t value) {
|
||||
return std::fwrite(&value, sizeof(std::int16_t), 1, _file) == 1;
|
||||
}
|
||||
|
||||
bool
|
||||
BinaryWriter::writeUint16(std::uint16_t value) {
|
||||
Writer::writeUint16(std::uint16_t value) {
|
||||
return std::fwrite(&value, sizeof(std::uint16_t), 1, _file) == 1;
|
||||
}
|
||||
|
||||
bool
|
||||
BinaryWriter::writeInt32(std::int32_t value) {
|
||||
Writer::writeInt32(std::int32_t value) {
|
||||
return std::fwrite(&value, sizeof(std::int32_t), 1, _file) == 1;
|
||||
}
|
||||
|
||||
bool
|
||||
BinaryWriter::writeUint32(std::uint32_t value) {
|
||||
Writer::writeUint32(std::uint32_t value) {
|
||||
return std::fwrite(&value, sizeof(std::uint32_t), 1, _file) == 1;
|
||||
}
|
||||
|
||||
bool
|
||||
BinaryWriter::writeInt64(std::int64_t value) {
|
||||
Writer::writeInt64(std::int64_t value) {
|
||||
return std::fwrite(&value, sizeof(std::int64_t), 1, _file) == 1;
|
||||
}
|
||||
|
||||
bool
|
||||
BinaryWriter::writeUint64(std::uint64_t value) {
|
||||
Writer::writeUint64(std::uint64_t value) {
|
||||
return std::fwrite(&value, sizeof(std::uint64_t), 1, _file) == 1;
|
||||
}
|
||||
|
||||
bool
|
||||
BinaryWriter::writeFloat(float value) {
|
||||
Writer::writeFloat(float value) {
|
||||
return std::fwrite(&value, sizeof(float), 1, _file) == 1;
|
||||
}
|
||||
|
||||
bool
|
||||
BinaryWriter::writeDouble(double value) {
|
||||
Writer::writeDouble(double value) {
|
||||
return std::fwrite(&value, sizeof(double), 1, _file) == 1;
|
||||
}
|
||||
|
||||
bool
|
||||
BinaryWriter::writeArray(Containers::ArrayView<const char> array) {
|
||||
Writer::writeArray(Containers::ArrayView<const char> array) {
|
||||
if(array.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ BinaryWriter::writeArray(Containers::ArrayView<const char> array) {
|
|||
}
|
||||
|
||||
bool
|
||||
BinaryWriter::writeUEString(Containers::StringView str) {
|
||||
Writer::writeUEString(Containers::StringView str) {
|
||||
if(str.size() > UINT32_MAX) {
|
||||
LOG_ERROR_FORMAT("String is too big. Expected size() < UINT32_MAX, got {} instead.", str.size());
|
||||
return false;
|
||||
|
@ -154,7 +154,7 @@ BinaryWriter::writeUEString(Containers::StringView str) {
|
|||
}
|
||||
|
||||
std::size_t
|
||||
BinaryWriter::writeUEStringToArray(Containers::StringView value) {
|
||||
Writer::writeUEStringToArray(Containers::StringView value) {
|
||||
return writeValueToArray<std::uint32_t>(std::uint32_t(value.size()) + 1u) +
|
||||
writeDataToArray(Containers::ArrayView<const char>{value}) +
|
||||
writeValueToArray<char>('\0');
|
|
@ -26,18 +26,18 @@
|
|||
|
||||
using namespace Corrade;
|
||||
|
||||
namespace Gvas {
|
||||
namespace BinaryIo {
|
||||
|
||||
class BinaryWriter {
|
||||
class Writer {
|
||||
public:
|
||||
explicit BinaryWriter(Containers::StringView filename);
|
||||
~BinaryWriter();
|
||||
explicit Writer(Containers::StringView filename);
|
||||
~Writer();
|
||||
|
||||
BinaryWriter(const BinaryWriter& other) = delete;
|
||||
BinaryWriter& operator=(const BinaryWriter& other) = delete;
|
||||
Writer(const Writer& other) = delete;
|
||||
Writer& operator=(const Writer& other) = delete;
|
||||
|
||||
BinaryWriter(BinaryWriter&& other) = default;
|
||||
BinaryWriter& operator=(BinaryWriter&& other) = default;
|
||||
Writer(Writer&& other) = default;
|
||||
Writer& operator=(Writer&& other) = default;
|
||||
|
||||
bool open();
|
||||
|
|
@ -44,6 +44,14 @@ set(Logger_SOURCES
|
|||
Logger/MagnumLogBuffer.cpp
|
||||
)
|
||||
|
||||
set(BinaryIo_SOURCES
|
||||
BinaryIo/BinaryIo.h
|
||||
BinaryIo/Reader.h
|
||||
BinaryIo/Reader.cpp
|
||||
BinaryIo/Writer.h
|
||||
BinaryIo/Writer.cpp
|
||||
)
|
||||
|
||||
set(Gvas_SOURCES
|
||||
Gvas/Serialisers/Serialisers.h
|
||||
Gvas/Serialisers/AbstractUnrealCollectionProperty.h
|
||||
|
@ -189,6 +197,7 @@ add_executable(MassBuilderSaveTool
|
|||
FontAwesome/IconsFontAwesome5.h
|
||||
FontAwesome/IconsFontAwesome5Brands.h
|
||||
${Logger_SOURCES}
|
||||
${BinaryIo_SOURCES}
|
||||
${Gvas_SOURCES}
|
||||
${SAVETOOL_RC_FILE}
|
||||
${Assets}
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
|
||||
#include "../Logger/Logger.h"
|
||||
|
||||
#include "BinaryReader.h"
|
||||
#include "BinaryWriter.h"
|
||||
#include "../BinaryIo/Reader.h"
|
||||
#include "../BinaryIo/Writer.h"
|
||||
|
||||
#include "File.h"
|
||||
|
||||
|
@ -87,7 +87,7 @@ File::saveToFile() {
|
|||
return false;
|
||||
}
|
||||
|
||||
BinaryWriter writer{_filepath + ".tmp"_s};
|
||||
BinaryIo::Writer writer{_filepath + ".tmp"_s};
|
||||
|
||||
if(!writer.open()) {
|
||||
_lastError = "Couldn't open the file for saving."_s;
|
||||
|
@ -175,7 +175,7 @@ File::loadData() {
|
|||
return;
|
||||
}
|
||||
|
||||
BinaryReader reader{_filepath};
|
||||
BinaryIo::Reader reader{_filepath};
|
||||
|
||||
if(!reader.open()) {
|
||||
_lastError = _filepath + " couldn't be opened."_s;
|
||||
|
|
|
@ -18,8 +18,6 @@
|
|||
|
||||
namespace Gvas {
|
||||
|
||||
class BinaryReader;
|
||||
class BinaryWriter;
|
||||
class File;
|
||||
class PropertySerialiser;
|
||||
|
||||
|
|
|
@ -39,8 +39,8 @@
|
|||
|
||||
#include "Types/NoneProperty.h"
|
||||
|
||||
#include "BinaryReader.h"
|
||||
#include "BinaryWriter.h"
|
||||
#include "../BinaryIo/Reader.h"
|
||||
#include "../BinaryIo/Writer.h"
|
||||
|
||||
#include "PropertySerialiser.h"
|
||||
|
||||
|
@ -76,7 +76,7 @@ PropertySerialiser::instance() {
|
|||
}
|
||||
|
||||
Types::UnrealPropertyBase::ptr
|
||||
PropertySerialiser::read(BinaryReader& reader) {
|
||||
PropertySerialiser::read(BinaryIo::Reader& reader) {
|
||||
if(reader.peekChar() < 0 || reader.eof()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ PropertySerialiser::read(BinaryReader& reader) {
|
|||
}
|
||||
|
||||
Types::UnrealPropertyBase::ptr
|
||||
PropertySerialiser::readItem(BinaryReader& reader, Containers::String type, std::size_t value_length,
|
||||
PropertySerialiser::readItem(BinaryIo::Reader& reader, Containers::String type, std::size_t value_length,
|
||||
Containers::String name)
|
||||
{
|
||||
if(reader.peekChar() < 0 || reader.eof()) {
|
||||
|
@ -115,7 +115,7 @@ PropertySerialiser::readItem(BinaryReader& reader, Containers::String type, std:
|
|||
}
|
||||
|
||||
Containers::Array<Types::UnrealPropertyBase::ptr>
|
||||
PropertySerialiser::readSet(BinaryReader& reader, Containers::StringView item_type, std::uint32_t count) {
|
||||
PropertySerialiser::readSet(BinaryIo::Reader& reader, Containers::StringView item_type, std::uint32_t count) {
|
||||
if(reader.peekChar() < 0 || reader.eof()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ PropertySerialiser::readSet(BinaryReader& reader, Containers::StringView item_ty
|
|||
|
||||
Types::UnrealPropertyBase::ptr
|
||||
PropertySerialiser::deserialise(Containers::String name, Containers::String type, std::size_t value_length,
|
||||
BinaryReader& reader)
|
||||
BinaryIo::Reader& reader)
|
||||
{
|
||||
Types::UnrealPropertyBase::ptr prop;
|
||||
auto serialiser = getSerialiser(type);
|
||||
|
@ -183,7 +183,7 @@ PropertySerialiser::deserialise(Containers::String name, Containers::String type
|
|||
}
|
||||
|
||||
bool PropertySerialiser::serialise(Types::UnrealPropertyBase::ptr& prop, Containers::StringView item_type,
|
||||
std::size_t& bytes_written, BinaryWriter& writer)
|
||||
std::size_t& bytes_written, BinaryIo::Writer& writer)
|
||||
{
|
||||
auto serialiser = getSerialiser(item_type);
|
||||
if(!serialiser) {
|
||||
|
@ -193,7 +193,7 @@ bool PropertySerialiser::serialise(Types::UnrealPropertyBase::ptr& prop, Contain
|
|||
}
|
||||
|
||||
bool
|
||||
PropertySerialiser::write(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryWriter& writer) {
|
||||
PropertySerialiser::write(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryIo::Writer& writer) {
|
||||
if(prop->name == "None" && prop->propertyType == "NoneProperty" && dynamic_cast<Types::NoneProperty*>(prop.get())) {
|
||||
bytes_written += writer.writeUEStringToArray(*prop->name);
|
||||
return true;
|
||||
|
@ -218,7 +218,7 @@ PropertySerialiser::write(Types::UnrealPropertyBase::ptr& prop, std::size_t& byt
|
|||
|
||||
bool
|
||||
PropertySerialiser::writeItem(Types::UnrealPropertyBase::ptr& prop, Containers::StringView item_type,
|
||||
std::size_t& bytes_written, BinaryWriter& writer)
|
||||
std::size_t& bytes_written, BinaryIo::Writer& writer)
|
||||
{
|
||||
if(prop->name == "None" && prop->propertyType == "NoneProperty" && dynamic_cast<Types::NoneProperty*>(prop.get())) {
|
||||
bytes_written += writer.writeUEStringToArray(*prop->name);
|
||||
|
@ -229,7 +229,8 @@ PropertySerialiser::writeItem(Types::UnrealPropertyBase::ptr& prop, Containers::
|
|||
}
|
||||
|
||||
bool PropertySerialiser::writeSet(Containers::ArrayView<Types::UnrealPropertyBase::ptr> props,
|
||||
Containers::StringView item_type, std::size_t& bytes_written, BinaryWriter& writer)
|
||||
Containers::StringView item_type, std::size_t& bytes_written,
|
||||
BinaryIo::Writer& writer)
|
||||
{
|
||||
auto serialiser = getCollectionSerialiser(item_type);
|
||||
if(serialiser) {
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "Types/UnrealPropertyBase.h"
|
||||
|
||||
#include "Gvas.h"
|
||||
#include "../BinaryIo/BinaryIo.h"
|
||||
|
||||
using namespace Corrade;
|
||||
|
||||
|
@ -35,21 +35,21 @@ class PropertySerialiser {
|
|||
public:
|
||||
static auto instance() -> PropertySerialiser&;
|
||||
|
||||
auto read(BinaryReader& reader) -> Types::UnrealPropertyBase::ptr;
|
||||
auto readItem(BinaryReader& reader, Containers::String type, std::size_t value_length, Containers::String name)
|
||||
auto read(BinaryIo::Reader& reader) -> Types::UnrealPropertyBase::ptr;
|
||||
auto readItem(BinaryIo::Reader& reader, Containers::String type, std::size_t value_length, Containers::String name)
|
||||
-> Types::UnrealPropertyBase::ptr;
|
||||
auto readSet(BinaryReader& reader, Containers::StringView item_type, std::uint32_t count)
|
||||
auto readSet(BinaryIo::Reader& reader, Containers::StringView item_type, std::uint32_t count)
|
||||
-> Containers::Array<Types::UnrealPropertyBase::ptr>;
|
||||
auto deserialise(Containers::String name, Containers::String type, std::size_t value_length,
|
||||
BinaryReader& reader) -> Types::UnrealPropertyBase::ptr;
|
||||
BinaryIo::Reader& reader) -> Types::UnrealPropertyBase::ptr;
|
||||
|
||||
bool serialise(Types::UnrealPropertyBase::ptr& prop, Containers::StringView item_type,
|
||||
std::size_t& bytes_written, BinaryWriter& writer);
|
||||
bool write(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryWriter& writer);
|
||||
std::size_t& bytes_written, BinaryIo::Writer& writer);
|
||||
bool write(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryIo::Writer& writer);
|
||||
bool writeItem(Types::UnrealPropertyBase::ptr& prop, Containers::StringView item_type,
|
||||
std::size_t& bytes_written, BinaryWriter& writer);
|
||||
std::size_t& bytes_written, BinaryIo::Writer& writer);
|
||||
bool writeSet(Containers::ArrayView<Types::UnrealPropertyBase::ptr> props, Containers::StringView item_type,
|
||||
std::size_t& bytes_written, BinaryWriter& writer);
|
||||
std::size_t& bytes_written, BinaryIo::Writer& writer);
|
||||
|
||||
private:
|
||||
PropertySerialiser();
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include <Corrade/Containers/StringView.h>
|
||||
|
||||
#include "../Gvas.h"
|
||||
#include "../../BinaryIo/BinaryIo.h"
|
||||
#include "../Types/UnrealPropertyBase.h"
|
||||
|
||||
using namespace Corrade;
|
||||
|
@ -41,11 +42,12 @@ class AbstractUnrealCollectionProperty {
|
|||
virtual auto types() -> StringArrayView = 0;
|
||||
|
||||
virtual auto deserialise(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
std::uint32_t count, BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
std::uint32_t count, BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
-> PropertyArray = 0;
|
||||
|
||||
virtual bool serialise(PropertyArrayView props, Containers::StringView item_type,
|
||||
std::size_t& bytes_written, BinaryWriter& writer, PropertySerialiser& serialiser) = 0;
|
||||
std::size_t& bytes_written, BinaryIo::Writer& writer,
|
||||
PropertySerialiser& serialiser) = 0;
|
||||
};
|
||||
|
||||
}}
|
||||
|
|
|
@ -21,11 +21,11 @@
|
|||
#include <Corrade/Containers/StringView.h>
|
||||
|
||||
#include "../Gvas.h"
|
||||
#include "../../BinaryIo/BinaryIo.h"
|
||||
#include "../Types/UnrealPropertyBase.h"
|
||||
|
||||
using namespace Corrade;
|
||||
|
||||
|
||||
namespace Gvas { namespace Serialisers {
|
||||
|
||||
using StringArrayView = Containers::ArrayView<const Containers::String>;
|
||||
|
@ -39,11 +39,11 @@ class AbstractUnrealProperty {
|
|||
virtual auto types() -> StringArrayView = 0;
|
||||
|
||||
virtual auto deserialise(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
-> Types::UnrealPropertyBase::ptr = 0;
|
||||
|
||||
virtual bool serialise(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryWriter& writer,
|
||||
PropertySerialiser& serialiser) = 0;
|
||||
virtual bool serialise(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written,
|
||||
BinaryIo::Writer& writer, PropertySerialiser& serialiser) = 0;
|
||||
};
|
||||
|
||||
}}
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include <Corrade/Containers/StringView.h>
|
||||
|
||||
#include "../Gvas.h"
|
||||
#include "../../BinaryIo/BinaryIo.h"
|
||||
#include "../Types/UnrealPropertyBase.h"
|
||||
|
||||
using namespace Corrade;
|
||||
|
@ -36,9 +37,9 @@ class AbstractUnrealStruct {
|
|||
|
||||
virtual bool supportsType(Containers::StringView type) = 0;
|
||||
|
||||
virtual auto deserialise(BinaryReader& reader) -> Types::UnrealPropertyBase::ptr = 0;
|
||||
virtual auto deserialise(BinaryIo::Reader& reader) -> Types::UnrealPropertyBase::ptr = 0;
|
||||
|
||||
virtual bool serialise(Types::UnrealPropertyBase::ptr& structProp, BinaryWriter& writer,
|
||||
virtual bool serialise(Types::UnrealPropertyBase::ptr& structProp, BinaryIo::Writer& writer,
|
||||
std::size_t& bytes_written) = 0;
|
||||
};
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
|
||||
#include <Corrade/Containers/String.h>
|
||||
|
||||
#include "../BinaryReader.h"
|
||||
#include "../BinaryWriter.h"
|
||||
#include "../../BinaryIo/Reader.h"
|
||||
#include "../../BinaryIo/Writer.h"
|
||||
#include "../PropertySerialiser.h"
|
||||
#include "../../Logger/Logger.h"
|
||||
|
||||
|
@ -27,7 +27,7 @@ namespace Gvas { namespace Serialisers {
|
|||
|
||||
Types::UnrealPropertyBase::ptr
|
||||
ArrayProperty::deserialiseProperty(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
{
|
||||
Containers::String item_type;
|
||||
if(!reader.readUEString(item_type)) {
|
||||
|
@ -55,8 +55,8 @@ ArrayProperty::deserialiseProperty(Containers::StringView name, Containers::Stri
|
|||
}
|
||||
|
||||
bool
|
||||
ArrayProperty::serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryWriter& writer,
|
||||
PropertySerialiser& serialiser)
|
||||
ArrayProperty::serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written,
|
||||
BinaryIo::Writer& writer, PropertySerialiser& serialiser)
|
||||
{
|
||||
auto array_prop = dynamic_cast<Types::ArrayProperty*>(prop.get());
|
||||
if(!array_prop) {
|
||||
|
|
|
@ -32,10 +32,10 @@ class ArrayProperty : public UnrealProperty<Types::ArrayProperty> {
|
|||
|
||||
private:
|
||||
auto deserialiseProperty(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
-> Types::UnrealPropertyBase::ptr override;
|
||||
bool serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryWriter& writer,
|
||||
PropertySerialiser& serialiser) override;
|
||||
bool serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written,
|
||||
BinaryIo::Writer& writer, PropertySerialiser& serialiser) override;
|
||||
};
|
||||
|
||||
}}
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#include "../BinaryReader.h"
|
||||
#include "../BinaryWriter.h"
|
||||
#include "../../BinaryIo/Reader.h"
|
||||
#include "../../BinaryIo/Writer.h"
|
||||
#include "../../Logger/Logger.h"
|
||||
|
||||
#include "BoolProperty.h"
|
||||
|
@ -31,7 +31,7 @@ BoolProperty::types() {
|
|||
|
||||
Types::UnrealPropertyBase::ptr
|
||||
BoolProperty::deserialise(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
{
|
||||
if(value_length != 0) {
|
||||
LOG_ERROR_FORMAT("Invalid value length for bool property {}. Expected 0, got {} instead.", name, value_length);
|
||||
|
@ -56,7 +56,7 @@ BoolProperty::deserialise(Containers::StringView name, Containers::StringView ty
|
|||
}
|
||||
|
||||
bool
|
||||
BoolProperty::serialise(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryWriter& writer,
|
||||
BoolProperty::serialise(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryIo::Writer& writer,
|
||||
PropertySerialiser& serialiser)
|
||||
{
|
||||
auto bool_prop = dynamic_cast<Types::BoolProperty*>(prop.get());
|
||||
|
|
|
@ -34,10 +34,10 @@ class BoolProperty : public AbstractUnrealProperty {
|
|||
auto types() -> StringArrayView override;
|
||||
|
||||
auto deserialise(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
-> Types::UnrealPropertyBase::ptr override;
|
||||
|
||||
bool serialise(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryWriter& writer,
|
||||
bool serialise(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryIo::Writer& writer,
|
||||
PropertySerialiser& serialiser) override;
|
||||
};
|
||||
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#include "../BinaryReader.h"
|
||||
#include "../BinaryWriter.h"
|
||||
#include "../../BinaryIo/Reader.h"
|
||||
#include "../../BinaryIo/Writer.h"
|
||||
#include "../../Logger/Logger.h"
|
||||
|
||||
#include "ByteProperty.h"
|
||||
|
@ -31,7 +31,7 @@ ByteProperty::types() {
|
|||
|
||||
Types::UnrealPropertyBase::ptr
|
||||
ByteProperty::deserialise(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
{
|
||||
auto prop = Containers::pointer<Types::ByteProperty>();
|
||||
|
||||
|
@ -68,7 +68,7 @@ ByteProperty::deserialise(Containers::StringView name, Containers::StringView ty
|
|||
}
|
||||
|
||||
bool
|
||||
ByteProperty::serialise(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryWriter& writer,
|
||||
ByteProperty::serialise(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryIo::Writer& writer,
|
||||
PropertySerialiser& serialiser)
|
||||
{
|
||||
auto byte_prop = dynamic_cast<Types::ByteProperty*>(prop.get());
|
||||
|
|
|
@ -32,10 +32,10 @@ class ByteProperty : public AbstractUnrealProperty {
|
|||
auto types() -> StringArrayView override;
|
||||
|
||||
auto deserialise(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
-> Types::UnrealPropertyBase::ptr override;
|
||||
|
||||
bool serialise(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryWriter& writer,
|
||||
bool serialise(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryIo::Writer& writer,
|
||||
PropertySerialiser& serialiser) override;
|
||||
};
|
||||
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#include "../BinaryReader.h"
|
||||
#include "../BinaryWriter.h"
|
||||
#include "../../BinaryIo/Reader.h"
|
||||
#include "../../BinaryIo/Writer.h"
|
||||
#include "../../Logger/Logger.h"
|
||||
|
||||
#include "ColourProperty.h"
|
||||
|
@ -24,7 +24,7 @@ namespace Gvas { namespace Serialisers {
|
|||
|
||||
Types::UnrealPropertyBase::ptr
|
||||
ColourProperty::deserialiseProperty(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
{
|
||||
auto prop = Containers::pointer<Types::ColourStructProperty>();
|
||||
|
||||
|
@ -40,7 +40,7 @@ ColourProperty::deserialiseProperty(Containers::StringView name, Containers::Str
|
|||
|
||||
bool
|
||||
ColourProperty::serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written,
|
||||
BinaryWriter& writer, PropertySerialiser& serialiser)
|
||||
BinaryIo::Writer& writer, PropertySerialiser& serialiser)
|
||||
{
|
||||
auto colour_prop = dynamic_cast<Types::ColourStructProperty*>(prop.get());
|
||||
if(!colour_prop) {
|
||||
|
|
|
@ -32,10 +32,10 @@ class ColourProperty : public UnrealProperty<Types::ColourStructProperty> {
|
|||
|
||||
private:
|
||||
auto deserialiseProperty(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
-> Types::UnrealPropertyBase::ptr override;
|
||||
bool serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryWriter& writer,
|
||||
PropertySerialiser& serialiser) override;
|
||||
bool serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written,
|
||||
BinaryIo::Writer& writer, PropertySerialiser& serialiser) override;
|
||||
};
|
||||
|
||||
}}
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#include "../BinaryReader.h"
|
||||
#include "../BinaryWriter.h"
|
||||
#include "../../BinaryIo/Reader.h"
|
||||
#include "../../BinaryIo/Writer.h"
|
||||
#include "../../Logger/Logger.h"
|
||||
|
||||
#include "DateTimeProperty.h"
|
||||
|
@ -24,7 +24,7 @@ namespace Gvas { namespace Serialisers {
|
|||
|
||||
Types::UnrealPropertyBase::ptr
|
||||
DateTimeProperty::deserialiseProperty(Containers::StringView name, Containers::StringView type,
|
||||
std::size_t value_length, BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
std::size_t value_length, BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
{
|
||||
auto prop = Containers::pointer<Types::DateTimeStructProperty>();
|
||||
|
||||
|
@ -38,7 +38,7 @@ DateTimeProperty::deserialiseProperty(Containers::StringView name, Containers::S
|
|||
|
||||
bool
|
||||
DateTimeProperty::serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written,
|
||||
BinaryWriter& writer, PropertySerialiser& serialiser)
|
||||
BinaryIo::Writer& writer, PropertySerialiser& serialiser)
|
||||
{
|
||||
auto dt_prop = dynamic_cast<Types::DateTimeStructProperty*>(prop.get());
|
||||
if(!dt_prop) {
|
||||
|
|
|
@ -30,10 +30,10 @@ class DateTimeProperty : public UnrealProperty<Types::DateTimeStructProperty> {
|
|||
|
||||
private:
|
||||
auto deserialiseProperty(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
-> Types::UnrealPropertyBase::ptr override;
|
||||
bool serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryWriter& writer,
|
||||
PropertySerialiser& serialiser) override;
|
||||
bool serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written,
|
||||
BinaryIo::Writer& writer, PropertySerialiser& serialiser) override;
|
||||
};
|
||||
|
||||
}}
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#include "../BinaryReader.h"
|
||||
#include "../BinaryWriter.h"
|
||||
#include "../../BinaryIo/Reader.h"
|
||||
#include "../../BinaryIo/Writer.h"
|
||||
#include "../../Logger/Logger.h"
|
||||
|
||||
#include "EnumProperty.h"
|
||||
|
@ -31,7 +31,7 @@ EnumProperty::types() {
|
|||
|
||||
Types::UnrealPropertyBase::ptr
|
||||
EnumProperty::deserialise(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
{
|
||||
auto prop = Containers::pointer<Types::EnumProperty>();
|
||||
|
||||
|
@ -55,7 +55,7 @@ EnumProperty::deserialise(Containers::StringView name, Containers::StringView ty
|
|||
}
|
||||
|
||||
bool
|
||||
EnumProperty::serialise(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryWriter& writer,
|
||||
EnumProperty::serialise(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryIo::Writer& writer,
|
||||
PropertySerialiser& serialiser)
|
||||
{
|
||||
auto enum_prop = dynamic_cast<Types::EnumProperty*>(prop.get());
|
||||
|
|
|
@ -32,10 +32,10 @@ class EnumProperty : public AbstractUnrealProperty {
|
|||
auto types() -> StringArrayView override;
|
||||
|
||||
auto deserialise(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
-> Types::UnrealPropertyBase::ptr override;
|
||||
|
||||
bool serialise(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryWriter& writer,
|
||||
bool serialise(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryIo::Writer& writer,
|
||||
PropertySerialiser& serialiser) override;
|
||||
};
|
||||
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#include "../BinaryReader.h"
|
||||
#include "../BinaryWriter.h"
|
||||
#include "../../BinaryIo/Reader.h"
|
||||
#include "../../BinaryIo/Writer.h"
|
||||
#include "../../Logger/Logger.h"
|
||||
|
||||
#include "FloatProperty.h"
|
||||
|
@ -31,7 +31,7 @@ FloatProperty::types() {
|
|||
|
||||
Types::UnrealPropertyBase::ptr
|
||||
FloatProperty::deserialise(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
{
|
||||
auto prop = Containers::pointer<Types::FloatProperty>();
|
||||
|
||||
|
@ -50,7 +50,7 @@ FloatProperty::deserialise(Containers::StringView name, Containers::StringView t
|
|||
}
|
||||
|
||||
bool
|
||||
FloatProperty::serialise(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryWriter& writer,
|
||||
FloatProperty::serialise(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryIo::Writer& writer,
|
||||
PropertySerialiser& serialiser)
|
||||
{
|
||||
auto float_prop = dynamic_cast<Types::FloatProperty*>(prop.get());
|
||||
|
|
|
@ -32,10 +32,10 @@ class FloatProperty : public AbstractUnrealProperty {
|
|||
auto types() -> StringArrayView override;
|
||||
|
||||
auto deserialise(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
-> Types::UnrealPropertyBase::ptr override;
|
||||
|
||||
bool serialise(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryWriter& writer,
|
||||
bool serialise(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryIo::Writer& writer,
|
||||
PropertySerialiser& serialiser) override;
|
||||
};
|
||||
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#include "../BinaryReader.h"
|
||||
#include "../BinaryWriter.h"
|
||||
#include "../../BinaryIo/Reader.h"
|
||||
#include "../../BinaryIo/Writer.h"
|
||||
#include "../../Logger/Logger.h"
|
||||
|
||||
#include "GuidProperty.h"
|
||||
|
@ -26,7 +26,7 @@ namespace Gvas { namespace Serialisers {
|
|||
|
||||
Types::UnrealPropertyBase::ptr
|
||||
GuidProperty::deserialiseProperty(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
{
|
||||
auto prop = Containers::pointer<Types::GuidStructProperty>();
|
||||
|
||||
|
@ -39,8 +39,8 @@ GuidProperty::deserialiseProperty(Containers::StringView name, Containers::Strin
|
|||
}
|
||||
|
||||
bool
|
||||
GuidProperty::serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryWriter& writer,
|
||||
PropertySerialiser& serialiser)
|
||||
GuidProperty::serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written,
|
||||
BinaryIo::Writer& writer, PropertySerialiser& serialiser)
|
||||
{
|
||||
auto guid_prop = dynamic_cast<Types::GuidStructProperty*>(prop.get());
|
||||
if(!guid_prop) {
|
||||
|
|
|
@ -30,10 +30,10 @@ class GuidProperty : public UnrealProperty<Types::GuidStructProperty> {
|
|||
|
||||
private:
|
||||
auto deserialiseProperty(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
-> Types::UnrealPropertyBase::ptr override;
|
||||
bool serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryWriter& writer,
|
||||
PropertySerialiser& serialiser) override;
|
||||
bool serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written,
|
||||
BinaryIo::Writer& writer, PropertySerialiser& serialiser) override;
|
||||
};
|
||||
|
||||
}}
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#include "../BinaryReader.h"
|
||||
#include "../BinaryWriter.h"
|
||||
#include "../../BinaryIo/Reader.h"
|
||||
#include "../../BinaryIo/Writer.h"
|
||||
#include "../../Logger/Logger.h"
|
||||
|
||||
#include "IntProperty.h"
|
||||
|
@ -24,7 +24,7 @@ namespace Gvas { namespace Serialisers {
|
|||
|
||||
Types::UnrealPropertyBase::ptr
|
||||
IntProperty::deserialiseProperty(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
{
|
||||
auto prop = Containers::pointer<Types::IntProperty>();
|
||||
|
||||
|
@ -55,8 +55,8 @@ IntProperty::deserialiseProperty(Containers::StringView name, Containers::String
|
|||
}
|
||||
|
||||
bool
|
||||
IntProperty::serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryWriter& writer,
|
||||
PropertySerialiser& serialiser)
|
||||
IntProperty::serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written,
|
||||
BinaryIo::Writer& writer, PropertySerialiser& serialiser)
|
||||
{
|
||||
auto int_prop = dynamic_cast<Types::IntProperty*>(prop.get());
|
||||
if(!int_prop) {
|
||||
|
|
|
@ -30,10 +30,10 @@ class IntProperty : public UnrealProperty<Types::IntProperty> {
|
|||
|
||||
private:
|
||||
auto deserialiseProperty(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
-> Types::UnrealPropertyBase::ptr override;
|
||||
bool serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryWriter& writer,
|
||||
PropertySerialiser& serialiser) override;
|
||||
bool serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written,
|
||||
BinaryIo::Writer& writer, PropertySerialiser& serialiser) override;
|
||||
};
|
||||
|
||||
}}
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#include "../BinaryReader.h"
|
||||
#include "../BinaryWriter.h"
|
||||
#include "../../BinaryIo/Reader.h"
|
||||
#include "../../BinaryIo/Writer.h"
|
||||
#include "../PropertySerialiser.h"
|
||||
#include "../Types/NoneProperty.h"
|
||||
#include "../../Logger/Logger.h"
|
||||
|
@ -28,7 +28,7 @@ namespace Gvas { namespace Serialisers {
|
|||
|
||||
Types::UnrealPropertyBase::ptr
|
||||
MapProperty::deserialiseProperty(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
{
|
||||
auto prop = Containers::pointer<Types::MapProperty>();
|
||||
|
||||
|
@ -110,8 +110,8 @@ MapProperty::deserialiseProperty(Containers::StringView name, Containers::String
|
|||
}
|
||||
|
||||
bool
|
||||
MapProperty::serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryWriter& writer,
|
||||
PropertySerialiser& serialiser)
|
||||
MapProperty::serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written,
|
||||
BinaryIo::Writer& writer, PropertySerialiser& serialiser)
|
||||
{
|
||||
auto map_prop = dynamic_cast<Types::MapProperty*>(prop.get());
|
||||
if(!map_prop) {
|
||||
|
|
|
@ -30,10 +30,10 @@ class MapProperty : public UnrealProperty<Types::MapProperty> {
|
|||
|
||||
private:
|
||||
auto deserialiseProperty(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
-> Types::UnrealPropertyBase::ptr override;
|
||||
bool serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryWriter& writer,
|
||||
PropertySerialiser& serialiser) override;
|
||||
bool serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written,
|
||||
BinaryIo::Writer& writer, PropertySerialiser& serialiser) override;
|
||||
};
|
||||
|
||||
}}
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#include "../BinaryReader.h"
|
||||
#include "../BinaryWriter.h"
|
||||
#include "../../BinaryIo/Reader.h"
|
||||
#include "../../BinaryIo/Writer.h"
|
||||
#include "../PropertySerialiser.h"
|
||||
#include "../Types/IntProperty.h"
|
||||
#include "../Types/NoneProperty.h"
|
||||
|
@ -29,7 +29,8 @@ namespace Gvas { namespace Serialisers {
|
|||
|
||||
Types::UnrealPropertyBase::ptr
|
||||
ResourceProperty::deserialiseProperty(Containers::StringView name, Containers::StringView type,
|
||||
std::size_t value_length, BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
std::size_t value_length, BinaryIo::Reader& reader,
|
||||
PropertySerialiser& serialiser)
|
||||
{
|
||||
auto prop = Containers::pointer<Types::ResourceItemValue>();
|
||||
|
||||
|
@ -81,7 +82,7 @@ ResourceProperty::deserialiseProperty(Containers::StringView name, Containers::S
|
|||
|
||||
bool
|
||||
ResourceProperty::serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written,
|
||||
BinaryWriter& writer, PropertySerialiser& serialiser)
|
||||
BinaryIo::Writer& writer, PropertySerialiser& serialiser)
|
||||
{
|
||||
auto res_prop = dynamic_cast<Types::ResourceItemValue*>(prop.get());
|
||||
if(!res_prop) {
|
||||
|
|
|
@ -30,10 +30,10 @@ class ResourceProperty : public UnrealProperty<Types::ResourceItemValue> {
|
|||
|
||||
private:
|
||||
auto deserialiseProperty(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
-> Types::UnrealPropertyBase::ptr override;
|
||||
bool serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryWriter& writer,
|
||||
PropertySerialiser& serialiser) override;
|
||||
bool serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written,
|
||||
BinaryIo::Writer& writer, PropertySerialiser& serialiser) override;
|
||||
};
|
||||
|
||||
}}
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#include "../BinaryReader.h"
|
||||
#include "../BinaryWriter.h"
|
||||
#include "../../BinaryIo/Reader.h"
|
||||
#include "../../BinaryIo/Writer.h"
|
||||
#include "../../Logger/Logger.h"
|
||||
|
||||
#include "RotatorProperty.h"
|
||||
|
@ -24,7 +24,7 @@ namespace Gvas { namespace Serialisers {
|
|||
|
||||
Types::UnrealPropertyBase::ptr
|
||||
RotatorProperty::deserialiseProperty(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
{
|
||||
auto prop = Containers::pointer<Types::RotatorStructProperty>();
|
||||
|
||||
|
@ -38,7 +38,7 @@ RotatorProperty::deserialiseProperty(Containers::StringView name, Containers::St
|
|||
|
||||
bool
|
||||
RotatorProperty::serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written,
|
||||
BinaryWriter& writer, PropertySerialiser& serialiser)
|
||||
BinaryIo::Writer& writer, PropertySerialiser& serialiser)
|
||||
{
|
||||
auto rotator = dynamic_cast<Types::RotatorStructProperty*>(prop.get());
|
||||
if(!rotator) {
|
||||
|
@ -46,7 +46,8 @@ RotatorProperty::serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::si
|
|||
return false;
|
||||
}
|
||||
|
||||
bytes_written += writer.writeValueToArray<float>(rotator->x) + writer.writeValueToArray<float>(rotator->y) +
|
||||
bytes_written += writer.writeValueToArray<float>(rotator->x) +
|
||||
writer.writeValueToArray<float>(rotator->y) +
|
||||
writer.writeValueToArray<float>(rotator->z);
|
||||
|
||||
return true;
|
||||
|
|
|
@ -30,10 +30,10 @@ class RotatorProperty : public UnrealProperty<Types::RotatorStructProperty> {
|
|||
|
||||
private:
|
||||
auto deserialiseProperty(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
-> Types::UnrealPropertyBase::ptr override;
|
||||
bool serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryWriter& writer,
|
||||
PropertySerialiser& serialiser) override;
|
||||
bool serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written,
|
||||
BinaryIo::Writer& writer, PropertySerialiser& serialiser) override;
|
||||
};
|
||||
|
||||
}}
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#include "../BinaryReader.h"
|
||||
#include "../BinaryWriter.h"
|
||||
#include "../../BinaryIo/Reader.h"
|
||||
#include "../../BinaryIo/Writer.h"
|
||||
#include "../PropertySerialiser.h"
|
||||
#include "../../Logger/Logger.h"
|
||||
|
||||
|
@ -25,7 +25,7 @@ namespace Gvas { namespace Serialisers {
|
|||
|
||||
Types::UnrealPropertyBase::ptr
|
||||
SetProperty::deserialiseProperty(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
{
|
||||
Containers::String item_type;
|
||||
if(!reader.readUEString(item_type)) {
|
||||
|
@ -59,8 +59,8 @@ SetProperty::deserialiseProperty(Containers::StringView name, Containers::String
|
|||
}
|
||||
|
||||
bool
|
||||
SetProperty::serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryWriter& writer,
|
||||
PropertySerialiser& serialiser)
|
||||
SetProperty::serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written,
|
||||
BinaryIo::Writer& writer, PropertySerialiser& serialiser)
|
||||
{
|
||||
auto set_prop = dynamic_cast<Types::SetProperty*>(prop.get());
|
||||
if(!set_prop) {
|
||||
|
|
|
@ -30,10 +30,10 @@ class SetProperty : public UnrealProperty<Types::SetProperty> {
|
|||
|
||||
private:
|
||||
auto deserialiseProperty(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
-> Types::UnrealPropertyBase::ptr override;
|
||||
bool serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryWriter& writer,
|
||||
PropertySerialiser& serialiser) override;
|
||||
bool serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written,
|
||||
BinaryIo::Writer& writer, PropertySerialiser& serialiser) override;
|
||||
};
|
||||
|
||||
}}
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#include "../BinaryReader.h"
|
||||
#include "../BinaryWriter.h"
|
||||
#include "../../BinaryIo/Reader.h"
|
||||
#include "../../BinaryIo/Writer.h"
|
||||
#include "../../Logger/Logger.h"
|
||||
|
||||
#include "StringProperty.h"
|
||||
|
@ -33,7 +33,7 @@ StringProperty::types() {
|
|||
|
||||
Types::UnrealPropertyBase::ptr
|
||||
StringProperty::deserialise(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
{
|
||||
auto prop = Containers::pointer<Types::StringProperty>(type);
|
||||
|
||||
|
@ -56,7 +56,7 @@ StringProperty::deserialise(Containers::StringView name, Containers::StringView
|
|||
}
|
||||
|
||||
bool
|
||||
StringProperty::serialise(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryWriter& writer,
|
||||
StringProperty::serialise(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryIo::Writer& writer,
|
||||
PropertySerialiser& serialiser)
|
||||
{
|
||||
auto str_prop = dynamic_cast<Types::StringProperty*>(prop.get());
|
||||
|
|
|
@ -32,10 +32,10 @@ class StringProperty : public AbstractUnrealProperty {
|
|||
auto types() -> StringArrayView override;
|
||||
|
||||
auto deserialise(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
-> Types::UnrealPropertyBase::ptr override;
|
||||
|
||||
bool serialise(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryWriter& writer,
|
||||
bool serialise(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryIo::Writer& writer,
|
||||
PropertySerialiser& serialiser) override;
|
||||
};
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
|
||||
#include <Corrade/Containers/String.h>
|
||||
|
||||
#include "../BinaryReader.h"
|
||||
#include "../BinaryWriter.h"
|
||||
#include "../../BinaryIo/Reader.h"
|
||||
#include "../../BinaryIo/Writer.h"
|
||||
#include "../PropertySerialiser.h"
|
||||
#include "../Types/GenericStructProperty.h"
|
||||
#include "../Types/NoneProperty.h"
|
||||
|
@ -36,7 +36,7 @@ Struct::types() {
|
|||
|
||||
PropertyArray
|
||||
Struct::deserialise(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
std::uint32_t count, BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
std::uint32_t count, BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
{
|
||||
Containers::String item_type;
|
||||
if(!reader.readUEString(item_type)) {
|
||||
|
@ -89,7 +89,7 @@ Struct::deserialise(Containers::StringView name, Containers::StringView type, st
|
|||
|
||||
Types::UnrealPropertyBase::ptr
|
||||
Struct::deserialise(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
{
|
||||
Containers::String item_type;
|
||||
if(!reader.readUEString(item_type)) {
|
||||
|
@ -127,7 +127,7 @@ Struct::deserialise(Containers::StringView name, Containers::StringView type, st
|
|||
|
||||
bool
|
||||
Struct::serialise(PropertyArrayView props, Containers::StringView item_type, std::size_t& bytes_written,
|
||||
BinaryWriter& writer, PropertySerialiser& serialiser)
|
||||
BinaryIo::Writer& writer, PropertySerialiser& serialiser)
|
||||
{
|
||||
bytes_written += writer.writeUEStringToArray(*(props.front()->name));
|
||||
bytes_written += writer.writeUEStringToArray(item_type);
|
||||
|
@ -170,7 +170,7 @@ Struct::serialise(PropertyArrayView props, Containers::StringView item_type, std
|
|||
}
|
||||
|
||||
bool
|
||||
Struct::serialise(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryWriter& writer,
|
||||
Struct::serialise(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryIo::Writer& writer,
|
||||
PropertySerialiser& serialiser)
|
||||
{
|
||||
auto struct_prop = dynamic_cast<Types::StructProperty*>(prop.get());
|
||||
|
@ -198,7 +198,7 @@ Struct::serialise(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_writt
|
|||
|
||||
Types::StructProperty::ptr
|
||||
Struct::readStructValue(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
{
|
||||
static_cast<void>(value_length);
|
||||
|
||||
|
@ -223,7 +223,7 @@ Struct::readStructValue(Containers::StringView name, Containers::StringView type
|
|||
}
|
||||
|
||||
bool
|
||||
Struct::writeStructValue(Types::StructProperty* prop, std::size_t& bytes_written, BinaryWriter& writer,
|
||||
Struct::writeStructValue(Types::StructProperty* prop, std::size_t& bytes_written, BinaryIo::Writer& writer,
|
||||
PropertySerialiser& serialiser)
|
||||
{
|
||||
auto struct_prop = dynamic_cast<Types::GenericStructProperty*>(prop);
|
||||
|
|
|
@ -34,21 +34,21 @@ class Struct : public AbstractUnrealProperty, public AbstractUnrealCollectionPro
|
|||
auto types() -> StringArrayView override;
|
||||
|
||||
auto deserialise(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
std::uint32_t count, BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
std::uint32_t count, BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
-> PropertyArray override;
|
||||
auto deserialise(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
-> Types::UnrealPropertyBase::ptr override;
|
||||
|
||||
bool serialise(PropertyArrayView props, Containers::StringView item_type, std::size_t& bytes_written,
|
||||
BinaryWriter& writer, PropertySerialiser& serialiser) override;
|
||||
bool serialise(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryWriter& writer,
|
||||
BinaryIo::Writer& writer, PropertySerialiser& serialiser) override;
|
||||
bool serialise(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryIo::Writer& writer,
|
||||
PropertySerialiser& serialiser) override;
|
||||
|
||||
private:
|
||||
auto readStructValue(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser) -> Types::StructProperty::ptr;
|
||||
bool writeStructValue(Types::StructProperty* prop, std::size_t& bytes_written, BinaryWriter& writer,
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser) -> Types::StructProperty::ptr;
|
||||
bool writeStructValue(Types::StructProperty* prop, std::size_t& bytes_written, BinaryIo::Writer& writer,
|
||||
PropertySerialiser& serialiser);
|
||||
};
|
||||
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
|
||||
#include "../../Logger/Logger.h"
|
||||
|
||||
#include "../BinaryReader.h"
|
||||
#include "../BinaryWriter.h"
|
||||
#include "../../BinaryIo/Reader.h"
|
||||
#include "../../BinaryIo/Writer.h"
|
||||
|
||||
#include "TextProperty.h"
|
||||
|
||||
|
@ -27,7 +27,7 @@ namespace Gvas { namespace Serialisers {
|
|||
|
||||
Types::UnrealPropertyBase::ptr
|
||||
TextProperty::deserialiseProperty(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
{
|
||||
auto prop = Containers::pointer<Types::TextProperty>();
|
||||
|
||||
|
@ -73,8 +73,8 @@ TextProperty::deserialiseProperty(Containers::StringView name, Containers::Strin
|
|||
}
|
||||
|
||||
bool
|
||||
TextProperty::serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryWriter& writer,
|
||||
PropertySerialiser& serialiser)
|
||||
TextProperty::serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written,
|
||||
BinaryIo::Writer& writer, PropertySerialiser& serialiser)
|
||||
{
|
||||
auto text_prop = dynamic_cast<Types::TextProperty*>(prop.get());
|
||||
if(!text_prop) {
|
||||
|
|
|
@ -30,10 +30,10 @@ class TextProperty : public UnrealProperty<Types::TextProperty> {
|
|||
|
||||
private:
|
||||
auto deserialiseProperty(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
-> Types::UnrealPropertyBase::ptr override;
|
||||
bool serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryWriter& writer,
|
||||
PropertySerialiser& serialiser) override;
|
||||
bool serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written,
|
||||
BinaryIo::Writer& writer, PropertySerialiser& serialiser) override;
|
||||
};
|
||||
|
||||
}}
|
||||
|
|
|
@ -52,13 +52,13 @@ class UnrealProperty : public AbstractUnrealProperty {
|
|||
}
|
||||
|
||||
auto deserialise(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
-> Types::UnrealPropertyBase::ptr override
|
||||
{
|
||||
return deserialiseProperty(name, type, value_length, reader, serialiser);
|
||||
}
|
||||
|
||||
bool serialise(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryWriter& writer,
|
||||
bool serialise(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryIo::Writer& writer,
|
||||
PropertySerialiser& serialiser) override
|
||||
{
|
||||
return serialiseProperty(prop, bytes_written, writer, serialiser);
|
||||
|
@ -66,11 +66,11 @@ class UnrealProperty : public AbstractUnrealProperty {
|
|||
|
||||
private:
|
||||
virtual auto deserialiseProperty(Containers::StringView name, Containers::StringView type,
|
||||
std::size_t value_length, BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
-> Types::UnrealPropertyBase::ptr = 0;
|
||||
std::size_t value_length, BinaryIo::Reader& reader,
|
||||
PropertySerialiser& serialiser) -> Types::UnrealPropertyBase::ptr = 0;
|
||||
|
||||
virtual bool serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written,
|
||||
BinaryWriter& writer, PropertySerialiser& serialiser) = 0;
|
||||
BinaryIo::Writer& writer, PropertySerialiser& serialiser) = 0;
|
||||
};
|
||||
|
||||
}}
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#include "../BinaryReader.h"
|
||||
#include "../BinaryWriter.h"
|
||||
#include "../../BinaryIo/Reader.h"
|
||||
#include "../../BinaryIo/Writer.h"
|
||||
#include "../../Logger/Logger.h"
|
||||
|
||||
#include "Vector2DProperty.h"
|
||||
|
@ -24,7 +24,8 @@ namespace Gvas { namespace Serialisers {
|
|||
|
||||
Types::UnrealPropertyBase::ptr
|
||||
Vector2DProperty::deserialiseProperty(Containers::StringView name, Containers::StringView type,
|
||||
std::size_t value_length, BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
std::size_t value_length, BinaryIo::Reader& reader,
|
||||
PropertySerialiser& serialiser)
|
||||
{
|
||||
auto prop = Containers::pointer<Types::Vector2DStructProperty>();
|
||||
|
||||
|
@ -38,7 +39,7 @@ Vector2DProperty::deserialiseProperty(Containers::StringView name, Containers::S
|
|||
|
||||
bool
|
||||
Vector2DProperty::serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written,
|
||||
BinaryWriter& writer, PropertySerialiser& serialiser)
|
||||
BinaryIo::Writer& writer, PropertySerialiser& serialiser)
|
||||
{
|
||||
auto vector = dynamic_cast<Types::Vector2DStructProperty*>(prop.get());
|
||||
if(!vector) {
|
||||
|
@ -46,7 +47,8 @@ Vector2DProperty::serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::s
|
|||
return false;
|
||||
}
|
||||
|
||||
bytes_written += writer.writeValueToArray<float>(vector->x) + writer.writeValueToArray<float>(vector->y);
|
||||
bytes_written += writer.writeValueToArray<float>(vector->x) +
|
||||
writer.writeValueToArray<float>(vector->y);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -30,10 +30,10 @@ class Vector2DProperty : public UnrealProperty<Types::Vector2DStructProperty> {
|
|||
|
||||
private:
|
||||
auto deserialiseProperty(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
-> Types::UnrealPropertyBase::ptr override;
|
||||
bool serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryWriter& writer,
|
||||
PropertySerialiser& serialiser) override;
|
||||
bool serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written,
|
||||
BinaryIo::Writer& writer, PropertySerialiser& serialiser) override;
|
||||
};
|
||||
|
||||
}}
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
|
||||
#include "../../Logger/Logger.h"
|
||||
|
||||
#include "../BinaryReader.h"
|
||||
#include "../BinaryWriter.h"
|
||||
#include "../../BinaryIo/Reader.h"
|
||||
#include "../../BinaryIo/Writer.h"
|
||||
|
||||
#include "VectorProperty.h"
|
||||
|
||||
|
@ -25,7 +25,7 @@ namespace Gvas { namespace Serialisers {
|
|||
|
||||
Types::UnrealPropertyBase::ptr
|
||||
VectorProperty::deserialiseProperty(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
{
|
||||
auto prop = Containers::pointer<Types::VectorStructProperty>();
|
||||
|
||||
|
@ -39,7 +39,7 @@ VectorProperty::deserialiseProperty(Containers::StringView name, Containers::Str
|
|||
|
||||
bool
|
||||
VectorProperty::serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written,
|
||||
BinaryWriter& writer, PropertySerialiser& serialiser)
|
||||
BinaryIo::Writer& writer, PropertySerialiser& serialiser)
|
||||
{
|
||||
auto vector = dynamic_cast<Types::VectorStructProperty*>(prop.get());
|
||||
if(!vector) {
|
||||
|
@ -47,7 +47,8 @@ VectorProperty::serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::siz
|
|||
return false;
|
||||
}
|
||||
|
||||
bytes_written += writer.writeValueToArray<float>(vector->x) + writer.writeValueToArray<float>(vector->y) +
|
||||
bytes_written += writer.writeValueToArray<float>(vector->x) +
|
||||
writer.writeValueToArray<float>(vector->y) +
|
||||
writer.writeValueToArray<float>(vector->z);
|
||||
|
||||
return true;
|
||||
|
|
|
@ -30,10 +30,10 @@ class VectorProperty : public UnrealProperty<Types::VectorStructProperty> {
|
|||
|
||||
private:
|
||||
auto deserialiseProperty(Containers::StringView name, Containers::StringView type, std::size_t value_length,
|
||||
BinaryReader& reader, PropertySerialiser& serialiser)
|
||||
BinaryIo::Reader& reader, PropertySerialiser& serialiser)
|
||||
-> Types::UnrealPropertyBase::ptr override;
|
||||
bool serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written, BinaryWriter& writer,
|
||||
PropertySerialiser& serialiser) override;
|
||||
bool serialiseProperty(Types::UnrealPropertyBase::ptr& prop, std::size_t& bytes_written,
|
||||
BinaryIo::Writer& writer, PropertySerialiser& serialiser) override;
|
||||
};
|
||||
|
||||
}}
|
||||
|
|
Loading…
Reference in a new issue