aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2018-12-17 23:36:06 +0100
committerJay Berkenbilt <ejb@ql.org>2018-12-18 22:45:48 +0100
commit077d3d451204393d17b9a14c2145487c35fce572 (patch)
tree1d5d02895b95d3375ccac7cf24a0c6615d4a1c74 /libqpdf
parent9caf005d89f039b56f027d9fe20fe2f475927597 (diff)
downloadqpdf-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.cc12
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)
{