diff options
author | Jay Berkenbilt <ejb@ql.org> | 2022-04-09 20:49:10 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2022-04-09 23:33:29 +0200 |
commit | ba0ef7a124e9aecc2d0113598c851bae4710b887 (patch) | |
tree | 5dec35b3d51effc43e55ff3ba0b1ca3f274eea17 /examples/pdf-custom-filter.cc | |
parent | a68703b07e928be0eeb909c0e777e13e88cbf86d (diff) | |
download | qpdf-ba0ef7a124e9aecc2d0113598c851bae4710b887.tar.zst |
Replace PointerHolder with std::shared_ptr in the rest of the code
Increase to POINTERHOLDER_TRANSITION=3
patrepl s/PointerHolder/std::shared_ptr/g **/*.cc **/*.hh
patrepl s/make_pointer_holder/std::make_shared/g **/*.cc
patrepl s/make_array_pointer_holder/QUtil::make_shared_array/g **/*.cc
patrepl s,qpdf/std::shared_ptr,qpdf/PointerHolder, **/*.cc **/*.hh
git restore include/qpdf/PointerHolder.hh
git restore libtests/pointer_holder.cc
cleanpatch
./format-code
Diffstat (limited to 'examples/pdf-custom-filter.cc')
-rw-r--r-- | examples/pdf-custom-filter.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/pdf-custom-filter.cc b/examples/pdf-custom-filter.cc index b6d88684..72aa93b5 100644 --- a/examples/pdf-custom-filter.cc +++ b/examples/pdf-custom-filter.cc @@ -205,7 +205,7 @@ class StreamReplacer: public QPDFObjectHandle::StreamDataProvider void registerStream( QPDFObjectHandle stream, - PointerHolder<QPDFObjectHandle::StreamDataProvider> self); + std::shared_ptr<QPDFObjectHandle::StreamDataProvider> self); private: bool maybeReplace( @@ -283,7 +283,7 @@ StreamReplacer::maybeReplace( // make all its decisions from the stream dictionary. However, // it's a good idea to make sure we can retrieve the filtered data // if we are going to need it later. - PointerHolder<Buffer> out; + std::shared_ptr<Buffer> out; try { out = stream.getStreamData(); } catch (...) { @@ -321,7 +321,7 @@ StreamReplacer::maybeReplace( void StreamReplacer::registerStream( QPDFObjectHandle stream, - PointerHolder<QPDFObjectHandle::StreamDataProvider> self) + std::shared_ptr<QPDFObjectHandle::StreamDataProvider> self) { QPDFObjGen og(stream.getObjGen()); @@ -409,10 +409,10 @@ process( qpdf.processFile(infilename); // Create a single StreamReplacer instance. The interface requires - // a PointerHolder in various places, so allocate a StreamReplacer - // and stash it in a PointerHolder. + // a std::shared_ptr in various places, so allocate a StreamReplacer + // and stash it in a std::shared_ptr. StreamReplacer* replacer = new StreamReplacer(&qpdf); - PointerHolder<QPDFObjectHandle::StreamDataProvider> p(replacer); + std::shared_ptr<QPDFObjectHandle::StreamDataProvider> p(replacer); for (auto& o : qpdf.getAllObjects()) { if (o.isStream()) { |