From 1a8c2eb93b3116a3057e8009b8cbd7510abaf138 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sat, 22 Jan 2022 17:37:51 -0500 Subject: QPDFJob: use std::shared_ptr over PointerHolder where possible Also fix QPDFArgParser --- include/qpdf/QPDFArgParser.hh | 12 ++++++------ include/qpdf/QPDFJob.hh | 18 +++++++++--------- 2 files changed, 15 insertions(+), 15 deletions(-) (limited to 'include') diff --git a/include/qpdf/QPDFArgParser.hh b/include/qpdf/QPDFArgParser.hh index 12ade54b..108fc019 100644 --- a/include/qpdf/QPDFArgParser.hh +++ b/include/qpdf/QPDFArgParser.hh @@ -23,7 +23,7 @@ #define QPDFARGPARSER_HH #include -#include +#include #include #include #include @@ -325,15 +325,15 @@ class QPDFArgParser option_table_t* option_table; std::string option_table_name; bare_arg_handler_t final_check_handler; - std::vector> new_argv; - std::vector> bash_argv; - PointerHolder argv_ph; - PointerHolder bash_argv_ph; + std::vector> new_argv; + std::vector> bash_argv; + std::shared_ptr argv_ph; + std::shared_ptr bash_argv_ph; std::map help_topics; std::map option_help; std::string help_footer; }; - PointerHolder m; + std::shared_ptr m; }; #endif // QPDFARGPARSER_HH diff --git a/include/qpdf/QPDFJob.hh b/include/qpdf/QPDFJob.hh index f2e3a019..03035957 100644 --- a/include/qpdf/QPDFJob.hh +++ b/include/qpdf/QPDFJob.hh @@ -24,11 +24,11 @@ #include #include -#include #include #include #include +#include #include #include #include @@ -167,7 +167,7 @@ class QPDFJob char const* to_nr; char const* from_nr; char const* repeat_nr; - PointerHolder pdf; + std::shared_ptr pdf; std::vector to_pagenos; std::vector from_pagenos; std::vector repeat_pagenos; @@ -316,14 +316,14 @@ class QPDFJob private: // Basic file processing - PointerHolder processFile( + std::shared_ptr processFile( char const* filename, char const* password); - PointerHolder processInputSource( + std::shared_ptr processInputSource( PointerHolder is, char const* password); - PointerHolder doProcess( + std::shared_ptr doProcess( std::function fn, char const* password, bool empty); - PointerHolder doProcessOnce( + std::shared_ptr doProcessOnce( std::function fn, char const* password, bool empty); @@ -331,7 +331,7 @@ class QPDFJob void setQPDFOptions(QPDF& pdf); void handlePageSpecs( QPDF& pdf, bool& warnings, - std::vector>& page_heap); + std::vector>& page_heap); bool shouldRemoveUnreferencedResources(QPDF& pdf); void handleRotations(QPDF& pdf); void handleUnderOverlay(QPDF& pdf); @@ -395,9 +395,9 @@ class QPDFJob std::ostream* cout; std::ostream* cerr; unsigned long encryption_status; - PointerHolder ap; + std::shared_ptr ap; }; - PointerHolder m; + std::shared_ptr m; }; #endif // QPDFOBJECT_HH -- cgit v1.2.3-54-g00ecf