[blob] Add as_bytes()
authorBehdad Esfahbod <behdad@behdad.org>
Fri, 24 Aug 2018 17:29:45 +0000 (10:29 -0700)
committerBehdad Esfahbod <behdad@behdad.org>
Fri, 24 Aug 2018 17:29:45 +0000 (10:29 -0700)
src/hb-blob-private.hh

index 49ad68e..0d3fad5 100644 (file)
@@ -62,6 +62,10 @@ struct hb_blob_t
   {
     return unlikely (!data) ? &Null(Type) : reinterpret_cast<const Type *> (data);
   }
+  inline hb_bytes_t as_bytes (void) const
+  {
+    return hb_bytes_t (data, length);
+  }
 
   public:
   hb_object_header_t header;