aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-01-23 15:46:02 +0100
committerJay Berkenbilt <ejb@ql.org>2022-01-30 19:11:03 +0100
commit564dc036072803d2ee9018f892e2d3a6570387fa (patch)
treedd6c49be59162fbee017970640da1add0a88c460
parent1d099ab7439104759a421bc20c809e64fef29f03 (diff)
downloadqpdf-564dc036072803d2ee9018f892e2d3a6570387fa.tar.zst
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.
-rw-r--r--include/qpdf/QPDFJob.hh41
-rw-r--r--libqpdf/QPDFJob_config.cc1
-rw-r--r--libqpdf/build.mk1
3 files changed, 28 insertions, 15 deletions
diff --git a/include/qpdf/QPDFJob.hh b/include/qpdf/QPDFJob.hh
index a1c17435..d8c698a5 100644
--- a/include/qpdf/QPDFJob.hh
+++ b/include/qpdf/QPDFJob.hh
@@ -45,6 +45,8 @@ class QPDFJob
QPDF_DLL
QPDFJob();
+ // SETUP FUNCTIONS
+
// Initialize a QPDFJob object from argv. The progname_env
// argument is the name of an environment variable which, if set,
// overrides the name of the executable for purposes of generating
@@ -83,37 +85,46 @@ class QPDFJob
QPDF_DLL
void setOutputStreams(std::ostream* out_stream, std::ostream* err_stream);
- // If in verbose mode, call the given function, passing in the
- // output stream and message prefix.
- QPDF_DLL
- void doIfVerbose(
- std::function<void(std::ostream&, std::string const& prefix)> fn);
+ // QXXXQ set options -- implemented in QPDFJob_options.cc
+ // QXXXQ these will not be in the final interface
QPDF_DLL
- void run();
-
+ bool suppressWarnings();
QPDF_DLL
- bool hasWarnings();
-
+ bool warningsExitZero();
QPDF_DLL
- bool createsOutput();
-
+ bool checkRequiresPassword();
QPDF_DLL
- bool suppressWarnings();
+ bool checkIsEncrypted();
+ // /QXXXQ
+ // Execute the job
QPDF_DLL
- bool warningsExitZero();
+ void run();
+
+ // CHECK STATUS -- these methods provide information known after
+ // run() is called.
QPDF_DLL
- bool checkRequiresPassword();
+ bool hasWarnings();
QPDF_DLL
- bool checkIsEncrypted();
+ bool createsOutput(); // QXXXQ need better name
// Return value is bitwise OR of values from qpdf_encryption_status_e
QPDF_DLL
unsigned long getEncryptionStatus();
+ // HELPER FUNCTIONS -- methods useful for calling in handlers that
+ // interact with QPDFJob during run or initialization.
+
+ // If in verbose mode, call the given function, passing in the
+ // output stream and message prefix.
+ QPDF_DLL
+ void doIfVerbose(
+ std::function<void(std::ostream&, std::string const& prefix)> fn);
+
+
// QXXXQ From here to END-PUBLIC should all be private or
// different somehow
public:
diff --git a/libqpdf/QPDFJob_config.cc b/libqpdf/QPDFJob_config.cc
new file mode 100644
index 00000000..0dfc7e14
--- /dev/null
+++ b/libqpdf/QPDFJob_config.cc
@@ -0,0 +1 @@
+#include <qpdf/QPDFJob.hh>
diff --git a/libqpdf/build.mk b/libqpdf/build.mk
index 66d85176..4cb546d8 100644
--- a/libqpdf/build.mk
+++ b/libqpdf/build.mk
@@ -73,6 +73,7 @@ SRCS_libqpdf = \
libqpdf/QPDFFormFieldObjectHelper.cc \
libqpdf/QPDFJob.cc \
libqpdf/QPDFJob_argv.cc \
+ libqpdf/QPDFJob_config.cc \
libqpdf/QPDFMatrix.cc \
libqpdf/QPDFNameTreeObjectHelper.cc \
libqpdf/QPDFNumberTreeObjectHelper.cc \