aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2013-06-14 17:27:15 +0200
committerJay Berkenbilt <ejb@ql.org>2013-06-14 20:58:09 +0200
commit5039da0b91a981b438cbb1c7a7325fde12e2632b (patch)
treee5dc30ca3f086a071e95a7d8cf29a3b975617433 /include
parentd88231e01ec3083fa99363efcd5b049fb1663a6c (diff)
downloadqpdf-5039da0b91a981b438cbb1c7a7325fde12e2632b.tar.zst
Add QPDFObjectHandle::getObjGen()
This is safer than getObjectID() and getGeneration() for many uses.
Diffstat (limited to 'include')
-rw-r--r--include/qpdf/QPDFObjectHandle.hh13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/qpdf/QPDFObjectHandle.hh b/include/qpdf/QPDFObjectHandle.hh
index ed02d3bb..81400056 100644
--- a/include/qpdf/QPDFObjectHandle.hh
+++ b/include/qpdf/QPDFObjectHandle.hh
@@ -16,6 +16,7 @@
#include <set>
#include <map>
+#include <qpdf/QPDFObjGen.hh>
#include <qpdf/PointerHolder.hh>
#include <qpdf/Buffer.hh>
#include <qpdf/InputSource.hh>
@@ -454,7 +455,17 @@ class QPDFObjectHandle
QPDFObjectHandle const& filter,
QPDFObjectHandle const& decode_parms);
- // return 0 for direct objects
+ // Access object ID and generation. For direct objects, return
+ // object ID 0.
+
+ // NOTE: Be careful about calling getObjectID() and
+ // getGeneration() directly as this can lead to the pattern of
+ // depending on object ID or generation without the other. In
+ // general, when keeping track of object IDs, it's better to use
+ // QPDFObjGen instead.
+
+ QPDF_DLL
+ QPDFObjGen getObjGen() const;
QPDF_DLL
int getObjectID() const;
QPDF_DLL