diff options
author | Jay Berkenbilt <ejb@ql.org> | 2022-01-18 00:38:05 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2022-01-30 19:11:03 +0100 |
commit | aa0a379b37889caad022ec12fba76990b2e2e2d9 (patch) | |
tree | 6b8ca4c09078fca819dfcd0b374c78dfb1833ec3 /libqpdf | |
parent | 5c5e5ca29b20877614d9b1c025b86707e67e548b (diff) | |
download | qpdf-aa0a379b37889caad022ec12fba76990b2e2e2d9.tar.zst |
Add JSON::isDictionary and JSON::isArray
Diffstat (limited to 'libqpdf')
-rw-r--r-- | libqpdf/JSON.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libqpdf/JSON.cc b/libqpdf/JSON.cc index f75935aa..c656bb14 100644 --- a/libqpdf/JSON.cc +++ b/libqpdf/JSON.cc @@ -294,6 +294,20 @@ JSON::makeNull() } bool +JSON::isArray() const +{ + return nullptr != dynamic_cast<JSON_array const*>( + this->m->value.getPointer()); +} + +bool +JSON::isDictionary() const +{ + return nullptr != dynamic_cast<JSON_dictionary const*>( + this->m->value.getPointer()); +} + +bool JSON::checkSchema(JSON schema, std::list<std::string>& errors) { return checkSchemaInternal(this->m->value.getPointer(), |