From 21c897aad0c3edc6e47e88754ab279e0f076cd06 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Tue, 25 Jan 2022 11:07:53 -0500 Subject: QPDFJob: convert a flag in other than the main table --- include/qpdf/QPDFJob.hh | 44 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/qpdf/QPDFJob.hh b/include/qpdf/QPDFJob.hh index c76d85cc..a4be63e9 100644 --- a/include/qpdf/QPDFJob.hh +++ b/include/qpdf/QPDFJob.hh @@ -100,11 +100,44 @@ class QPDFJob // CONFIGURATION // (implemented in QPDFJob_config.cc) + private: + struct CopyAttachmentFrom + { + std::string path; + std::string password; + std::string prefix; + }; + + public: + class Config; + class CopyAttConfig + { + friend class QPDFJob; + friend class Config; + public: + QPDF_DLL CopyAttConfig& filename(char const* parameter); + // QXXXQ auto + QPDF_DLL CopyAttConfig& prefix(char const* parameter); + QPDF_DLL CopyAttConfig& password(char const* parameter); + QPDF_DLL Config& end(); + // /QXXXQ + + private: + CopyAttConfig(Config&); + CopyAttConfig(CopyAttConfig const&) = delete; + + Config& config; + CopyAttachmentFrom caf; + }; + // Configuration is performed by calling methods XXX QXXXQ document class Config { friend class QPDFJob; public: + QPDF_DLL + std::shared_ptr copyAttachmentsFrom(); + // QXXXQ could potentially generate these declarations QPDF_DLL Config& allowWeakCrypto(); QPDF_DLL Config& check(); @@ -171,9 +204,11 @@ class QPDFJob QPDF_DLL Config& verbose(); QPDF_DLL Config& warningExit0(); QPDF_DLL Config& withImages(); + // /QXXXQ private: Config() = delete; + Config(Config const&) = delete; Config(QPDFJob& job) : o(job) { @@ -183,7 +218,7 @@ class QPDFJob friend class Config; QPDF_DLL - Config config(); + std::shared_ptr config(); // QXXXQ set options -- implemented in QPDFJob_options.cc @@ -295,13 +330,6 @@ class QPDFJob bool replace; }; - struct CopyAttachmentFrom - { - std::string path; - std::string password; - std::string prefix; - }; - enum remove_unref_e { re_auto, re_yes, re_no }; std::shared_ptr password; -- cgit v1.2.3-54-g00ecf