提交 273ed612 编写于 作者: B Behdad Esfahbod

[serializer] Add serialize_copy()

上级 bf22338f
...@@ -305,6 +305,20 @@ struct OffsetTo : Offset<OffsetType, has_null> ...@@ -305,6 +305,20 @@ struct OffsetTo : Offset<OffsetType, has_null>
return ret; return ret;
} }
template <typename T>
bool serialize_copy (hb_serialize_context_t *c, const T &src, const void *base)
{
*this = 0;
if (has_null && &src == &Null (T))
return false;
c->push ();
c->copy (src);
c->add_link (*this, c->pop_pack (), base);
}
bool sanitize_shallow (hb_sanitize_context_t *c, const void *base) const bool sanitize_shallow (hb_sanitize_context_t *c, const void *base) const
{ {
TRACE_SANITIZE (this); TRACE_SANITIZE (this);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册