aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2019-01-26 00:15:23 +0100
committerJay Berkenbilt <ejb@ql.org>2019-01-27 13:50:30 +0100
commit8cb245739c76a1766473174500275d5d8b215d98 (patch)
tree283d752d2967adad8699e8e3ccca6fbb1d97692b /include
parent009767d97a0dfebbb9bb71efb4b894b25fb59dd8 (diff)
downloadqpdf-8cb245739c76a1766473174500275d5d8b215d98.tar.zst
Add QPDFObjectHandle::getUniqueResourceName
Diffstat (limited to 'include')
-rw-r--r--include/qpdf/QPDFObjectHandle.hh12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/qpdf/QPDFObjectHandle.hh b/include/qpdf/QPDFObjectHandle.hh
index d6bb1a3b..b181bd79 100644
--- a/include/qpdf/QPDFObjectHandle.hh
+++ b/include/qpdf/QPDFObjectHandle.hh
@@ -600,6 +600,18 @@ class QPDFObjectHandle
QPDF_DLL
std::set<std::string> getResourceNames();
+ // Find a unique name within a resource dictionary starting with a
+ // given prefix. This method works by appending a number to the
+ // given prefix. It searches starting with min_suffix and sets
+ // min_suffix to selected value upon return. This can be used to
+ // increase efficiency if adding multiple items with the same
+ // prefix. (Why doesn't it set min_suffix to the next number?
+ // Well, maybe you aren't going to actually use the name it
+ // returns.)
+ QPDF_DLL
+ std::string getUniqueResourceName(std::string const& prefix,
+ int& min_suffix);
+
// Return the QPDF object that owns an indirect object. Returns
// null for a direct object.
QPDF_DLL