diff options
author | Jay Berkenbilt <ejb@ql.org> | 2024-02-17 20:15:48 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2024-02-17 20:15:48 +0100 |
commit | e362bce8e86f4912eaa008bac06f9e2c19b72d3f (patch) | |
tree | 42fcd9eed699714f98ddee634763e4d670a2652b /include | |
parent | 5a29b7f9dd353c7baf2ca738bd2a56582a6525ea (diff) | |
parent | 413aba5bf2ef239d3abf024de3c819e153171035 (diff) | |
download | qpdf-e362bce8e86f4912eaa008bac06f9e2c19b72d3f.tar.zst |
Merge branch 'jw' from #1146 into work
Diffstat (limited to 'include')
-rw-r--r-- | include/qpdf/JSON.hh | 5 | ||||
-rw-r--r-- | include/qpdf/QPDF.hh | 13 | ||||
-rw-r--r-- | include/qpdf/QPDFJob.hh | 1 | ||||
-rw-r--r-- | include/qpdf/QPDFObjectHandle.hh | 9 |
4 files changed, 13 insertions, 15 deletions
diff --git a/include/qpdf/JSON.hh b/include/qpdf/JSON.hh index e3c8a7dc..3272800d 100644 --- a/include/qpdf/JSON.hh +++ b/include/qpdf/JSON.hh @@ -290,8 +290,11 @@ class JSON QPDF_DLL qpdf_offset_t getEnd() const; + // The following class does not form part of the public API and is for internal use only. + + class Writer; + private: - static std::string encode_string(std::string const& utf8); static void writeClose(Pipeline* p, bool first, size_t depth, char const* delimeter); enum value_type_e { diff --git a/include/qpdf/QPDF.hh b/include/qpdf/QPDF.hh index a836c3c9..04b11cba 100644 --- a/include/qpdf/QPDF.hh +++ b/include/qpdf/QPDF.hh @@ -1411,19 +1411,6 @@ class QPDF // JSON import void importJSON(std::shared_ptr<InputSource>, bool must_be_complete); - // JSON write - void writeJSONStream( - int version, - Pipeline* p, - bool& first, - std::string const& key, - QPDFObjectHandle&, - qpdf_stream_decode_level_e, - qpdf_json_stream_data_e, - std::string const& file_prefix); - void writeJSONObject( - int version, Pipeline* p, bool& first, std::string const& key, QPDFObjectHandle&); - // Type conversion helper methods template <typename T> static qpdf_offset_t diff --git a/include/qpdf/QPDFJob.hh b/include/qpdf/QPDFJob.hh index c291d1e8..b26a9dcf 100644 --- a/include/qpdf/QPDFJob.hh +++ b/include/qpdf/QPDFJob.hh @@ -551,7 +551,6 @@ class QPDFJob // JSON void doJSON(QPDF& pdf, Pipeline*); QPDFObjGen::set getWantedJSONObjects(); - void doJSONObject(Pipeline* p, bool& first, std::string const& key, QPDFObjectHandle&); void doJSONObjects(Pipeline* p, bool& first, QPDF& pdf); void doJSONObjectinfo(Pipeline* p, bool& first, QPDF& pdf); void doJSONPages(Pipeline* p, bool& first, QPDF& pdf); diff --git a/include/qpdf/QPDFObjectHandle.hh b/include/qpdf/QPDFObjectHandle.hh index b2835495..9ea329ff 100644 --- a/include/qpdf/QPDFObjectHandle.hh +++ b/include/qpdf/QPDFObjectHandle.hh @@ -1197,6 +1197,13 @@ class QPDFObjectHandle QPDF_DLL JSON getJSON(int json_version, bool dereference_indirect = false); + // Write the object encoded as JSON to a pipeline. This is equivalent to, but more efficient + // than, calling getJSON(json_version, dereference_indirect).write(p, depth). See the + // documentation for getJSON and JSON::write for further detail. + QPDF_DLL + void + writeJSON(int json_version, Pipeline* p, bool dereference_indirect = false, size_t depth = 0); + // Deprecated version uses v1 for backward compatibility. // ABI: remove for qpdf 12 [[deprecated("Use getJSON(int version)")]] QPDF_DLL JSON @@ -1353,6 +1360,8 @@ class QPDFObjectHandle return obj.get(); } + void writeJSON(int json_version, JSON::Writer& p, bool dereference_indirect = false); + private: QPDF_Array* asArray(); QPDF_Bool* asBool(); |