mirror of
https://github.com/qpdf/qpdf.git
synced 2024-06-03 19:00:51 +00:00
Add JSON::isDictionary and JSON::isArray
This commit is contained in:
parent
5c5e5ca29b
commit
aa0a379b37
|
@ -4,6 +4,10 @@
|
||||||
to QPDFObjectHandle with corresponding functions added to the C
|
to QPDFObjectHandle with corresponding functions added to the C
|
||||||
API. Thanks to m-holger for the contribution.
|
API. Thanks to m-holger for the contribution.
|
||||||
|
|
||||||
|
2022-01-17 Jay Berkenbilt <ejb@ql.org>
|
||||||
|
|
||||||
|
* Add isDictionary and isArray to JSON
|
||||||
|
|
||||||
2022-01-11 Jay Berkenbilt <ejb@ql.org>
|
2022-01-11 Jay Berkenbilt <ejb@ql.org>
|
||||||
|
|
||||||
* Bug fix: add missing characters from PDF doc encoding.
|
* Bug fix: add missing characters from PDF doc encoding.
|
||||||
|
|
|
@ -69,6 +69,12 @@ class JSON
|
||||||
QPDF_DLL
|
QPDF_DLL
|
||||||
static JSON makeNull();
|
static JSON makeNull();
|
||||||
|
|
||||||
|
QPDF_DLL
|
||||||
|
bool isArray() const;
|
||||||
|
|
||||||
|
QPDF_DLL
|
||||||
|
bool isDictionary() const;
|
||||||
|
|
||||||
// Check this JSON object against a "schema". This is not a schema
|
// Check this JSON object against a "schema". This is not a schema
|
||||||
// according to any standard. It's just a template of what the
|
// according to any standard. It's just a template of what the
|
||||||
// JSON is supposed to contain. The checking does the following:
|
// JSON is supposed to contain. The checking does the following:
|
||||||
|
|
|
@ -293,6 +293,20 @@ JSON::makeNull()
|
||||||
return JSON(new JSON_null());
|
return JSON(new JSON_null());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
bool
|
||||||
JSON::checkSchema(JSON schema, std::list<std::string>& errors)
|
JSON::checkSchema(JSON schema, std::list<std::string>& errors)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user