From cee2592ed1f1c8ac5ca3048c48ac082e47358a6b Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Wed, 10 Jul 2013 11:07:40 -0400 Subject: Change API/ABI and withdraw 4.2.0 4.2.0 was binary incompatible in spite of there being no deletions or changes to any public methods. As such, we have to bump the ABI and are fixing some API breakage while we're at it. Previous 4.3.0 target is now 5.1.0. --- include/qpdf/QPDF.hh | 107 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 68 insertions(+), 39 deletions(-) (limited to 'include') diff --git a/include/qpdf/QPDF.hh b/include/qpdf/QPDF.hh index b90dea3b..e30e467b 100644 --- a/include/qpdf/QPDF.hh +++ b/include/qpdf/QPDF.hh @@ -411,45 +411,6 @@ class QPDF void optimize(std::map const& object_stream_data, bool allow_changes = true); - // For QPDFWriter: - - // Get lists of all objects in order according to the part of a - // linearized file that they belong to. - QPDF_DLL - void getLinearizedParts( - std::map const& object_stream_data, - std::vector& part4, - std::vector& part6, - std::vector& part7, - std::vector& part8, - std::vector& part9); - - QPDF_DLL - void generateHintStream(std::map const& xref, - std::map const& lengths, - std::map const& obj_renumber, - PointerHolder& hint_stream, - int& S, int& O); - - // Map object to object stream that contains it - QPDF_DLL - void getObjectStreamData(std::map&); - - // Get a list of objects that would be permitted in an object - // stream. - QPDF_DLL - std::vector getCompressibleObjGens(); - - // Deprecated: get a list of objects that would be permitted in an - // object stream. This method is deprecated and will be removed. - // It's incorrect because it disregards the generations of the - // compressible objects, which can lead (and has lead) to bugs. - // This method will throw an exception if any of the objects - // returned have a generation of other than zero. Use - // getCompressibleObjGens() instead. - QPDF_DLL - std::vector getCompressibleObjects(); - // Convenience routines for common functions. See also // QPDFObjectHandle.hh for additional convenience routines. @@ -504,6 +465,49 @@ class QPDF QPDF_DLL void removePage(QPDFObjectHandle page); + // Writer class is restricted to QPDFWriter so that only it can + // call certain methods. + class Writer + { + friend class QPDFWriter; + private: + + static void getLinearizedParts( + QPDF& qpdf, + std::map const& object_stream_data, + std::vector& part4, + std::vector& part6, + std::vector& part7, + std::vector& part8, + std::vector& part9) + { + qpdf.getLinearizedParts(object_stream_data, + part4, part6, part7, part8, part9); + } + + static void generateHintStream( + QPDF& qpdf, + std::map const& xref, + std::map const& lengths, + std::map const& obj_renumber, + PointerHolder& hint_stream, + int& S, int& O) + { + return qpdf.generateHintStream(xref, lengths, obj_renumber, + hint_stream, S, O); + } + + static void getObjectStreamData(QPDF& qpdf, std::map& omap) + { + qpdf.getObjectStreamData(omap); + } + + static std::vector getCompressibleObjGens(QPDF& qpdf) + { + return qpdf.getCompressibleObjGens(); + } + }; + // Resolver class is restricted to QPDFObjectHandle so that only // it can resolve indirect references. class Resolver @@ -635,6 +639,31 @@ class QPDF QPDFObjectHandle dict, Pipeline* pipeline); + // For QPDFWriter: + + // Get lists of all objects in order according to the part of a + // linearized file that they belong to. + void getLinearizedParts( + std::map const& object_stream_data, + std::vector& part4, + std::vector& part6, + std::vector& part7, + std::vector& part8, + std::vector& part9); + + void generateHintStream(std::map const& xref, + std::map const& lengths, + std::map const& obj_renumber, + PointerHolder& hint_stream, + int& S, int& O); + + // Map object to object stream that contains it + void getObjectStreamData(std::map&); + + // Get a list of objects that would be permitted in an object + // stream. + std::vector getCompressibleObjGens(); + // methods to support page handling void getAllPagesInternal(QPDFObjectHandle cur_pages, -- cgit v1.2.3-54-g00ecf