diff options
author | Jay Berkenbilt <ejb@ql.org> | 2022-01-30 14:18:04 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2022-01-31 21:57:45 +0100 |
commit | ce3406e93f0de0946d2abed6179579caf1433d4e (patch) | |
tree | 71959581731cb1ddcafa0866c87b2346c177dffb /libqpdf | |
parent | 11a86e444da4ffcb0d5aa5203fda2d0ebc001a7c (diff) | |
download | qpdf-ce3406e93f0de0946d2abed6179579caf1433d4e.tar.zst |
JSONHandler: pass JSON object to dict start function
If some keys depend on others, we have to check up front since there
is no control of what order key handlers will be called. Anyway, keys
are unordered in json, so we don't want to depend on ordering.
Diffstat (limited to 'libqpdf')
-rw-r--r-- | libqpdf/JSONHandler.cc | 4 | ||||
-rw-r--r-- | libqpdf/qpdf/JSONHandler.hh | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/libqpdf/JSONHandler.cc b/libqpdf/JSONHandler.cc index 28e97218..121ae8a2 100644 --- a/libqpdf/JSONHandler.cc +++ b/libqpdf/JSONHandler.cc @@ -49,7 +49,7 @@ JSONHandler::addBoolHandler(bool_handler_t fn) } void -JSONHandler::addDictHandlers(void_handler_t start_fn, void_handler_t end_fn) +JSONHandler::addDictHandlers(json_handler_t start_fn, void_handler_t end_fn) { this->m->h.dict_start_handler = start_fn; this->m->h.dict_end_handler = end_fn; @@ -111,7 +111,7 @@ JSONHandler::handle(std::string const& path, JSON j) } if (this->m->h.dict_start_handler && j.isDictionary()) { - this->m->h.dict_start_handler(path); + this->m->h.dict_start_handler(path, j); std::string path_base = path; if (path_base != ".") { diff --git a/libqpdf/qpdf/JSONHandler.hh b/libqpdf/qpdf/JSONHandler.hh index dbea505f..2db951b5 100644 --- a/libqpdf/qpdf/JSONHandler.hh +++ b/libqpdf/qpdf/JSONHandler.hh @@ -58,7 +58,7 @@ class JSONHandler void addBoolHandler(bool_handler_t fn); QPDF_DLL - void addDictHandlers(void_handler_t start_fn, void_handler_t end_fn); + void addDictHandlers(json_handler_t start_fn, void_handler_t end_fn); QPDF_DLL void addDictKeyHandler( std::string const& key, std::shared_ptr<JSONHandler>); @@ -100,7 +100,7 @@ class JSONHandler string_handler_t string_handler; string_handler_t number_handler; bool_handler_t bool_handler; - void_handler_t dict_start_handler; + json_handler_t dict_start_handler; void_handler_t dict_end_handler; void_handler_t array_start_handler; void_handler_t array_end_handler; |