-
(patrepl and cleanpatch are my own utilities) patrepl s/PointerHolder/std::shared_ptr/g {include,libqpdf}/qpdf/*.hh patrepl s/PointerHolder/std::shared_ptr/g libqpdf/*.cc patrepl s/make_pointer_holder/std::make_shared/g libqpdf/*.cc patrepl s/make_array_pointer_holder/QUtil::make_shared_array/g libqpdf/*.cc patrepl s,qpdf/std::shared_ptr,qpdf/PointerHolder, **/*.cc **/*.hh git restore include/qpdf/PointerHolder.hh cleanpatch ./format-code
-
Run this: for i in **/*.cc **/*.c **/*.h **/*.hh; do clang-format < $i >| $i.new && mv $i.new $i done
-
Use get() and use_count() instead. Add #define NO_POINTERHOLDER_DEPRECATION to remove deprecation markers for these only. This commit also removes all deprecated PointerHolder API calls from qpdf's code except in PointerHolder's test suite, which must continue to test the deprecated APIs.
-
This makes it much more convention to use the initializeFromArgv functions since you can use string literals.
-
For optional parameter/choices, generate an overloaded config method that takes no arguments. This makes it possible to convert from a bare argument to one that takes an optional parameter without breaking binary compatibility.
-
Changing from bool requiring true to string requiring the empty string is more consistent with the CLI and makes it possible to add an optional parameter or choices later without breaking compatibility.
-
Use "file" consistently for specifying a file path. We use "filename" when adding attachments for a completely different purpose.
-
Why? The main methods that create them return smart pointers so that users can initialize them when needed, which you can't do with references. Returning pointers instead of references makes for a more uniform interface.
-
Use named functions rather than just end() for clarity.
-
All that's left now is input and output handling.
-
Create QPDFJob_options.cc to hold API implementation functions. Reorganize a little in preparation for moving public member variables private and creating the real QPDFJob API that will be used by callers as well as the argv/json initialization methods.