[ox] Add StringView, Writer system, Preloader system

This commit is contained in:
2022-11-30 01:45:11 -06:00
parent 98f35140fe
commit cbb496c59f
64 changed files with 2343 additions and 417 deletions

View File

@@ -100,11 +100,11 @@ class OrganicClawReader {
}
template<typename T = void>
constexpr void setTypeInfo(const char*, int) noexcept {
constexpr void setTypeInfo(const char*, int, const Vector<String>& = {}) noexcept {
}
template<typename T = void>
constexpr void setTypeInfo(const char*, int, int) noexcept {
constexpr void setTypeInfo(const char*, int, const Vector<String>& = {}, int = {}) noexcept {
}
/**

View File

@@ -94,7 +94,7 @@ constexpr ox::Error model(auto *io, ox::CommonPtrWith<TestStruct> auto *obj) noe
oxReturnError(io->field("Int7", &obj->Int7));
oxReturnError(io->field("Int8", &obj->Int8));
oxReturnError(io->field("unionIdx", &obj->unionIdx));
if (ox_strcmp(io->opType(), ox::OpType::Reflect) == 0) {
if (io->opType() == ox::OpType::Reflect) {
oxReturnError(io->field("Union", ox::UnionView{&obj->Union, 0}));
} else {
oxReturnError(io->field("Union", ox::UnionView{&obj->Union, obj->unionIdx}));

View File

@@ -176,7 +176,8 @@ class OrganicClawWriter {
Error field(const char*, T *val) noexcept;
template<typename T = void>
constexpr void setTypeInfo(const char* = T::TypeName, int = T::TypeVersion, int = ModelFieldCount_v<T>) noexcept {
constexpr void setTypeInfo(const char* = T::TypeName, int = T::TypeVersion,
const Vector<String>& = {}, int = ModelFieldCount_v<T>) noexcept {
}
static constexpr auto opType() noexcept {