From e2737ab646bff6aa07ba72e0cc15cc955d9afcc0 Mon Sep 17 00:00:00 2001 From: m-holger Date: Fri, 9 Feb 2024 13:09:08 +0000 Subject: Add new writeJSON methods Create an alternative to getJSON to allow an object handle to be written as JSON without the overhead of creating a JSON object. --- libqpdf/QPDF_Null.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libqpdf/QPDF_Null.cc') diff --git a/libqpdf/QPDF_Null.cc b/libqpdf/QPDF_Null.cc index fdabdfa7..13118e8c 100644 --- a/libqpdf/QPDF_Null.cc +++ b/libqpdf/QPDF_Null.cc @@ -1,5 +1,6 @@ #include +#include #include QPDF_Null::QPDF_Null() : @@ -49,3 +50,9 @@ QPDF_Null::getJSON(int json_version) // If this is updated, QPDF_Array::getJSON must also be updated. return JSON::makeNull(); } + +void +QPDF_Null::writeJSON(int json_version, JSON::Writer& p) +{ + p << "null"; +} -- cgit v1.2.3-70-g09d2