[ox/claw] Add non-ox::Buffer version of readClaw function

This commit is contained in:
Gary Talent 2023-02-11 23:59:37 -06:00
parent af3de01e1b
commit e19559d7a7
2 changed files with 8 additions and 2 deletions

View File

@ -72,8 +72,8 @@ 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 Buffer &buff) noexcept { Result<ModelObject> readClaw(TypeStore *ts, const char *buff, std::size_t buffSz) noexcept {
oxRequire(header, readClawHeader(buff)); 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));
@ -102,4 +102,8 @@ Result<ModelObject> readClaw(TypeStore *ts, const Buffer &buff) noexcept {
return OxError(1); return OxError(1);
} }
Result<ModelObject> readClaw(TypeStore *ts, const Buffer &buff) noexcept {
return readClaw(ts, buff.data(), buff.size());
}
} }

View File

@ -87,6 +87,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 Buffer &buff) noexcept; Result<ModelObject> readClaw(TypeStore *ts, const Buffer &buff) noexcept;
} }