Commit 9dd221254723d5d92d3a815cc2c5afa6c6d36b11
1 parent
86e7cacf
Add method BaseHandle::null
Showing
2 changed files
with
7 additions
and
0 deletions
include/qpdf/ObjectHandle.hh
| @@ -53,6 +53,7 @@ namespace qpdf | @@ -53,6 +53,7 @@ namespace qpdf | ||
| 53 | 53 | ||
| 54 | // The rest of the header file is for qpdf internal use only. | 54 | // The rest of the header file is for qpdf internal use only. |
| 55 | 55 | ||
| 56 | + inline bool null() const; | ||
| 56 | inline qpdf_object_type_e type_code() const; | 57 | inline qpdf_object_type_e type_code() const; |
| 57 | 58 | ||
| 58 | protected: | 59 | protected: |
libqpdf/qpdf/QPDFObjectHandle_private.hh
| @@ -325,6 +325,12 @@ namespace qpdf | @@ -325,6 +325,12 @@ namespace qpdf | ||
| 325 | return nullptr; | 325 | return nullptr; |
| 326 | } | 326 | } |
| 327 | 327 | ||
| 328 | + inline bool | ||
| 329 | + BaseHandle::null() const | ||
| 330 | + { | ||
| 331 | + return !obj || obj->getResolvedTypeCode() == ::ot_null; | ||
| 332 | + } | ||
| 333 | + | ||
| 328 | inline qpdf_object_type_e | 334 | inline qpdf_object_type_e |
| 329 | BaseHandle::type_code() const | 335 | BaseHandle::type_code() const |
| 330 | { | 336 | { |