aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/qpdf
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-01-25 22:37:17 +0100
committerJay Berkenbilt <ejb@ql.org>2022-01-30 19:11:03 +0100
commit0a354af02cf51aeb1602596988c8f826b47b3a81 (patch)
tree3d101f330f411080149082db2dba5291d9b7003f /libqpdf/qpdf
parenta87dcba13f4501adc448d82c58fa1dfa7274046d (diff)
downloadqpdf-0a354af02cf51aeb1602596988c8f826b47b3a81.tar.zst
QPDFJob: convert AddAttachment handlers
Diffstat (limited to 'libqpdf/qpdf')
-rw-r--r--libqpdf/qpdf/auto_job_decl.hh7
-rw-r--r--libqpdf/qpdf/auto_job_init.hh14
-rw-r--r--libqpdf/qpdf/auto_job_schema.hh4
3 files changed, 9 insertions, 16 deletions
diff --git a/libqpdf/qpdf/auto_job_decl.hh b/libqpdf/qpdf/auto_job_decl.hh
index 1ea25372..98e1d6e3 100644
--- a/libqpdf/qpdf/auto_job_decl.hh
+++ b/libqpdf/qpdf/auto_job_decl.hh
@@ -65,13 +65,6 @@ void argUORepeat(char *);
void argUOPassword(char *);
void argEndUnderlayOverlay();
void argAttPositional(char*);
-void argAttReplace();
-void argAttKey(char *);
-void argAttFilename(char *);
-void argAttCreationdate(char *);
-void argAttModdate(char *);
-void argAttMimetype(char *);
-void argAttDescription(char *);
void argEndAttachment();
void argCopyAttPositional(char*);
void argEndCopyAttachment();
diff --git a/libqpdf/qpdf/auto_job_init.hh b/libqpdf/qpdf/auto_job_init.hh
index 7ceff2ae..d6bb63f3 100644
--- a/libqpdf/qpdf/auto_job_init.hh
+++ b/libqpdf/qpdf/auto_job_init.hh
@@ -143,13 +143,13 @@ this->ap.addRequiredParameter("repeat", p(&ArgParser::argUORepeat), "page-range"
this->ap.addRequiredParameter("password", p(&ArgParser::argUOPassword), "password");
this->ap.registerOptionTable("attachment", b(&ArgParser::argEndAttachment));
this->ap.addPositional(p(&ArgParser::argAttPositional));
-this->ap.addBare("replace", b(&ArgParser::argAttReplace));
-this->ap.addRequiredParameter("key", p(&ArgParser::argAttKey), "attachment-key");
-this->ap.addRequiredParameter("filename", p(&ArgParser::argAttFilename), "filename");
-this->ap.addRequiredParameter("creationdate", p(&ArgParser::argAttCreationdate), "creation-date");
-this->ap.addRequiredParameter("moddate", p(&ArgParser::argAttModdate), "modification-date");
-this->ap.addRequiredParameter("mimetype", p(&ArgParser::argAttMimetype), "mime/type");
-this->ap.addRequiredParameter("description", p(&ArgParser::argAttDescription), "description");
+this->ap.addBare("replace", [this](){c_att->replace();});
+this->ap.addRequiredParameter("key", [this](char *x){c_att->key(x);}, "attachment-key");
+this->ap.addRequiredParameter("filename", [this](char *x){c_att->filename(x);}, "filename");
+this->ap.addRequiredParameter("creationdate", [this](char *x){c_att->creationdate(x);}, "creation-date");
+this->ap.addRequiredParameter("moddate", [this](char *x){c_att->moddate(x);}, "modification-date");
+this->ap.addRequiredParameter("mimetype", [this](char *x){c_att->mimetype(x);}, "mime/type");
+this->ap.addRequiredParameter("description", [this](char *x){c_att->description(x);}, "description");
this->ap.registerOptionTable("copy attachment", b(&ArgParser::argEndCopyAttachment));
this->ap.addPositional(p(&ArgParser::argCopyAttPositional));
this->ap.addRequiredParameter("prefix", [this](char *x){c_copy_att->prefix(x);}, "prefix");
diff --git a/libqpdf/qpdf/auto_job_schema.hh b/libqpdf/qpdf/auto_job_schema.hh
index 9ecdc507..7fe018af 100644
--- a/libqpdf/qpdf/auto_job_schema.hh
+++ b/libqpdf/qpdf/auto_job_schema.hh
@@ -122,7 +122,7 @@ static constexpr char const* JOB_SCHEMA_DATA = R"({
"modify": {
"addAttachment": [
{
- "file": "attachment to add",
+ "path": "attachment to add",
"creationdate": "set attachment's creation date",
"description": "set attachment's description",
"filename": "set attachment's displayed filename",
@@ -135,7 +135,7 @@ static constexpr char const* JOB_SCHEMA_DATA = R"({
"removeAttachment": "remove an embedded file",
"copyAttachmentsFrom": [
{
- "file": "attachment source filename",
+ "path": "attachment source filename",
"password": "specify password",
"prefix": "key prefix for copying attachments"
}