From f1352f7486caaf6d3480ef2ac6b4719acf73e6a2 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 6 Dec 2018 10:21:06 -0800 Subject: [PATCH] Add sub_array to hb_vector_t --- src/hb-vector.hh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/hb-vector.hh b/src/hb-vector.hh index 4b34a38..558fce1 100644 --- a/src/hb-vector.hh +++ b/src/hb-vector.hh @@ -98,11 +98,29 @@ struct hb_vector_t inline hb_array_t as_array (void) const { return hb_array (arrayZ(), len); } + inline hb_array_t sub_array (unsigned int start_offset, unsigned int count) const + { return as_array ().sub_array (start_offset, count);} + inline hb_array_t sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */) const + { return as_array ().sub_array (start_offset, count);} + inline hb_array_t sub_array (unsigned int start_offset, unsigned int count) + { return as_array ().sub_array (start_offset, count);} + inline hb_array_t sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */) + { return as_array ().sub_array (start_offset, count);} + inline hb_sorted_array_t as_sorted_array (void) { return hb_sorted_array (arrayZ(), len); } inline hb_sorted_array_t as_sorted_array (void) const { return hb_sorted_array (arrayZ(), len); } + inline hb_array_t sorted_sub_array (unsigned int start_offset, unsigned int count) const + { return as_sorted_array ().sorted_sub_array (start_offset, count);} + inline hb_array_t sorted_sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */) const + { return as_sorted_array ().sorted_sub_array (start_offset, count);} + inline hb_array_t sorted_sub_array (unsigned int start_offset, unsigned int count) + { return as_sorted_array ().sorted_sub_array (start_offset, count);} + inline hb_array_t sorted_sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */) + { return as_sorted_array ().sorted_sub_array (start_offset, count);} + template explicit_operator inline operator T * (void) { return arrayZ(); } template explicit_operator inline operator const T * (void) const { return arrayZ(); } inline operator hb_array_t (void) { return as_array (); } -- 2.7.4