aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/qpdf/JSON.hh10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/qpdf/JSON.hh b/include/qpdf/JSON.hh
index e711a2df..e6857ca6 100644
--- a/include/qpdf/JSON.hh
+++ b/include/qpdf/JSON.hh
@@ -42,6 +42,7 @@
#include <list>
#include <map>
#include <memory>
+#include <set>
#include <string>
#include <vector>
@@ -149,6 +150,14 @@ class JSON
QPDF_DLL
bool isDictionary() const;
+ // If the key is already in the dictionary, return true.
+ // Otherwise, mark it has seen and return false. This is primarily
+ // intended to used by the parser to detect duplicate keys when
+ // the reactor blocks them from being added to the final
+ // dictionary.
+ QPDF_DLL
+ bool checkDictionaryKeySeen(std::string const& key);
+
// Accessors. Accessor behavior:
//
// - If argument is wrong type, including null, return false
@@ -314,6 +323,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::set<std::string> parsed_keys;
};
struct JSON_array: public JSON_value
{