diff options
author | Tobias Hoffmann <thobi@worker> | 2012-06-18 22:38:59 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2012-06-20 21:29:44 +0200 |
commit | db7474e0facd82577edfc1cc4883bce3fa588584 (patch) | |
tree | b1f472ddadab0c95747b3963d84682f9d5b17b06 /libqpdf/QPDFObjectHandle.cc | |
parent | b2e681893503d7f51679b96a3b7be580bb6d362b (diff) | |
download | qpdf-db7474e0facd82577edfc1cc4883bce3fa588584.tar.zst |
Added additional array mutators
Added methods to append to arrays, insert items into arrays, and
replace array contents with a vector of items.
Diffstat (limited to 'libqpdf/QPDFObjectHandle.cc')
-rw-r--r-- | libqpdf/QPDFObjectHandle.cc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc index 55f1bf6f..53d9414c 100644 --- a/libqpdf/QPDFObjectHandle.cc +++ b/libqpdf/QPDFObjectHandle.cc @@ -262,6 +262,34 @@ QPDFObjectHandle::setArrayItem(int n, QPDFObjectHandle const& item) return dynamic_cast<QPDF_Array*>(obj.getPointer())->setItem(n, item); } +void +QPDFObjectHandle::setArrayFromVector(std::vector<QPDFObjectHandle> const& items) +{ + assertType("Array", isArray()); + return dynamic_cast<QPDF_Array*>(obj.getPointer())->setFromVector(items); +} + +void +QPDFObjectHandle::insertItem(int at, QPDFObjectHandle const& item) +{ + assertType("Array", isArray()); + return dynamic_cast<QPDF_Array*>(obj.getPointer())->insertItem(at, item); +} + +void +QPDFObjectHandle::appendItem(QPDFObjectHandle const& item) +{ + assertType("Array", isArray()); + return dynamic_cast<QPDF_Array*>(obj.getPointer())->appendItem(item); +} + +void +QPDFObjectHandle::eraseItem(int at) +{ + assertType("Array", isArray()); + return dynamic_cast<QPDF_Array*>(obj.getPointer())->eraseItem(at); +} + // Dictionary accessors bool |