diff options
author | Tobias Hoffmann <thobi@worker> | 2012-06-27 06:00:58 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2012-06-27 16:19:57 +0200 |
commit | 43c404b45ab54583a33492adc93f54fa349c2f94 (patch) | |
tree | da195c74239078c5a52b3f7be4c2477d6eea9f0b /include | |
parent | 75054c0b9404572f2c1477858fe47a61404b72f5 (diff) | |
download | qpdf-43c404b45ab54583a33492adc93f54fa349c2f94.tar.zst |
Add QPDFObjectHandle::newStream(QPDF *, std::string const&)
This makes the code simpler than having to create a buffer of a fixed
size and copy the string to it.
Diffstat (limited to 'include')
-rw-r--r-- | include/qpdf/QPDFObjectHandle.hh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/qpdf/QPDFObjectHandle.hh b/include/qpdf/QPDFObjectHandle.hh index 350381b6..8cfe56f3 100644 --- a/include/qpdf/QPDFObjectHandle.hh +++ b/include/qpdf/QPDFObjectHandle.hh @@ -142,6 +142,12 @@ class QPDFObjectHandle QPDF_DLL static QPDFObjectHandle newStream(QPDF* qpdf, PointerHolder<Buffer> data); + // Create new stream with data from string. This method will + // create a copy of the data rather than using the user-provided + // buffer as in the PointerHolder<Buffer> version of newStream. + QPDF_DLL + static QPDFObjectHandle newStream(QPDF* qpdf, std::string const& data); + // Accessor methods. If an accessor method that is valid for only // a particular object type is called on an object of the wrong // type, an exception is thrown. |