diff options
author | Jay Berkenbilt <ejb@ql.org> | 2013-06-14 17:27:15 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2013-06-14 20:58:09 +0200 |
commit | 5039da0b91a981b438cbb1c7a7325fde12e2632b (patch) | |
tree | e5dc30ca3f086a071e95a7d8cf29a3b975617433 /include/qpdf/QPDFObjectHandle.hh | |
parent | d88231e01ec3083fa99363efcd5b049fb1663a6c (diff) | |
download | qpdf-5039da0b91a981b438cbb1c7a7325fde12e2632b.tar.zst |
Add QPDFObjectHandle::getObjGen()
This is safer than getObjectID() and getGeneration() for many uses.
Diffstat (limited to 'include/qpdf/QPDFObjectHandle.hh')
-rw-r--r-- | include/qpdf/QPDFObjectHandle.hh | 13 |
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 |