From 98cb3e16704ff68b04dd3d87b9ced16d3d2858a1 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Tue, 11 May 2021 22:10:05 -0500 Subject: [PATCH] [ox/model] Replace BString<100> with String as ModelString --- deps/ox/src/ox/model/desctypes.hpp | 11 +++++------ deps/ox/src/ox/model/walk.hpp | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/deps/ox/src/ox/model/desctypes.hpp b/deps/ox/src/ox/model/desctypes.hpp index dea7e78a..749527f3 100644 --- a/deps/ox/src/ox/model/desctypes.hpp +++ b/deps/ox/src/ox/model/desctypes.hpp @@ -11,16 +11,15 @@ #include #include #include -#include +#include #include #include "types.hpp" namespace ox { -using ModelString = BString<100>; -using FieldName = ModelString; -using TypeName = ModelString; +using FieldName = String; +using TypeName = String; enum class PrimitiveType: uint8_t { UnsignedInteger = 0, @@ -144,7 +143,7 @@ Error modelWrite(T *io, DescriptorField *field) { oxReturnError(io->field("typeName", SerStr(&empty))); oxReturnError(io->field("type", field->type)); } else { - oxReturnError(io->field("typeName", SerStr(&field->type->typeName))); + oxReturnError(io->field("typeName", &field->type->typeName)); oxReturnError(io->field("type", static_casttype)>(nullptr))); } oxReturnError(io->field("fieldName", &field->fieldName)); @@ -179,6 +178,6 @@ Error modelRead(T *io, DescriptorField *field) { return err; } -using TypeStore = HashMap; +using TypeStore = HashMap; } diff --git a/deps/ox/src/ox/model/walk.hpp b/deps/ox/src/ox/model/walk.hpp index c28a05bf..c4b73133 100644 --- a/deps/ox/src/ox/model/walk.hpp +++ b/deps/ox/src/ox/model/walk.hpp @@ -94,10 +94,10 @@ static Error parseField(const DescriptorField &field, Reader *rdr, DataWalker subscript; + String subscript; for (std::size_t i = 0; i < arrayLen; i++) { subscript = "["; - subscript += i; + subscript += static_cast(i); subscript += "]"; walker->pushNamePath(subscript); oxReturnError(parseField(f, &child, walker));