aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorm-holger <m-holger@kubitscheck.org>2023-02-05 19:39:30 +0100
committerm-holger <m-holger@kubitscheck.org>2023-02-19 13:05:53 +0100
commita4f3dddb79e875bae74b8d4f3ebd6a94076e8a9e (patch)
tree2e9743e6df99c138ff717e47e9ef3eb2750a56b5 /include
parentb4c36d9b73bc9794ea70d935448b8555630c3004 (diff)
downloadqpdf-a4f3dddb79e875bae74b8d4f3ebd6a94076e8a9e.tar.zst
Change JSON_dictionary and JSON_array to store JSON objects rather than std::shared_ptr<JSON_value>
Recognise that JSON objects are effectively shared pointers to JSON_value.
Diffstat (limited to 'include')
-rw-r--r--include/qpdf/JSON.hh6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/qpdf/JSON.hh b/include/qpdf/JSON.hh
index 2906d85a..8cd4e2fe 100644
--- a/include/qpdf/JSON.hh
+++ b/include/qpdf/JSON.hh
@@ -54,6 +54,8 @@ class JSON
{
public:
static int constexpr LATEST = 2;
+
+ QPDF_DLL
JSON() = default;
QPDF_DLL
@@ -369,7 +371,7 @@ class JSON
}
virtual ~JSON_dictionary() = default;
virtual void write(Pipeline*, size_t depth) const;
- std::map<std::string, std::shared_ptr<JSON_value>> members;
+ std::map<std::string, JSON> members;
std::set<std::string> parsed_keys;
};
struct JSON_array: public JSON_value
@@ -380,7 +382,7 @@ class JSON
}
virtual ~JSON_array() = default;
virtual void write(Pipeline*, size_t depth) const;
- std::vector<std::shared_ptr<JSON_value>> elements;
+ std::vector<JSON> elements;
};
struct JSON_string: public JSON_value
{