Commit 77bd34aab48dd9f45f421752968522cc32a4d976
1 parent
1ec18f20
Add `empty` method to `BaseHandle` as a utility for checking zero size
Showing
1 changed file
with
7 additions
and
0 deletions
include/qpdf/ObjectHandle.hh
| ... | ... | @@ -66,6 +66,13 @@ namespace qpdf |
| 66 | 66 | // For all other objects, return 1. |
| 67 | 67 | size_t size() const; |
| 68 | 68 | |
| 69 | + // Return 'true' if size() == 0. | |
| 70 | + bool | |
| 71 | + empty() const | |
| 72 | + { | |
| 73 | + return size() == 0; | |
| 74 | + } | |
| 75 | + | |
| 69 | 76 | std::shared_ptr<QPDFObject> copy(bool shallow = false) const; |
| 70 | 77 | // Recursively remove association with any QPDF object. This method may only be called |
| 71 | 78 | // during final destruction. | ... | ... |