mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-12-01 02:23:59 +01:00
[bit-page] Add a couple of operators
This commit is contained in:
1 parent
37bfdf79c6
commit
dc4ff7012c
1 file changed
+5
@@ -89,6 +89,8 @@ struct hb_vector_size_t
|
||||
|
||||
struct hb_bit_page_t
|
||||
{
|
||||
hb_bit_page_t () { init0 (); }
|
||||
|
||||
void init0 () { v.init0 (); population = 0; }
|
||||
void init1 () { v.init1 (); population = PAGE_BITS; }
|
||||
|
||||
@@ -116,6 +118,9 @@ struct hb_bit_page_t
|
||||
void set (hb_codepoint_t g, bool value) { if (value) add (g); else del (g); }
|
||||
bool get (hb_codepoint_t g) const { return elt (g) & mask (g); }
|
||||
|
||||
bool operator [] (hb_codepoint_t g) const { return get (g); }
|
||||
bool operator () (hb_codepoint_t g) const { return get (g); }
|
||||
|
||||
void add_range (hb_codepoint_t a, hb_codepoint_t b)
|
||||
{
|
||||
elt_t *la = &elt (a);
|
||||
|
||||
Reference in new issue
Block a user