From 6670c685ab9f929121c5498115b278c95574e461 Mon Sep 17 00:00:00 2001 From: m-holger Date: Tue, 16 Aug 2022 13:59:32 +0100 Subject: Move QPDFObjectHandle::parseInternal to new class QPDFParser Part of #729 --- include/qpdf/QPDF.hh | 3 ++- include/qpdf/QPDFObjectHandle.hh | 21 ++++----------------- 2 files changed, 6 insertions(+), 18 deletions(-) (limited to 'include') diff --git a/include/qpdf/QPDF.hh b/include/qpdf/QPDF.hh index 7c389c1d..12d41eff 100644 --- a/include/qpdf/QPDF.hh +++ b/include/qpdf/QPDF.hh @@ -49,6 +49,7 @@ class QPDF_Stream; class BitStream; class BitWriter; class QPDFLogger; +class QPDFParser; class QPDF { @@ -881,7 +882,7 @@ class QPDF // resolution class ParseGuard { - friend class QPDFObjectHandle; + friend class QPDFParser; private: ParseGuard(QPDF* qpdf) : diff --git a/include/qpdf/QPDFObjectHandle.hh b/include/qpdf/QPDFObjectHandle.hh index 4b054928..8f38cb24 100644 --- a/include/qpdf/QPDFObjectHandle.hh +++ b/include/qpdf/QPDFObjectHandle.hh @@ -49,9 +49,12 @@ class QPDFTokenizer; class QPDFExc; class Pl_QPDFTokenizer; class QPDFMatrix; +class QPDFParser; class QPDFObjectHandle { + friend class QPDFParser; + public: // This class is used by replaceStreamData. It provides an // alternative way of associating stream data with a stream. See @@ -1563,15 +1566,6 @@ class QPDFObjectHandle QPDFObjectHandle(QPDF*, QPDFObjGen const& og); QPDFObjectHandle(std::shared_ptr const&); - enum parser_state_e { - st_top, - st_start, - st_stop, - st_eof, - st_dictionary, - st_array - }; - // Private object factory methods static QPDFObjectHandle newIndirect(QPDF*, QPDFObjGen const& og); static QPDFObjectHandle newStream( @@ -1599,14 +1593,7 @@ class QPDFObjectHandle std::string const&, std::shared_ptr, qpdf_offset_t); - static QPDFObjectHandle parseInternal( - std::shared_ptr input, - std::string const& object_description, - QPDFTokenizer& tokenizer, - bool& empty, - StringDecrypter* decrypter, - QPDF* context, - bool content_stream); + void setParsedOffset(qpdf_offset_t offset); void parseContentStream_internal( std::string const& description, ParserCallbacks* callbacks); -- cgit v1.2.3-54-g00ecf