diff options
author | Jay Berkenbilt <ejb@ql.org> | 2022-02-04 16:52:37 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2022-02-04 19:12:37 +0100 |
commit | f0c2e0ef1e2b10b19fea60d5e6580910a92092e1 (patch) | |
tree | 38ef8156e353b1d1e58d4d6b944a241ad8ec24f4 /include | |
parent | 9044a24097565c1a8eb542ae0eabb2539b3cc62b (diff) | |
download | qpdf-f0c2e0ef1e2b10b19fea60d5e6580910a92092e1.tar.zst |
JSON: use std::shared_ptr internally
Diffstat (limited to 'include')
-rw-r--r-- | include/qpdf/JSON.hh | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/include/qpdf/JSON.hh b/include/qpdf/JSON.hh index 4ec53f2f..5e2ed7d1 100644 --- a/include/qpdf/JSON.hh +++ b/include/qpdf/JSON.hh @@ -42,6 +42,7 @@ #include <vector> #include <list> #include <functional> +#include <memory> class JSON { @@ -156,13 +157,13 @@ class JSON { virtual ~JSON_dictionary(); virtual std::string unparse(size_t depth) const; - std::map<std::string, PointerHolder<JSON_value> > members; + std::map<std::string, std::shared_ptr<JSON_value>> members; }; struct JSON_array: public JSON_value { virtual ~JSON_array(); virtual std::string unparse(size_t depth) const; - std::vector<PointerHolder<JSON_value> > elements; + std::vector<std::shared_ptr<JSON_value>> elements; }; struct JSON_string: public JSON_value { @@ -194,7 +195,7 @@ class JSON virtual std::string unparse(size_t depth) const; }; - JSON(PointerHolder<JSON_value>); + JSON(std::shared_ptr<JSON_value>); static bool checkSchemaInternal(JSON_value* this_v, JSON_value* sch_v, @@ -211,10 +212,10 @@ class JSON ~Members(); private: - Members(PointerHolder<JSON_value>); + Members(std::shared_ptr<JSON_value>); Members(Members const&); - PointerHolder<JSON_value> value; + std::shared_ptr<JSON_value> value; }; PointerHolder<Members> m; |