diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2018-11-19 04:05:47 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2018-11-19 04:05:47 +0000 |
commit | a0f9dd8213083d3021d12beceb451325ee8fce30 (patch) | |
tree | c3de2c62a20cf8b71dbe6d968f463e8c5b76fc26 /Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.hh | |
parent | a34ffc9669bd1c626c01adc0292ee625b3ad16de (diff) |
harfbuzz-2.1.3
git-svn-id: svn://tug.org/texlive/trunk@49193 c570f23f-e606-0410-a88d-b1316a301751
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.hh | 25 |
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 */ |