From 77bd34aab48dd9f45f421752968522cc32a4d976 Mon Sep 17 00:00:00 2001 From: m-holger Date: Sat, 9 Aug 2025 11:46:11 +0100 Subject: [PATCH] Add `empty` method to `BaseHandle` as a utility for checking zero size --- include/qpdf/ObjectHandle.hh | 7 +++++++ 1 file changed, 7 insertions(+), 0 deletions(-) diff --git a/include/qpdf/ObjectHandle.hh b/include/qpdf/ObjectHandle.hh index 6786216..213124b 100644 --- a/include/qpdf/ObjectHandle.hh +++ b/include/qpdf/ObjectHandle.hh @@ -66,6 +66,13 @@ namespace qpdf // For all other objects, return 1. size_t size() const; + // Return 'true' if size() == 0. + bool + empty() const + { + return size() == 0; + } + std::shared_ptr copy(bool shallow = false) const; // Recursively remove association with any QPDF object. This method may only be called // during final destruction. -- libgit2 0.21.4