From 74ca7b580c284d6fe3bf7067a19a2095102e72d1 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 8 Jan 2019 13:48:42 -0800 Subject: [PATCH] [OT] Implement operator[] for Coverage and ClassDef --- src/hb-ot-layout-common.hh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index d82c2629e..808038505 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -66,7 +66,6 @@ namespace OT { #define NOT_COVERED ((unsigned int) -1) - /* * * OpenType Layout Common Table Formats @@ -1037,6 +1036,9 @@ struct CoverageFormat2 struct Coverage { + enum { SENTINEL = NOT_COVERED }; + unsigned int operator[] (hb_codepoint_t glyph_id) { return get_coverage (glyph_id); } + unsigned int get_coverage (hb_codepoint_t glyph_id) const { switch (u.format) { @@ -1484,6 +1486,9 @@ struct ClassDefFormat2 struct ClassDef { + enum { SENTINEL = 0 }; + unsigned int operator[] (hb_codepoint_t glyph_id) { return get_class (glyph_id); } + unsigned int get_class (hb_codepoint_t glyph_id) const { switch (u.format) {