Jay Berkenbilt
e0720eaa78
Use the default logger for other writes to stdout/stderr
...
When there is no context for writing output or error messages, use the
default logger.
2022-06-18 10:38:50 -04:00
Jay Berkenbilt
6f43bf8de3
Major rework -- see long comments
...
* Replace --create-from-json=file with --json-input, which causes the
regular input to be treated as json.
* Eliminate --to-json
* In --json=2, bring back "objects" and eliminate "objectinfo". Stream
data is never present.
* In --json-output=2, write "qpdf-v2" with "objects" and include
stream data.
2022-05-20 09:16:25 -04:00
Jay Berkenbilt
4fe2e06b47
Add --create-from-json and --update-from-json arguments
...
Also add stubs for top-level QPDF methods (createFromJSON,
updateFromJSON)
2022-05-16 13:41:40 -04:00
Jay Berkenbilt
7f023701dd
Formatting: remove space in range-style for loops
...
Change .clang-format and commit automated changes from a fresh run of
format-code
2022-04-30 13:26:43 -04:00
Jay Berkenbilt
12f1eb15ca
Programmatically apply new formatting to code
...
Run this:
for i in **/*.cc **/*.c **/*.h **/*.hh; do
clang-format < $i >| $i.new && mv $i.new $i
done
2022-04-04 08:10:40 -04:00
Jay Berkenbilt
fbd3e56da7
Ignore -- at the top level arg parser ( fixes #652 )
...
This was unintended behavior that was added back for backward
compatibility. It is intentionally undocumented.
2022-02-15 16:13:12 -05:00
Jay Berkenbilt
cfaa2de804
Update copyright for 2022
2022-02-04 16:36:22 -05:00
Jay Berkenbilt
2229e37e88
Add a blank line after the first header included in each source
2022-02-04 16:31:31 -05: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
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
03e67a28fe
Move QTC::TC for qpdf to QPDFJob
...
All the coverage cases that used to be in qpdf.cc are now in
QPDFJob*.cc. It doesn't really matter, but better to follow the
convention of starting with the class that includes the coverage call.
2022-02-01 09:04:55 -05:00
Jay Berkenbilt
5953116634
Clean up documentation and help around json options
2022-01-31 18:40:11 -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
8a9100f674
QPDFJob: add checkConfiguration to Config
2022-01-31 15:57:45 -05:00
Jay Berkenbilt
0c8e9e5912
QPDFJob: prepare for automatically generated json handlers
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
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
cf6c56a463
QPDFJob: use config API in place-holder json
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
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
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
0a354af02c
QPDFJob: convert AddAttachment handlers
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
160e869d1e
Mark trivial arg functions
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
1d099ab743
QPDFJob: placeholder for initializeFromJson
2022-01-30 13:11:03 -05:00
Jay Berkenbilt
b9cd693a5b
QPDFJob: allocate QPDFArgParser on stack
...
The previous commits have removed all references to memory from
QPDFArgParser from QPDFJob. This commit removes the constraint that
QPDFArgParser remain in scope. This is a prerequisite to allowing JSON
as an alternative way to initialize QPDFJob and to initialize it
directly using a public API.
2022-01-30 13:11:03 -05:00
Jay Berkenbilt
d526d4c17f
QPDFJob: convert Under/Overlay to use shared pointers
2022-01-30 13:11:03 -05:00
Jay Berkenbilt
e4905983d2
QPDFJob: convert outfilename to shared pointer
2022-01-30 13:11:03 -05:00
Jay Berkenbilt
e5edfc786f
QPDFJob: convert infilename to shared pointer
2022-01-30 13:11:03 -05:00
Jay Berkenbilt
ee7824cf28
QPDFJob: convert encryption_file args to shared pointers
2022-01-30 13:11:03 -05:00
Jay Berkenbilt
021db6f226
QPDFJob: convert password to shared pointer
2022-01-30 13:11:03 -05:00
Jay Berkenbilt
1a8c2eb93b
QPDFJob: use std::shared_ptr over PointerHolder where possible
...
Also fix QPDFArgParser
2022-01-30 13:11:03 -05:00
Jay Berkenbilt
5c5e5ca29b
Document how to add a command-line argument
2022-01-30 13:11:03 -05:00
Jay Berkenbilt
c8729398dd
Generate help content from manual
...
This is a massive rewrite of the help text and cli.rst section of the
manual. All command-line flags now have their own help and are
specifically index. qpdf --help is completely redone.
2022-01-30 13:11:03 -05:00
Jay Berkenbilt
53ba65eb59
QPDFArgParser: handle optional choices including help
...
Handle optional choices in addition to required choices. Refactor the
way help options are added to completion to make it work with optional
help choices.
2022-01-30 13:11:03 -05:00
Jay Berkenbilt
4577df4b5d
QPDFJob increment: generate option table initialization
2022-01-30 13:11:03 -05:00
Jay Berkenbilt
c3e9b64e7f
QPDFJob increment: generate handler declarations
2022-01-30 13:11:03 -05:00