[ox/claw] Change readClaw to take ref to TypeStore

This commit is contained in:
Gary Talent 2023-12-14 23:56:02 -06:00
parent 1f2e9917f1
commit 8b3b8d50d6
2 changed files with 5 additions and 5 deletions

View File

@ -72,9 +72,9 @@ Result<Buffer> stripClawHeader(const ox::Buffer &buff) noexcept {
return stripClawHeader(buff.data(), buff.size()); return stripClawHeader(buff.data(), buff.size());
} }
Result<ModelObject> readClaw(TypeStore *ts, const char *buff, std::size_t buffSz) noexcept { Result<ModelObject> readClaw(TypeStore &ts, const char *buff, std::size_t buffSz) noexcept {
oxRequire(header, readClawHeader(buff, buffSz)); oxRequire(header, readClawHeader(buff, buffSz));
oxRequire(t, ts->getLoad(header.typeName, header.typeVersion, header.typeParams)); oxRequire(t, ts.getLoad(header.typeName, header.typeVersion, header.typeParams));
ModelObject obj; ModelObject obj;
oxReturnError(obj.setType(t)); oxReturnError(obj.setType(t));
switch (header.fmt) { switch (header.fmt) {
@ -103,7 +103,7 @@ Result<ModelObject> readClaw(TypeStore *ts, const char *buff, std::size_t buffSz
return OxError(1); return OxError(1);
} }
Result<ModelObject> readClaw(TypeStore *ts, const Buffer &buff) noexcept { Result<ModelObject> readClaw(TypeStore &ts, const Buffer &buff) noexcept {
return readClaw(ts, buff.data(), buff.size()); return readClaw(ts, buff.data(), buff.size());
} }

View File

@ -88,8 +88,8 @@ Result<T> readClaw(const Buffer &buff) {
return readClaw<T>(buff.data(), buff.size()); return readClaw<T>(buff.data(), buff.size());
} }
Result<ModelObject> readClaw(TypeStore *ts, const char *buff, std::size_t buffSz) noexcept; Result<ModelObject> readClaw(TypeStore &ts, const char *buff, std::size_t buffSz) noexcept;
Result<ModelObject> readClaw(TypeStore *ts, const Buffer &buff) noexcept; Result<ModelObject> readClaw(TypeStore &ts, const Buffer &buff) noexcept;
} }