Commit Graph

575 Commits

Author SHA1 Message Date
Jay Berkenbilt cfaa2de804 Update copyright for 2022 2022-02-04 16:36:22 -05:00
Jay Berkenbilt 8eab616d62 Add qpdf version macros to qpdf/DLL.h 2022-02-04 13:41:01 -05:00
Jay Berkenbilt abc300f05c Replace containers of PointerHolder with containers of std::shared_ptr
None of these are in the public API.
2022-02-04 13:12:37 -05:00
Jay Berkenbilt f0c2e0ef1e JSON: use std::shared_ptr internally 2022-02-04 13:12:37 -05:00
Jay Berkenbilt 9044a24097 PointerHolder: deprecate getPointer() and getRefcount()
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.
2022-02-04 13:12:37 -05:00
Jay Berkenbilt f727bc9443 PointerHolder: add get() and use_count() for forward compatibility
PointerHolder will be replaced with shared_ptr, so let people start
moving.
2022-02-04 13:12:37 -05:00
m-holger 95e7d36b7a C-API add two binary UTF8 funtions
add qpdf_oh_new_binary_unicode_string and qpdf_oh_get_binary_utf8_value
2022-02-04 13:10:51 -05:00
m-holger e813176bc0 Fix some doc typos 2022-02-02 14:07:32 -06:00
Jay Berkenbilt 42bff9f458 QPDFJob: let initializeFromArgv just take argv, not argc
Let argv be a null-terminated array. There is already code that
assumes this, and it makes it easier to construct the arguments.
2022-02-01 13:50:58 -05:00
Jay Berkenbilt a0d9d9923c Finish QPDFJob examples and add tests for them 2022-02-01 13:50:58 -05:00
Jay Berkenbilt b02d37bc0a Make QPDFArgParser accept const argv
This makes it much more convention to use the initializeFromArgv
functions since you can use string literals.
2022-02-01 13:50:58 -05:00
Jay Berkenbilt bc4e2320e7 Add qpdfjob-c.h -- simple C API around parts of QPDFJob 2022-02-01 09:04:55 -05:00
Jay Berkenbilt b42f3e1d15 Move more code from qpdf.cc into QPDFJob 2022-02-01 09:04:55 -05:00
Jay Berkenbilt cc5485dac1 QPDFJob: documentation 2022-02-01 09:04:55 -05:00
Jay Berkenbilt 5a7bb3474e generate_auto_job: generate overloaded config decls for optional
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.
2022-02-01 09:04:55 -05:00
Jay Berkenbilt e3506253f1 Add optional version to --json 2022-01-31 15:57:45 -05:00
Jay Berkenbilt caa00556cf Change filename or path to file in json and QPDFJob
Use "file" consistently for specifying a file path. We use "filename"
when adding attachments for a completely different purpose.
2022-01-31 15:57:45 -05:00
Jay Berkenbilt f99e0af49c QPDFJob: rename function that returns job schema 2022-01-31 15:57:45 -05:00
Jay Berkenbilt 1355d95d08 QPDFJob: partial mode for initializeFromJson 2022-01-31 15:57:45 -05:00
Jay Berkenbilt 28278e27ea Keep JSONHandler and QPDFArgParser private
Since the functionality of argument parsing has moved into QPDFJob,
these classes no longer need to be public. Their methods still have to
be in the library's binary interface so they can be tested in libtests.
2022-01-31 15:57:45 -05:00
Jay Berkenbilt 8a9100f674 QPDFJob: add checkConfiguration to Config 2022-01-31 15:57:45 -05:00
Jay Berkenbilt 0364024781 Use QPDFUsage exception for cli, json, and QPDFJob errors 2022-01-30 13:11:03 -05:00
Jay Berkenbilt 2e4e25a934 Fix some comments 2022-01-30 13:11:03 -05:00
Jay Berkenbilt c62ab2ee9f QPDFJob: use pointers instead of references for Config
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.
2022-01-30 13:11:03 -05:00
Jay Berkenbilt 03f3369f35 QPDFJob: use manually named end functions for Config classes
Use named functions rather than just end() for clarity.
2022-01-30 13:11:03 -05:00
Jay Berkenbilt 9013b7ca91 QPDFJob: move placeholder json to a separate source file 2022-01-30 13:11:03 -05:00
Jay Berkenbilt edef2cd330 QPDFJob: make remaining members private 2022-01-30 13:11:03 -05:00
Jay Berkenbilt f2409f4fca Minor cleanup 2022-01-30 13:11:03 -05:00
Jay Berkenbilt 01969c78a8 QPDFJob: move private members into Members 2022-01-30 13:11:03 -05:00
Jay Berkenbilt 98f25fdfa1 QPDFJob: make easy things private 2022-01-30 13:11:03 -05:00
Jay Berkenbilt 2c7b583b3a QPDFJob: move input/output handling into config 2022-01-30 13:11:03 -05:00
Jay Berkenbilt ac56e013d6 Add missing QPDF_DLL 2022-01-30 13:11:03 -05:00
Jay Berkenbilt 1258054543 QPDFJob: eliminate most access to QPDFJob members from ArgParser
All that's left now is input and output handling.
2022-01-30 13:11:03 -05:00
Jay Berkenbilt 901e3e4fbf QPDFArgParser: remove unused copyFromOtherTable
This was used, but it no longer is, so let's not keep the extra
complexity around.
2022-01-30 13:11:03 -05:00
Jay Berkenbilt 700dfa40d3 QPDFJob: convert encryption handlers 2022-01-30 13:11:03 -05:00
Jay Berkenbilt b5d41b16b8 QPDFJob: convert under/overlay and rotate 2022-01-30 13:11:03 -05:00
Jay Berkenbilt 1cc532dc91 QPDFJob: move some helpers from ArgParser to QPDFJob 2022-01-30 13:11:03 -05:00
Jay Berkenbilt 95d127641c QPDFJob: move more top-level trivial handlers into config 2022-01-30 13:11:03 -05:00
Jay Berkenbilt 41c5af8f26 QPDFJob: convert pages 2022-01-30 13:11:03 -05:00
Jay Berkenbilt 9373881cca Add QPDFJob::ConfigError exception 2022-01-30 13:11:03 -05:00
Jay Berkenbilt 0a354af02c QPDFJob: convert AddAttachment handlers 2022-01-30 13:11:03 -05:00
Jay Berkenbilt a87dcba13f QPDFJob: generate declarations of trivial config methods 2022-01-30 13:11:03 -05:00
Jay Berkenbilt bf255ccc89 QPDFJob: convert password in two tables 2022-01-30 13:11:03 -05:00
Jay Berkenbilt 21c897aad0 QPDFJob: convert a flag in other than the main table 2022-01-30 13:11:03 -05:00
Jay Berkenbilt f60526aff9 QPDFJob: start changing generation for trivial config handlers 2022-01-30 13:11:03 -05:00
Jay Berkenbilt b4b0df0df9 QPDFJob: convert trivial functions to config API 2022-01-30 13:11:03 -05:00
Jay Berkenbilt 79187e585a QPDFJob: begin configuration API with verbose 2022-01-30 13:11:03 -05:00
Jay Berkenbilt fcdbc8a102 Move doFinalChecks to QPDFJob::checkConfiguration 2022-01-30 13:11:03 -05:00
Jay Berkenbilt c4e56fa5f4 QPDFJob: make createsOutput callable before run() 2022-01-30 13:11:03 -05:00
Jay Berkenbilt 564dc03607 QPDFJob: start real API
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.
2022-01-30 13:11:03 -05:00