diff options
author | Jay Berkenbilt <ejb@ql.org> | 2019-08-23 01:16:25 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2019-08-23 04:54:29 +0200 |
commit | 3f1ab640669ac493f1b2985b70322dba7c037ac9 (patch) | |
tree | 0da24ed76b73a365455c78f3f9a75f66b92cf8f6 /include | |
parent | 4b2e72c4cd7dc9bc17ad78ca983ff884c1e1ee69 (diff) | |
download | qpdf-3f1ab640669ac493f1b2985b70322dba7c037ac9.tar.zst |
Pass offset and length to ParserCallbacks::handleObject
Diffstat (limited to 'include')
-rw-r--r-- | include/qpdf/QPDFObjectHandle.hh | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/include/qpdf/QPDFObjectHandle.hh b/include/qpdf/QPDFObjectHandle.hh index 58708f72..08782a89 100644 --- a/include/qpdf/QPDFObjectHandle.hh +++ b/include/qpdf/QPDFObjectHandle.hh @@ -159,16 +159,28 @@ class QPDFObjectHandle // This class is used by parsePageContents. Callers must // instantiate a subclass of this with handlers defined to accept // QPDFObjectHandles that are parsed from the stream. - class ParserCallbacks + class QPDF_DLL_CLASS ParserCallbacks { public: QPDF_DLL virtual ~ParserCallbacks() { } - virtual void handleObject(QPDFObjectHandle) = 0; + // One of the handleObject methods must be overridden. + QPDF_DLL + virtual void handleObject(QPDFObjectHandle); + QPDF_DLL + virtual void handleObject( + QPDFObjectHandle, size_t offset, size_t length); + virtual void handleEOF() = 0; + // Override this if you want to know the full size of the + // contents, possibly after concatenation of multiple streams. + // This is called before the first call to handleObject. + QPDF_DLL + virtual void contentSize(size_t); + protected: // Implementors may call this method during parsing to // terminate parsing early. This method throws an exception |