aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/JSON.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2024-02-17 20:15:48 +0100
committerJay Berkenbilt <ejb@ql.org>2024-02-17 20:15:48 +0100
commite362bce8e86f4912eaa008bac06f9e2c19b72d3f (patch)
tree42fcd9eed699714f98ddee634763e4d670a2652b /libqpdf/JSON.cc
parent5a29b7f9dd353c7baf2ca738bd2a56582a6525ea (diff)
parent413aba5bf2ef239d3abf024de3c819e153171035 (diff)
downloadqpdf-e362bce8e86f4912eaa008bac06f9e2c19b72d3f.tar.zst
Merge branch 'jw' from #1146 into work
Diffstat (limited to 'libqpdf/JSON.cc')
-rw-r--r--libqpdf/JSON.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/libqpdf/JSON.cc b/libqpdf/JSON.cc
index 27405df7..bc28f236 100644
--- a/libqpdf/JSON.cc
+++ b/libqpdf/JSON.cc
@@ -1,5 +1,7 @@
#include <qpdf/JSON.hh>
+#include <qpdf/JSON_writer.hh>
+
#include <qpdf/BufferInputSource.hh>
#include <qpdf/Pl_Base64.hh>
#include <qpdf/Pl_Concatenate.hh>
@@ -119,7 +121,7 @@ JSON::JSON_array::write(Pipeline* p, size_t depth) const
JSON::JSON_string::JSON_string(std::string const& utf8) :
JSON_value(vt_string),
utf8(utf8),
- encoded(encode_string(utf8))
+ encoded(Writer::encode_string(utf8))
{
}
@@ -211,7 +213,7 @@ JSON::unparse() const
}
std::string
-JSON::encode_string(std::string const& str)
+JSON::Writer::encode_string(std::string const& str)
{
static auto constexpr hexchars = "0123456789abcdef";
@@ -279,7 +281,7 @@ JSON
JSON::addDictionaryMember(std::string const& key, JSON const& val)
{
if (auto* obj = m ? dynamic_cast<JSON_dictionary*>(m->value.get()) : nullptr) {
- return obj->members[encode_string(key)] = val.m ? val : makeNull();
+ return obj->members[Writer::encode_string(key)] = val.m ? val : makeNull();
} else {
throw std::runtime_error("JSON::addDictionaryMember called on non-dictionary");
}