Add hb_sanitize_with_object_t

Context manager.
This commit is contained in:
Behdad Esfahbod 2018-11-24 23:38:06 -05:00
parent b3c5affc05
commit 1e8994221f

View File

@ -480,6 +480,23 @@ struct hb_sanitize_context_t :
bool num_glyphs_set;
};
struct hb_sanitize_with_object_t
{
template <typename T = hb_sanitize_context_t::dummy_get_size_t>
inline hb_sanitize_with_object_t (hb_sanitize_context_t *c,
const T& obj) : c (c)
{
c->set_object (obj);
}
inline ~hb_sanitize_with_object_t (void)
{
c->set_object ();
}
private:
hb_sanitize_context_t *c;
};
/*
* Serialize