diff options
Diffstat (limited to 'libqpdf')
-rw-r--r-- | libqpdf/QPDFJob_json.cc | 11 | ||||
-rw-r--r-- | libqpdf/qpdf/auto_job_json_decl.hh | 2 | ||||
-rw-r--r-- | libqpdf/qpdf/auto_job_json_init.hh | 2 | ||||
-rw-r--r-- | libqpdf/qpdf/auto_job_schema.hh | 4 |
4 files changed, 18 insertions, 1 deletions
diff --git a/libqpdf/QPDFJob_json.cc b/libqpdf/QPDFJob_json.cc index c0247e0b..e529439a 100644 --- a/libqpdf/QPDFJob_json.cc +++ b/libqpdf/QPDFJob_json.cc @@ -413,6 +413,17 @@ Handlers::setupAddAttachmentFile() } void +Handlers::beginRemoveAttachmentArray(JSON) +{ + // nothing needed +} + +void +Handlers::endRemoveAttachmentArray() +{ + // nothing needed +} +void Handlers::beginCopyAttachmentsFromArray(JSON) { // nothing needed diff --git a/libqpdf/qpdf/auto_job_json_decl.hh b/libqpdf/qpdf/auto_job_json_decl.hh index 7f996928..f02dc657 100644 --- a/libqpdf/qpdf/auto_job_json_decl.hh +++ b/libqpdf/qpdf/auto_job_json_decl.hh @@ -29,6 +29,8 @@ void endAddAttachmentArray(); void beginAddAttachment(JSON); void endAddAttachment(); void setupAddAttachmentFile(); +void beginRemoveAttachmentArray(JSON); +void endRemoveAttachmentArray(); void beginCopyAttachmentsFromArray(JSON); void endCopyAttachmentsFromArray(); void beginCopyAttachmentsFrom(JSON); diff --git a/libqpdf/qpdf/auto_job_json_init.hh b/libqpdf/qpdf/auto_job_json_init.hh index 2f807469..3c83ec2d 100644 --- a/libqpdf/qpdf/auto_job_json_init.hh +++ b/libqpdf/qpdf/auto_job_json_init.hh @@ -327,7 +327,9 @@ popHandler(); // key: replace popHandler(); // array: .addAttachment[] popHandler(); // key: addAttachment pushKey("removeAttachment"); +beginArray(bindJSON(&Handlers::beginRemoveAttachmentArray), bindBare(&Handlers::endRemoveAttachmentArray)); // .removeAttachment[] addParameter([this](std::string const& p) { c_main->removeAttachment(p); }); +popHandler(); // array: .removeAttachment[] popHandler(); // key: removeAttachment pushKey("copyAttachmentsFrom"); beginArray(bindJSON(&Handlers::beginCopyAttachmentsFromArray), bindBare(&Handlers::endCopyAttachmentsFromArray)); // .copyAttachmentsFrom[] diff --git a/libqpdf/qpdf/auto_job_schema.hh b/libqpdf/qpdf/auto_job_schema.hh index ca9fc1e1..557af9ee 100644 --- a/libqpdf/qpdf/auto_job_schema.hh +++ b/libqpdf/qpdf/auto_job_schema.hh @@ -111,7 +111,9 @@ static constexpr char const* JOB_SCHEMA_DATA = R"({ "replace": "replace attachment with same key" } ], - "removeAttachment": "remove an embedded file", + "removeAttachment": [ + "remove an embedded file" + ], "copyAttachmentsFrom": [ { "file": "file to copy attachments from", |