From da14ab4dc7b1caee1708483cf714683f7d811ca7 Mon Sep 17 00:00:00 2001 From: m-holger Date: Thu, 9 Feb 2023 12:43:56 +0000 Subject: Move definition of QPDF::JSONReactor into QPDF_json Allow access to private header files when defining data members. --- include/qpdf/QPDF.hh | 69 +--------------------------------------------------- 1 file changed, 1 insertion(+), 68 deletions(-) (limited to 'include') diff --git a/include/qpdf/QPDF.hh b/include/qpdf/QPDF.hh index b227bb37..54af0d17 100644 --- a/include/qpdf/QPDF.hh +++ b/include/qpdf/QPDF.hh @@ -32,7 +32,6 @@ #include #include #include -#include #include #include @@ -51,7 +50,6 @@ class BitStream; class BitWriter; class QPDFLogger; class QPDFParser; -struct JSON_Descr; class QPDF { @@ -1110,72 +1108,7 @@ class QPDF std::set::const_iterator iter; }; - class JSONReactor: public JSON::Reactor - { - public: - JSONReactor( - QPDF&, std::shared_ptr is, bool must_be_complete); - virtual ~JSONReactor() = default; - virtual void dictionaryStart() override; - virtual void arrayStart() override; - virtual void containerEnd(JSON const& value) override; - virtual void topLevelScalar() override; - virtual bool - dictionaryItem(std::string const& key, JSON const& value) override; - virtual bool arrayItem(JSON const& value) override; - - bool anyErrors() const; - - private: - enum state_e { - st_initial, - st_top, - st_qpdf, - st_qpdf_meta, - st_objects, - st_trailer, - st_object_top, - st_stream, - st_object, - st_ignore, - }; - - void containerStart(); - void nestedState(std::string const& key, JSON const& value, state_e); - void setObjectDescription(QPDFObjectHandle& oh, JSON const& value); - QPDFObjectHandle makeObject(JSON const& value); - void error(qpdf_offset_t offset, std::string const& message); - QPDFObjectHandle reserveObject(int obj, int gen); - void replaceObject( - QPDFObjectHandle to_replace, - QPDFObjectHandle replacement, - JSON const& value); - - QPDF& pdf; - std::shared_ptr is; - bool must_be_complete; - std::shared_ptr> descr; - bool errors; - bool parse_error; - bool saw_qpdf; - bool saw_qpdf_meta; - bool saw_objects; - bool saw_json_version; - bool saw_pdf_version; - bool saw_trailer; - state_e state; - state_e next_state; - std::string cur_object; - bool saw_value; - bool saw_stream; - bool saw_dict; - bool saw_data; - bool saw_datafile; - bool this_stream_needs_data; - std::vector state_stack; - std::vector object_stack; - std::set reserved; - }; + class JSONReactor; void parse(char const* password); void inParse(bool); -- cgit v1.2.3-54-g00ecf