diff options
author | Jay Berkenbilt <ejb@ql.org> | 2018-12-17 23:40:29 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2018-12-22 00:34:56 +0100 |
commit | 30a0c070e41212172f5516936594ec0f6e72ac70 (patch) | |
tree | 86ee45692ce7f54e3298d84f20a86fd482afbbaa /libqpdf/QPDF_Dictionary.cc | |
parent | 651179b5da0777f861e427f96fd8560bf1516ae5 (diff) | |
download | qpdf-30a0c070e41212172f5516936594ec0f6e72ac70.tar.zst |
Add QPDFObjectHandle::getJSON()
Diffstat (limited to 'libqpdf/QPDF_Dictionary.cc')
-rw-r--r-- | libqpdf/QPDF_Dictionary.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libqpdf/QPDF_Dictionary.cc b/libqpdf/QPDF_Dictionary.cc index df640354..1301d46f 100644 --- a/libqpdf/QPDF_Dictionary.cc +++ b/libqpdf/QPDF_Dictionary.cc @@ -39,6 +39,20 @@ QPDF_Dictionary::unparse() return result; } +JSON +QPDF_Dictionary::getJSON() +{ + JSON j = JSON::makeDictionary(); + for (std::map<std::string, QPDFObjectHandle>::iterator iter = + this->items.begin(); + iter != this->items.end(); ++iter) + { + j.addDictionaryMember(QPDF_Name::normalizeName((*iter).first), + (*iter).second.getJSON()); + } + return j; +} + QPDFObject::object_type_e QPDF_Dictionary::getTypeCode() const { |