summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2021-02-15 17:32:56 +0100
committerJay Berkenbilt <ejb@ql.org>2021-02-15 17:33:03 +0100
commita773f4c71d411754317c16140debec55fad88e16 (patch)
treede3641b4e5ef5738bbedc4e58d87d0f10cbe28f0 /include
parent7eb903d9aa797a207f5b1b115dce2296d348000b (diff)
downloadqpdf-a773f4c71d411754317c16140debec55fad88e16.tar.zst
Add QPDFObjectHandle::parse for strings with context
Diffstat (limited to 'include')
-rw-r--r--include/qpdf/QPDFObjectHandle.hh14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/qpdf/QPDFObjectHandle.hh b/include/qpdf/QPDFObjectHandle.hh
index cb4c5be6..efcd653a 100644
--- a/include/qpdf/QPDFObjectHandle.hh
+++ b/include/qpdf/QPDFObjectHandle.hh
@@ -379,6 +379,20 @@ class QPDFObjectHandle
static QPDFObjectHandle parse(std::string const& object_str,
std::string const& object_description = "");
+ // Construct an object of any type from a string representation of
+ // the object. Indirect object syntax (obj gen R) is allowed and
+ // will create indirect references within the passed-in context.
+ // If object_description is provided, it will appear in the
+ // message of any QPDFExc exception thrown for invalid syntax.
+ // Note that you can't parse an indirect object reference all by
+ // itself as parse will stop at the end of the first complete
+ // object, which will just be the first number and will report
+ // that there is trailing data at the end of the string.
+ QPDF_DLL
+ static QPDFObjectHandle parse(QPDF* context,
+ std::string const& object_str,
+ std::string const& object_description = "");
+
// Construct an object as above by reading from the given
// InputSource at its current position and using the tokenizer you
// supply. Indirect objects and encrypted strings are permitted.