summaryrefslogtreecommitdiff
path: root/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.hh
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.hh')
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.hh25
1 files changed, 24 insertions, 1 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.hh
index 1f7499fbf33..802b1f07eb6 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.hh
@@ -77,7 +77,30 @@ struct hb_blob_t
void *user_data;
hb_destroy_func_t destroy;
};
-DECLARE_NULL_INSTANCE (hb_blob_t);
+
+
+/*
+ * hb_blob_ptr_t
+ */
+
+template <typename P>
+struct hb_blob_ptr_t
+{
+ typedef typename hb_remove_pointer<P>::value T;
+
+ inline hb_blob_ptr_t (hb_blob_t *b_ = nullptr) : b (b_) {}
+ inline hb_blob_t * operator = (hb_blob_t *b_) { return b = b_; }
+ inline const T * operator -> (void) const { return get (); }
+ inline const T & operator * (void) const { return *get (); }
+ template <typename C> inline operator const C * (void) const { return get (); }
+ inline operator const char * (void) const { return (const char *) get (); }
+ inline const T * get (void) const { return b->as<T> (); }
+ inline hb_blob_t * get_blob (void) const { return b.get_raw (); }
+ inline unsigned int get_length (void) const { return b.get ()->length; }
+ inline void destroy (void) { hb_blob_destroy (b.get ()); b = nullptr; }
+
+ hb_nonnull_ptr_t<hb_blob_t> b;
+};
#endif /* HB_BLOB_HH */