diff options
author | Jay Berkenbilt <ejb@ql.org> | 2022-01-25 17:07:53 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2022-01-30 19:11:03 +0100 |
commit | 21c897aad0c3edc6e47e88754ab279e0f076cd06 (patch) | |
tree | b255a0b10a817ad083a8403a769687bfc23f08be /libqpdf/QPDFJob_config.cc | |
parent | 965e473a01122291e9498bbec81af144bd33f075 (diff) | |
download | qpdf-21c897aad0c3edc6e47e88754ab279e0f076cd06.tar.zst |
QPDFJob: convert a flag in other than the main table
Diffstat (limited to 'libqpdf/QPDFJob_config.cc')
-rw-r--r-- | libqpdf/QPDFJob_config.cc | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/libqpdf/QPDFJob_config.cc b/libqpdf/QPDFJob_config.cc index ac038aa9..923d9302 100644 --- a/libqpdf/QPDFJob_config.cc +++ b/libqpdf/QPDFJob_config.cc @@ -489,3 +489,46 @@ QPDFJob::Config::withImages() o.show_page_images = true; return *this; } + +std::shared_ptr<QPDFJob::CopyAttConfig> +QPDFJob::Config::copyAttachmentsFrom() +{ + return std::shared_ptr<CopyAttConfig>(new CopyAttConfig(*this)); +} + +QPDFJob::CopyAttConfig::CopyAttConfig(Config& c) : + config(c) +{ +} + +QPDFJob::CopyAttConfig& +QPDFJob::CopyAttConfig::filename(char const* parameter) +{ + this->caf.path = parameter; + return *this; +} + +QPDFJob::CopyAttConfig& +QPDFJob::CopyAttConfig::prefix(char const* parameter) +{ + this->caf.prefix = parameter; + return *this; +} + +QPDFJob::CopyAttConfig& +QPDFJob::CopyAttConfig::password(char const* parameter) +{ + this->caf.password = parameter; + return *this; +} + +QPDFJob::Config& +QPDFJob::CopyAttConfig::end() +{ + if (this->caf.path.empty()) + { + throw std::runtime_error("copy attachments: no path specified"); + } + this->config.o.attachments_to_copy.push_back(this->caf); + return this->config; +} |