aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2011-08-10 18:42:48 +0200
committerJay Berkenbilt <ejb@ql.org>2011-08-10 18:42:48 +0200
commit7dc197ef88a3f19a830f38d19aba649175d53c5e (patch)
treea143dac62c1779d855120a6e616c84fc08e586be /include
parentb1a5b7e5d4c05a505c009668efa4472b6d4953d5 (diff)
downloadqpdf-7dc197ef88a3f19a830f38d19aba649175d53c5e.tar.zst
implement replace and swap
Diffstat (limited to 'include')
-rw-r--r--include/qpdf/QPDF.hh30
1 files changed, 30 insertions, 0 deletions
diff --git a/include/qpdf/QPDF.hh b/include/qpdf/QPDF.hh
index 1ef353e7..dc2b4c22 100644
--- a/include/qpdf/QPDF.hh
+++ b/include/qpdf/QPDF.hh
@@ -128,6 +128,36 @@ class QPDF
QPDF_DLL
QPDFObjectHandle getObjectByID(int objid, int generation);
+ // Replace the object with the given object id with the given
+ // object. The object handle passed in must be a direct object,
+ // though it may contain references to other indirect objects
+ // within it. Calling this method can have somewhat confusing
+ // results. Any existing QPDFObjectHandle instances that point to
+ // the old object and that have been resolved (which happens
+ // automatically if you access them in any way) will continue to
+ // point to the old object even though that object will no longer
+ // be associated with the PDF file. Note that replacing an object
+ // with QPDFObjectHandle::newNull() effectively removes the object
+ // from the file since a non-existent object is treated as a null
+ // object.
+ QPDF_DLL
+ void replaceObject(int objid, int generation, QPDFObjectHandle);
+
+ // Swap two objects given by ID. Calling this method can have
+ // confusing results. After swapping two objects, existing
+ // QPDFObjectHandle instances that reference them will still
+ // reference the same underlying objects, at which point those
+ // existing QPDFObjectHandle instances will have incorrect
+ // information about the object and generation number of those
+ // objects. While this does not necessarily cause a problem, it
+ // can certainly be confusing. It is therefore recommended that
+ // you replace any existing QPDFObjectHandle instances that point
+ // to the swapped objects with new ones, possibly by calling
+ // getObjectByID.
+ QPDF_DLL
+ void swapObjects(int objid1, int generation1,
+ int objid2, int generation2);
+
// Encryption support
enum encryption_method_e { e_none, e_unknown, e_rc4, e_aes };