[ox/claw] Add non-ox::Buffer version of readClaw function
This commit is contained in:
parent
af3de01e1b
commit
e19559d7a7
8
deps/ox/src/ox/claw/read.cpp
vendored
8
deps/ox/src/ox/claw/read.cpp
vendored
@ -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());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
2
deps/ox/src/ox/claw/read.hpp
vendored
2
deps/ox/src/ox/claw/read.hpp
vendored
@ -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;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user