aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-05-15 19:10:10 +0200
committerJay Berkenbilt <ejb@ql.org>2022-05-20 13:54:09 +0200
commit9064542b5f23bde3e7d6826b5b5e8b0a6f356434 (patch)
treeaa7e28b3512f754b14afc3ef3f4454db13c42c22 /include
parent7fa5d1773b599df51df21658dff53f5b66fdbba8 (diff)
downloadqpdf-9064542b5f23bde3e7d6826b5b5e8b0a6f356434.tar.zst
Add private methods for reserving specific objects
Diffstat (limited to 'include')
-rw-r--r--include/qpdf/QPDF.hh1
-rw-r--r--include/qpdf/QPDFObjectHandle.hh7
2 files changed, 8 insertions, 0 deletions
diff --git a/include/qpdf/QPDF.hh b/include/qpdf/QPDF.hh
index 2e24b261..b547fcbd 100644
--- a/include/qpdf/QPDF.hh
+++ b/include/qpdf/QPDF.hh
@@ -1079,6 +1079,7 @@ class QPDF
std::shared_ptr<QPDFObject> resolve(int objid, int generation);
void resolveObjectsInStream(int obj_stream_number);
void stopOnError(std::string const& message);
+ QPDFObjectHandle reserveObjectIfNotExists(int objid, int gen);
// Calls finish() on the pipeline when done but does not delete it
bool pipeStreamData(
diff --git a/include/qpdf/QPDFObjectHandle.hh b/include/qpdf/QPDFObjectHandle.hh
index 70c7cf54..ec4a9699 100644
--- a/include/qpdf/QPDFObjectHandle.hh
+++ b/include/qpdf/QPDFObjectHandle.hh
@@ -1444,6 +1444,12 @@ class QPDFObjectHandle
return QPDFObjectHandle::newStream(
qpdf, objid, generation, stream_dict, offset, length);
}
+ // Reserve an object with a specific ID
+ static QPDFObjectHandle
+ makeReserved()
+ {
+ return QPDFObjectHandle::makeReserved();
+ }
};
friend class Factory;
@@ -1561,6 +1567,7 @@ class QPDFObjectHandle
QPDFObjectHandle stream_dict,
qpdf_offset_t offset,
size_t length);
+ static QPDFObjectHandle makeReserved();
void typeWarning(char const* expected_type, std::string const& warning);
void objectWarning(std::string const& warning);