From 16f4f94cd99b4d0f633596074e8d9358db135517 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sat, 7 May 2022 07:53:45 -0400 Subject: Prepare code for JSON v2 Update getJSON() methods and calls to them --- libqpdf/QPDFObjectHandle.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'libqpdf/QPDFObjectHandle.cc') diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc index 05a0f30d..33155097 100644 --- a/libqpdf/QPDFObjectHandle.cc +++ b/libqpdf/QPDFObjectHandle.cc @@ -1775,8 +1775,15 @@ QPDFObjectHandle::unparseBinary() } } +// Deprecated versionless getJSON to be removed in qpdf 12 JSON QPDFObjectHandle::getJSON(bool dereference_indirect) +{ + return getJSON(1, dereference_indirect); +} + +JSON +QPDFObjectHandle::getJSON(int json_version, bool dereference_indirect) { if ((!dereference_indirect) && this->isIndirect()) { return JSON::makeString(unparse()); @@ -1786,7 +1793,7 @@ QPDFObjectHandle::getJSON(bool dereference_indirect) throw std::logic_error( "QPDFObjectHandle: attempting to unparse a reserved object"); } - return this->obj->getJSON(); + return this->obj->getJSON(json_version); } } -- cgit v1.2.3-70-g09d2