[ox/ser] Fix to use Error instead of int
This commit is contained in:
parent
80dd6282f5
commit
a9b7b00011
13
deps/ox/src/ox/ser/desctypes.hpp
vendored
13
deps/ox/src/ox/ser/desctypes.hpp
vendored
@ -8,6 +8,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ox/std/error.hpp>
|
||||
#include <ox/std/hashmap.hpp>
|
||||
#include <ox/std/string.hpp>
|
||||
#include <ox/std/vector.hpp>
|
||||
@ -116,8 +117,8 @@ struct DescriptorType {
|
||||
|
||||
|
||||
template<typename T>
|
||||
int ioOp(T *io, DescriptorType *type) {
|
||||
int32_t err = 0;
|
||||
Error ioOp(T *io, DescriptorType *type) {
|
||||
Error err = 0;
|
||||
io->setTypeInfo("ox::DescriptorType", 4);
|
||||
err |= io->op("typeName", &type->typeName);
|
||||
err |= io->op("primitiveType", &type->primitiveType);
|
||||
@ -127,8 +128,8 @@ int ioOp(T *io, DescriptorType *type) {
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
int ioOpWrite(T *io, DescriptorField *field) {
|
||||
int32_t err = 0;
|
||||
Error ioOpWrite(T *io, DescriptorField *field) {
|
||||
Error err = 0;
|
||||
io->setTypeInfo("ox::DescriptorField", 4);
|
||||
if (field->ownsType) {
|
||||
err |= io->op("typeName", "");
|
||||
@ -145,8 +146,8 @@ int ioOpWrite(T *io, DescriptorField *field) {
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
int ioOpRead(T *io, DescriptorField *field) {
|
||||
int32_t err = 0;
|
||||
Error ioOpRead(T *io, DescriptorField *field) {
|
||||
Error err = 0;
|
||||
auto &typeStore = io->typeStore();
|
||||
io->setTypeInfo("ox::DescriptorField", 4);
|
||||
err |= io->op("typeName", &field->typeName);
|
||||
|
6
deps/ox/src/ox/ser/optype.hpp
vendored
6
deps/ox/src/ox/ser/optype.hpp
vendored
@ -37,11 +37,11 @@ ox::Error ioOpWriteDefinition(T*, O*) {
|
||||
|
||||
template<typename T, typename O>
|
||||
ox::Error ioOp(T *io, O *obj) {
|
||||
if constexpr (T::opType() == ox::OpType::Read) {
|
||||
if constexpr(T::opType() == ox::OpType::Read) {
|
||||
return ioOpRead(io, obj);
|
||||
} else if constexpr (T::opType() == ox::OpType::Write) {
|
||||
} else if constexpr(T::opType() == ox::OpType::Write) {
|
||||
return ioOpWrite(io, obj);
|
||||
} else if constexpr (T::opType() == ox::OpType::WriteDefinition) {
|
||||
} else if constexpr(T::opType() == ox::OpType::WriteDefinition) {
|
||||
return ioOpWriteDefinition(io, obj);
|
||||
}
|
||||
return OxError(1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user