diff options
author | Jay Berkenbilt <ejb@ql.org> | 2018-12-17 23:36:06 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2018-12-18 22:45:48 +0100 |
commit | 077d3d451204393d17b9a14c2145487c35fce572 (patch) | |
tree | 1d5d02895b95d3375ccac7cf24a0c6615d4a1c74 /libqpdf | |
parent | 9caf005d89f039b56f027d9fe20fe2f475927597 (diff) | |
download | qpdf-077d3d451204393d17b9a14c2145487c35fce572.tar.zst |
Add QPDFObjectHandle::wrapInArray()
Wrap an object in an array if it is not already an array.
Diffstat (limited to 'libqpdf')
-rw-r--r-- | libqpdf/QPDFObjectHandle.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc index f4a8a0a4..f26ee931 100644 --- a/libqpdf/QPDFObjectHandle.cc +++ b/libqpdf/QPDFObjectHandle.cc @@ -1236,6 +1236,18 @@ QPDFObjectHandle::unparseBinary() } QPDFObjectHandle +QPDFObjectHandle::wrapInArray() +{ + if (isArray()) + { + return *this; + } + QPDFObjectHandle result = QPDFObjectHandle::newArray(); + result.appendItem(*this); + return result; +} + +QPDFObjectHandle QPDFObjectHandle::parse(std::string const& object_str, std::string const& object_description) { |