[ox/claw] Change readClaw to take ref to TypeStore
This commit is contained in:
parent
1f2e9917f1
commit
8b3b8d50d6
6
deps/ox/src/ox/claw/read.cpp
vendored
6
deps/ox/src/ox/claw/read.cpp
vendored
@ -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());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
deps/ox/src/ox/claw/read.hpp
vendored
4
deps/ox/src/ox/claw/read.hpp
vendored
@ -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;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user