diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/qpdf/QPDFObjectHandle.hh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/qpdf/QPDFObjectHandle.hh b/include/qpdf/QPDFObjectHandle.hh index 41646b79..cb4c5be6 100644 --- a/include/qpdf/QPDFObjectHandle.hh +++ b/include/qpdf/QPDFObjectHandle.hh @@ -30,6 +30,7 @@ #include <vector> #include <set> #include <map> +#include <functional> #include <qpdf/QPDFObjGen.hh> #include <qpdf/PointerHolder.hh> @@ -986,6 +987,26 @@ class QPDFObjectHandle QPDFObjectHandle const& filter, QPDFObjectHandle const& decode_parms); + // Starting in qpdf 10.2, you can use C++-11 function objects + // instead of StreamDataProvider. + + // The provider should write the stream data to the pipeline. For + // a one-liner to replace stream data with the contents of a file, + // pass QUtil::file_provider(filename) as provider. + QPDF_DLL + void replaceStreamData(std::function<void(Pipeline*)> provider, + QPDFObjectHandle const& filter, + QPDFObjectHandle const& decode_parms); + // The provider should write the stream data to the pipeline, + // returning true if it succeeded without errors. + QPDF_DLL + void replaceStreamData( + std::function<bool(Pipeline*, + bool suppress_warnings, + bool will_retry)> provider, + QPDFObjectHandle const& filter, + QPDFObjectHandle const& decode_parms); + // Access object ID and generation. For direct objects, return // object ID 0. |