aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFObjectHandle.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2012-06-22 15:46:33 +0200
committerJay Berkenbilt <ejb@ql.org>2012-06-22 15:46:33 +0200
commitb6bdc0f5950287c1c9e76115bdec230dcf99b964 (patch)
tree5912f9a181e4350e7fd39867523081cd7d1327b4 /libqpdf/QPDFObjectHandle.cc
parenta0768e419064b66ea6eb3e06a4398806b24311e8 (diff)
downloadqpdf-b6bdc0f5950287c1c9e76115bdec230dcf99b964.tar.zst
Add factory methods for creating empty arrays and dictionaries.
Also updated pdf_from_scratch test driver to use the new factories, and made some cosmetic improvements and documentation updates for the emptyPDF() method.
Diffstat (limited to 'libqpdf/QPDFObjectHandle.cc')
-rw-r--r--libqpdf/QPDFObjectHandle.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc
index 1c2481f8..d0d911f7 100644
--- a/libqpdf/QPDFObjectHandle.cc
+++ b/libqpdf/QPDFObjectHandle.cc
@@ -616,12 +616,24 @@ QPDFObjectHandle::newString(std::string const& str)
}
QPDFObjectHandle
+QPDFObjectHandle::newArray()
+{
+ return newArray(std::vector<QPDFObjectHandle>());
+}
+
+QPDFObjectHandle
QPDFObjectHandle::newArray(std::vector<QPDFObjectHandle> const& items)
{
return QPDFObjectHandle(new QPDF_Array(items));
}
QPDFObjectHandle
+QPDFObjectHandle::newDictionary()
+{
+ return newDictionary(std::map<std::string, QPDFObjectHandle>());
+}
+
+QPDFObjectHandle
QPDFObjectHandle::newDictionary(
std::map<std::string, QPDFObjectHandle> const& items)
{