Commit fa9676557e3065d75f732622bd498d5572ba686e

Authored by Jay Berkenbilt
1 parent 3b60224b

QDPFJob: incorporate change to JSONHandler for array start function

generate_auto_job
@@ -562,8 +562,21 @@ class Main: @@ -562,8 +562,21 @@ class Main:
562 if isinstance(v[0], dict): 562 if isinstance(v[0], dict):
563 is_dict = True 563 is_dict = True
564 schema_value = [{}] 564 schema_value = [{}]
  565 + subpath = f'{path}.{schema_key}'
  566 + identifier = self.to_identifier(subpath, '', False)
  567 + self.json_decls.append(
  568 + f'void begin{identifier}Array(JSON);')
  569 + self.json_decls.append(
  570 + f'void end{identifier}Array();')
  571 + self.json_init.append(
  572 + f'beginArray("{flag}",'
  573 + f' bindJSON(&Handlers::begin{identifier}Array),'
  574 + f' bindBare(&Handlers::end{identifier}Array));'
  575 + f' // {subpath}[]')
565 build_schema(v[0], schema_value[0], 576 build_schema(v[0], schema_value[0],
566 - schema_key, f'{path}.{schema_key}') 577 + schema_key, subpath)
  578 + self.json_init.append(
  579 + f'endContainer(); // {subpath}[]')
567 elif schema_value is None: 580 elif schema_value is None:
568 raise Exception(f'unknown schema value for {k}') 581 raise Exception(f'unknown schema value for {k}')
569 s[schema_key] = schema_value 582 s[schema_key] = schema_value
@@ -573,7 +586,7 @@ class Main: @@ -573,7 +586,7 @@ class Main:
573 else: 586 else:
574 self.handle_json_manual(schema_key, path) 587 self.handle_json_manual(schema_key, path)
575 if flag: 588 if flag:
576 - self.json_init.append(f'endDict(); // {path}') 589 + self.json_init.append(f'endContainer(); // {path}')
577 590
578 build_schema(data['json'], self.schema, '', '') 591 build_schema(data['json'], self.schema, '', '')
579 if options_seen != set(expected.keys()): 592 if options_seen != set(expected.keys()):
job.sums
1 # Generated by generate_auto_job 1 # Generated by generate_auto_job
2 -generate_auto_job e4a071599697cc0f4d985367735ac6ed6110575e2cbfa01406d048780466d546 2 +generate_auto_job 68c39a9f6d1f10c1b9cf9af539036621589d6b0bbf3d05a2e1ddd1c9919d7383
3 include/qpdf/auto_job_c_att.hh 7ad43bb374c1370ef32ebdcdcb7b73a61d281f7f4e3f12755585872ab30fb60e 3 include/qpdf/auto_job_c_att.hh 7ad43bb374c1370ef32ebdcdcb7b73a61d281f7f4e3f12755585872ab30fb60e
4 include/qpdf/auto_job_c_copy_att.hh 32275d03cdc69b703dd7e02ba0bbe15756e714e9ad185484773a6178dc09e1ee 4 include/qpdf/auto_job_c_copy_att.hh 32275d03cdc69b703dd7e02ba0bbe15756e714e9ad185484773a6178dc09e1ee
5 include/qpdf/auto_job_c_enc.hh 72e138c7b96ed5aacdce78c1dec04b1c20d361faec4f8faf52f64c1d6be99265 5 include/qpdf/auto_job_c_enc.hh 72e138c7b96ed5aacdce78c1dec04b1c20d361faec4f8faf52f64c1d6be99265
@@ -10,8 +10,8 @@ job.yml 6389b89c25f0f07fa54bfc3d9f24f814aac5566ace43666f81476781db616ea1 @@ -10,8 +10,8 @@ job.yml 6389b89c25f0f07fa54bfc3d9f24f814aac5566ace43666f81476781db616ea1
10 libqpdf/qpdf/auto_job_decl.hh 9f79396ec459f191be4c5fe34cf88c265cf47355a1a945fa39169d1c94cf04f6 10 libqpdf/qpdf/auto_job_decl.hh 9f79396ec459f191be4c5fe34cf88c265cf47355a1a945fa39169d1c94cf04f6
11 libqpdf/qpdf/auto_job_help.hh 23c79f1d2c02bda28f64aace17f69487205c797e7ae2234892cbbabab49d6d47 11 libqpdf/qpdf/auto_job_help.hh 23c79f1d2c02bda28f64aace17f69487205c797e7ae2234892cbbabab49d6d47
12 libqpdf/qpdf/auto_job_init.hh 8e9e31b6099a662497339b27f6e2d7f779f35011e88a834bee8811c33405a0fe 12 libqpdf/qpdf/auto_job_init.hh 8e9e31b6099a662497339b27f6e2d7f779f35011e88a834bee8811c33405a0fe
13 -libqpdf/qpdf/auto_job_json_decl.hh 8a6e3b25e01969f1c8e2c9ec781f7f2e89b57e67e65d5dc7445ad9124b694b9a  
14 -libqpdf/qpdf/auto_job_json_init.hh 48888c602de4cc13040cff26569e162d6ebb5aec6ab959164d432cfe1058eb23 13 +libqpdf/qpdf/auto_job_json_decl.hh f349b55cf85d07a28aeb4bef257bdbcbe16f76b8065d01154161897b1e0fa643
  14 +libqpdf/qpdf/auto_job_json_init.hh 9ea198c4daa6badb30690e2814f3d6ab761c09973a0712341081dabcb2097006
15 libqpdf/qpdf/auto_job_schema.hh 9e19fb0b8ddd6fe13da12f1f98c27f6d558fc4706a56a63697e529b3140a457c 15 libqpdf/qpdf/auto_job_schema.hh 9e19fb0b8ddd6fe13da12f1f98c27f6d558fc4706a56a63697e529b3140a457c
16 manual/_ext/qpdf.py e9ac9d6c70642a3d29281ee5ad92ae2422dee8be9306fb8a0bc9dba0ed5e28f3 16 manual/_ext/qpdf.py e9ac9d6c70642a3d29281ee5ad92ae2422dee8be9306fb8a0bc9dba0ed5e28f3
17 manual/cli.rst 79140e023faa0cb77afe0b1dc512dd120ee5617f4db82f842596e4f239f93882 17 manual/cli.rst 79140e023faa0cb77afe0b1dc512dd120ee5617f4db82f842596e4f239f93882
libqpdf/QPDFJob_json.cc
@@ -37,7 +37,10 @@ namespace @@ -37,7 +37,10 @@ namespace
37 void beginDict(std::string const& key, 37 void beginDict(std::string const& key,
38 json_handler_t start_fn, 38 json_handler_t start_fn,
39 bare_handler_t end_fn); 39 bare_handler_t end_fn);
40 - void endDict(); 40 + void beginArray(std::string const& key,
  41 + json_handler_t start_fn,
  42 + bare_handler_t end_fn);
  43 + void endContainer();
41 44
42 bare_handler_t bindBare(void (Handlers::*f)()); 45 bare_handler_t bindBare(void (Handlers::*f)());
43 json_handler_t bindJSON(void (Handlers::*f)(JSON)); 46 json_handler_t bindJSON(void (Handlers::*f)(JSON));
@@ -194,7 +197,23 @@ Handlers::beginDict(std::string const& key, @@ -194,7 +197,23 @@ Handlers::beginDict(std::string const& key,
194 } 197 }
195 198
196 void 199 void
197 -Handlers::endDict() 200 +Handlers::beginArray(std::string const& key,
  201 + json_handler_t start_fn,
  202 + bare_handler_t end_fn)
  203 +{
  204 + auto new_jh = std::make_shared<JSONHandler>();
  205 + auto item_jh = std::make_shared<JSONHandler>();
  206 + new_jh->addArrayHandlers(
  207 + [start_fn](std::string const&, JSON j){ start_fn(j); },
  208 + [end_fn](std::string const&){ end_fn(); },
  209 + item_jh);
  210 + this->jh->addDictKeyHandler(key, new_jh);
  211 + this->json_handlers.push_back(item_jh);
  212 + this->jh = item_jh.get();
  213 +}
  214 +
  215 +void
  216 +Handlers::endContainer()
198 { 217 {
199 this->json_handlers.pop_back(); 218 this->json_handlers.pop_back();
200 this->jh = this->json_handlers.back().get(); 219 this->jh = this->json_handlers.back().get();
@@ -405,6 +424,18 @@ Handlers::endInspect() @@ -405,6 +424,18 @@ Handlers::endInspect()
405 } 424 }
406 425
407 void 426 void
  427 +Handlers::beginOptionsAddAttachmentArray(JSON)
  428 +{
  429 + // QXXXQ
  430 +}
  431 +
  432 +void
  433 +Handlers::endOptionsAddAttachmentArray()
  434 +{
  435 + // QXXXQ
  436 +}
  437 +
  438 +void
408 Handlers::beginOptionsAddAttachment(JSON) 439 Handlers::beginOptionsAddAttachment(JSON)
409 { 440 {
410 this->c_att = c_main->addAttachment(); 441 this->c_att = c_main->addAttachment();
@@ -426,6 +457,18 @@ Handlers::setupOptionsAddAttachmentPath(std::string const&amp; key) @@ -426,6 +457,18 @@ Handlers::setupOptionsAddAttachmentPath(std::string const&amp; key)
426 } 457 }
427 458
428 void 459 void
  460 +Handlers::beginOptionsCopyAttachmentsFromArray(JSON)
  461 +{
  462 + // QXXXQ
  463 +}
  464 +
  465 +void
  466 +Handlers::endOptionsCopyAttachmentsFromArray()
  467 +{
  468 + // QXXXQ
  469 +}
  470 +
  471 +void
429 Handlers::beginOptionsCopyAttachmentsFrom(JSON) 472 Handlers::beginOptionsCopyAttachmentsFrom(JSON)
430 { 473 {
431 this->c_copy_att = c_main->copyAttachmentsFrom(); 474 this->c_copy_att = c_main->copyAttachmentsFrom();
@@ -455,6 +498,18 @@ Handlers::setupOptionsCopyAttachmentsFromPassword(std::string const&amp; key) @@ -455,6 +498,18 @@ Handlers::setupOptionsCopyAttachmentsFromPassword(std::string const&amp; key)
455 } 498 }
456 499
457 void 500 void
  501 +Handlers::beginOptionsPagesArray(JSON)
  502 +{
  503 + // QXXXQ
  504 +}
  505 +
  506 +void
  507 +Handlers::endOptionsPagesArray()
  508 +{
  509 + // QXXXQ
  510 +}
  511 +
  512 +void
458 Handlers::beginOptionsPages(JSON) 513 Handlers::beginOptionsPages(JSON)
459 { 514 {
460 // QXXXQ 515 // QXXXQ
libqpdf/qpdf/auto_job_json_decl.hh
@@ -28,13 +28,19 @@ void beginInspect(JSON); @@ -28,13 +28,19 @@ void beginInspect(JSON);
28 void endInspect(); 28 void endInspect();
29 void beginOptions(JSON); 29 void beginOptions(JSON);
30 void endOptions(); 30 void endOptions();
  31 +void beginOptionsAddAttachmentArray(JSON);
  32 +void endOptionsAddAttachmentArray();
31 void beginOptionsAddAttachment(JSON); 33 void beginOptionsAddAttachment(JSON);
32 void endOptionsAddAttachment(); 34 void endOptionsAddAttachment();
33 void setupOptionsAddAttachmentPath(std::string const&); 35 void setupOptionsAddAttachmentPath(std::string const&);
  36 +void beginOptionsCopyAttachmentsFromArray(JSON);
  37 +void endOptionsCopyAttachmentsFromArray();
34 void beginOptionsCopyAttachmentsFrom(JSON); 38 void beginOptionsCopyAttachmentsFrom(JSON);
35 void endOptionsCopyAttachmentsFrom(); 39 void endOptionsCopyAttachmentsFrom();
36 void setupOptionsCopyAttachmentsFromPath(std::string const&); 40 void setupOptionsCopyAttachmentsFromPath(std::string const&);
37 void setupOptionsCopyAttachmentsFromPassword(std::string const&); 41 void setupOptionsCopyAttachmentsFromPassword(std::string const&);
  42 +void beginOptionsPagesArray(JSON);
  43 +void endOptionsPagesArray();
38 void beginOptionsPages(JSON); 44 void beginOptionsPages(JSON);
39 void endOptionsPages(); 45 void endOptionsPages();
40 void setupOptionsPagesFile(std::string const&); 46 void setupOptionsPagesFile(std::string const&);
libqpdf/qpdf/auto_job_json_init.hh
@@ -19,7 +19,7 @@ doSetup(&quot;filename&quot;, bindSetup(&amp;Handlers::setupInputFilename)); @@ -19,7 +19,7 @@ doSetup(&quot;filename&quot;, bindSetup(&amp;Handlers::setupInputFilename));
19 doSetup("password", bindSetup(&Handlers::setupInputPassword)); 19 doSetup("password", bindSetup(&Handlers::setupInputPassword));
20 addParameter("passwordFile", [this](char const* p) { c_main->passwordFile(p); }); 20 addParameter("passwordFile", [this](char const* p) { c_main->passwordFile(p); });
21 doSetup("empty", bindSetup(&Handlers::setupInputEmpty)); 21 doSetup("empty", bindSetup(&Handlers::setupInputEmpty));
22 -endDict(); // .input 22 +endContainer(); // .input
23 beginDict("output", bindJSON(&Handlers::beginOutput), bindBare(&Handlers::endOutput)); // .output 23 beginDict("output", bindJSON(&Handlers::beginOutput), bindBare(&Handlers::endOutput)); // .output
24 doSetup("filename", bindSetup(&Handlers::setupOutputFilename)); 24 doSetup("filename", bindSetup(&Handlers::setupOutputFilename));
25 doSetup("replaceInput", bindSetup(&Handlers::setupOutputReplaceInput)); 25 doSetup("replaceInput", bindSetup(&Handlers::setupOutputReplaceInput));
@@ -53,7 +53,7 @@ addChoices(&quot;annotate&quot;, yn_choices, [this](char const* p) { c_enc-&gt;annotate(p); } @@ -53,7 +53,7 @@ addChoices(&quot;annotate&quot;, yn_choices, [this](char const* p) { c_enc-&gt;annotate(p); }
53 addChoices("extract", yn_choices, [this](char const* p) { c_enc->extract(p); }); 53 addChoices("extract", yn_choices, [this](char const* p) { c_enc->extract(p); });
54 addChoices("modify", modify128_choices, [this](char const* p) { c_enc->modify(p); }); 54 addChoices("modify", modify128_choices, [this](char const* p) { c_enc->modify(p); });
55 addChoices("print", print128_choices, [this](char const* p) { c_enc->print(p); }); 55 addChoices("print", print128_choices, [this](char const* p) { c_enc->print(p); });
56 -endDict(); // .output.options.encrypt.40bit 56 +endContainer(); // .output.options.encrypt.40bit
57 beginDict("128bit", bindJSON(&Handlers::beginOutputOptionsEncrypt128bit), bindBare(&Handlers::endOutputOptionsEncrypt128bit)); // .output.options.encrypt.128bit 57 beginDict("128bit", bindJSON(&Handlers::beginOutputOptionsEncrypt128bit), bindBare(&Handlers::endOutputOptionsEncrypt128bit)); // .output.options.encrypt.128bit
58 addChoices("accessibility", yn_choices, [this](char const* p) { c_enc->accessibility(p); }); 58 addChoices("accessibility", yn_choices, [this](char const* p) { c_enc->accessibility(p); });
59 addChoices("annotate", yn_choices, [this](char const* p) { c_enc->annotate(p); }); 59 addChoices("annotate", yn_choices, [this](char const* p) { c_enc->annotate(p); });
@@ -66,7 +66,7 @@ addChoices(&quot;modify&quot;, modify128_choices, [this](char const* p) { c_enc-&gt;modify(p) @@ -66,7 +66,7 @@ addChoices(&quot;modify&quot;, modify128_choices, [this](char const* p) { c_enc-&gt;modify(p)
66 addChoices("print", print128_choices, [this](char const* p) { c_enc->print(p); }); 66 addChoices("print", print128_choices, [this](char const* p) { c_enc->print(p); });
67 addBare("forceV4", [this]() { c_enc->forceV4(); }); 67 addBare("forceV4", [this]() { c_enc->forceV4(); });
68 addChoices("useAes", yn_choices, [this](char const* p) { c_enc->useAes(p); }); 68 addChoices("useAes", yn_choices, [this](char const* p) { c_enc->useAes(p); });
69 -endDict(); // .output.options.encrypt.128bit 69 +endContainer(); // .output.options.encrypt.128bit
70 beginDict("256bit", bindJSON(&Handlers::beginOutputOptionsEncrypt256bit), bindBare(&Handlers::endOutputOptionsEncrypt256bit)); // .output.options.encrypt.256bit 70 beginDict("256bit", bindJSON(&Handlers::beginOutputOptionsEncrypt256bit), bindBare(&Handlers::endOutputOptionsEncrypt256bit)); // .output.options.encrypt.256bit
71 addChoices("accessibility", yn_choices, [this](char const* p) { c_enc->accessibility(p); }); 71 addChoices("accessibility", yn_choices, [this](char const* p) { c_enc->accessibility(p); });
72 addChoices("annotate", yn_choices, [this](char const* p) { c_enc->annotate(p); }); 72 addChoices("annotate", yn_choices, [this](char const* p) { c_enc->annotate(p); });
@@ -79,10 +79,10 @@ addChoices(&quot;modify&quot;, modify128_choices, [this](char const* p) { c_enc-&gt;modify(p) @@ -79,10 +79,10 @@ addChoices(&quot;modify&quot;, modify128_choices, [this](char const* p) { c_enc-&gt;modify(p)
79 addChoices("print", print128_choices, [this](char const* p) { c_enc->print(p); }); 79 addChoices("print", print128_choices, [this](char const* p) { c_enc->print(p); });
80 addBare("allowInsecure", [this]() { c_enc->allowInsecure(); }); 80 addBare("allowInsecure", [this]() { c_enc->allowInsecure(); });
81 addBare("forceR5", [this]() { c_enc->forceR5(); }); 81 addBare("forceR5", [this]() { c_enc->forceR5(); });
82 -endDict(); // .output.options.encrypt.256bit  
83 -endDict(); // .output.options.encrypt  
84 -endDict(); // .output.options  
85 -endDict(); // .output 82 +endContainer(); // .output.options.encrypt.256bit
  83 +endContainer(); // .output.options.encrypt
  84 +endContainer(); // .output.options
  85 +endContainer(); // .output
86 beginDict("inspect", bindJSON(&Handlers::beginInspect), bindBare(&Handlers::endInspect)); // .inspect 86 beginDict("inspect", bindJSON(&Handlers::beginInspect), bindBare(&Handlers::endInspect)); // .inspect
87 addBare("check", [this]() { c_main->check(); }); 87 addBare("check", [this]() { c_main->check(); });
88 addBare("checkLinearization", [this]() { c_main->checkLinearization(); }); 88 addBare("checkLinearization", [this]() { c_main->checkLinearization(); });
@@ -103,7 +103,7 @@ addParameter(&quot;showAttachment&quot;, [this](char const* p) { c_main-&gt;showAttachment(p) @@ -103,7 +103,7 @@ addParameter(&quot;showAttachment&quot;, [this](char const* p) { c_main-&gt;showAttachment(p)
103 addBare("json", [this]() { c_main->json(); }); 103 addBare("json", [this]() { c_main->json(); });
104 addChoices("jsonKey", json_key_choices, [this](char const* p) { c_main->jsonKey(p); }); 104 addChoices("jsonKey", json_key_choices, [this](char const* p) { c_main->jsonKey(p); });
105 addParameter("jsonObject", [this](char const* p) { c_main->jsonObject(p); }); 105 addParameter("jsonObject", [this](char const* p) { c_main->jsonObject(p); });
106 -endDict(); // .inspect 106 +endContainer(); // .inspect
107 beginDict("options", bindJSON(&Handlers::beginOptions), bindBare(&Handlers::endOptions)); // .options 107 beginDict("options", bindJSON(&Handlers::beginOptions), bindBare(&Handlers::endOptions)); // .options
108 addBare("allowWeakCrypto", [this]() { c_main->allowWeakCrypto(); }); 108 addBare("allowWeakCrypto", [this]() { c_main->allowWeakCrypto(); });
109 addBare("deterministicId", [this]() { c_main->deterministicId(); }); 109 addBare("deterministicId", [this]() { c_main->deterministicId(); });
@@ -122,6 +122,7 @@ addParameter(&quot;compressionLevel&quot;, [this](char const* p) { c_main-&gt;compressionLeve @@ -122,6 +122,7 @@ addParameter(&quot;compressionLevel&quot;, [this](char const* p) { c_main-&gt;compressionLeve
122 addBare("externalizeInlineImages", [this]() { c_main->externalizeInlineImages(); }); 122 addBare("externalizeInlineImages", [this]() { c_main->externalizeInlineImages(); });
123 addParameter("iiMinBytes", [this](char const* p) { c_main->iiMinBytes(p); }); 123 addParameter("iiMinBytes", [this](char const* p) { c_main->iiMinBytes(p); });
124 addChoices("removeUnreferencedResources", remove_unref_choices, [this](char const* p) { c_main->removeUnreferencedResources(p); }); 124 addChoices("removeUnreferencedResources", remove_unref_choices, [this](char const* p) { c_main->removeUnreferencedResources(p); });
  125 +beginArray("options", bindJSON(&Handlers::beginOptionsAddAttachmentArray), bindBare(&Handlers::endOptionsAddAttachmentArray)); // .options.addAttachment[]
125 beginDict("addAttachment", bindJSON(&Handlers::beginOptionsAddAttachment), bindBare(&Handlers::endOptionsAddAttachment)); // .options.addAttachment 126 beginDict("addAttachment", bindJSON(&Handlers::beginOptionsAddAttachment), bindBare(&Handlers::endOptionsAddAttachment)); // .options.addAttachment
126 doSetup("path", bindSetup(&Handlers::setupOptionsAddAttachmentPath)); 127 doSetup("path", bindSetup(&Handlers::setupOptionsAddAttachmentPath));
127 addParameter("creationdate", [this](char const* p) { c_att->creationdate(p); }); 128 addParameter("creationdate", [this](char const* p) { c_att->creationdate(p); });
@@ -131,13 +132,16 @@ addParameter(&quot;key&quot;, [this](char const* p) { c_att-&gt;key(p); }); @@ -131,13 +132,16 @@ addParameter(&quot;key&quot;, [this](char const* p) { c_att-&gt;key(p); });
131 addParameter("mimetype", [this](char const* p) { c_att->mimetype(p); }); 132 addParameter("mimetype", [this](char const* p) { c_att->mimetype(p); });
132 addParameter("moddate", [this](char const* p) { c_att->moddate(p); }); 133 addParameter("moddate", [this](char const* p) { c_att->moddate(p); });
133 addBare("replace", [this]() { c_att->replace(); }); 134 addBare("replace", [this]() { c_att->replace(); });
134 -endDict(); // .options.addAttachment 135 +endContainer(); // .options.addAttachment
  136 +endContainer(); // .options.addAttachment[]
135 addParameter("removeAttachment", [this](char const* p) { c_main->removeAttachment(p); }); 137 addParameter("removeAttachment", [this](char const* p) { c_main->removeAttachment(p); });
  138 +beginArray("options", bindJSON(&Handlers::beginOptionsCopyAttachmentsFromArray), bindBare(&Handlers::endOptionsCopyAttachmentsFromArray)); // .options.copyAttachmentsFrom[]
136 beginDict("copyAttachmentsFrom", bindJSON(&Handlers::beginOptionsCopyAttachmentsFrom), bindBare(&Handlers::endOptionsCopyAttachmentsFrom)); // .options.copyAttachmentsFrom 139 beginDict("copyAttachmentsFrom", bindJSON(&Handlers::beginOptionsCopyAttachmentsFrom), bindBare(&Handlers::endOptionsCopyAttachmentsFrom)); // .options.copyAttachmentsFrom
137 doSetup("path", bindSetup(&Handlers::setupOptionsCopyAttachmentsFromPath)); 140 doSetup("path", bindSetup(&Handlers::setupOptionsCopyAttachmentsFromPath));
138 doSetup("password", bindSetup(&Handlers::setupOptionsCopyAttachmentsFromPassword)); 141 doSetup("password", bindSetup(&Handlers::setupOptionsCopyAttachmentsFromPassword));
139 addParameter("prefix", [this](char const* p) { c_copy_att->prefix(p); }); 142 addParameter("prefix", [this](char const* p) { c_copy_att->prefix(p); });
140 -endDict(); // .options.copyAttachmentsFrom 143 +endContainer(); // .options.copyAttachmentsFrom
  144 +endContainer(); // .options.copyAttachmentsFrom[]
141 addParameter("collate", [this](char const* p) { c_main->collate(p); }); 145 addParameter("collate", [this](char const* p) { c_main->collate(p); });
142 addChoices("flattenAnnotations", flatten_choices, [this](char const* p) { c_main->flattenAnnotations(p); }); 146 addChoices("flattenAnnotations", flatten_choices, [this](char const* p) { c_main->flattenAnnotations(p); });
143 addBare("flattenRotation", [this]() { c_main->flattenRotation(); }); 147 addBare("flattenRotation", [this]() { c_main->flattenRotation(); });
@@ -147,11 +151,13 @@ addParameter(&quot;oiMinArea&quot;, [this](char const* p) { c_main-&gt;oiMinArea(p); }); @@ -147,11 +151,13 @@ addParameter(&quot;oiMinArea&quot;, [this](char const* p) { c_main-&gt;oiMinArea(p); });
147 addParameter("oiMinHeight", [this](char const* p) { c_main->oiMinHeight(p); }); 151 addParameter("oiMinHeight", [this](char const* p) { c_main->oiMinHeight(p); });
148 addParameter("oiMinWidth", [this](char const* p) { c_main->oiMinWidth(p); }); 152 addParameter("oiMinWidth", [this](char const* p) { c_main->oiMinWidth(p); });
149 addBare("optimizeImages", [this]() { c_main->optimizeImages(); }); 153 addBare("optimizeImages", [this]() { c_main->optimizeImages(); });
  154 +beginArray("options", bindJSON(&Handlers::beginOptionsPagesArray), bindBare(&Handlers::endOptionsPagesArray)); // .options.pages[]
150 beginDict("pages", bindJSON(&Handlers::beginOptionsPages), bindBare(&Handlers::endOptionsPages)); // .options.pages 155 beginDict("pages", bindJSON(&Handlers::beginOptionsPages), bindBare(&Handlers::endOptionsPages)); // .options.pages
151 doSetup("file", bindSetup(&Handlers::setupOptionsPagesFile)); 156 doSetup("file", bindSetup(&Handlers::setupOptionsPagesFile));
152 doSetup("password", bindSetup(&Handlers::setupOptionsPagesPassword)); 157 doSetup("password", bindSetup(&Handlers::setupOptionsPagesPassword));
153 doSetup("range", bindSetup(&Handlers::setupOptionsPagesRange)); 158 doSetup("range", bindSetup(&Handlers::setupOptionsPagesRange));
154 -endDict(); // .options.pages 159 +endContainer(); // .options.pages
  160 +endContainer(); // .options.pages[]
155 addBare("removePageLabels", [this]() { c_main->removePageLabels(); }); 161 addBare("removePageLabels", [this]() { c_main->removePageLabels(); });
156 addParameter("rotate", [this](char const* p) { c_main->rotate(p); }); 162 addParameter("rotate", [this](char const* p) { c_main->rotate(p); });
157 beginDict("overlay", bindJSON(&Handlers::beginOptionsOverlay), bindBare(&Handlers::endOptionsOverlay)); // .options.overlay 163 beginDict("overlay", bindJSON(&Handlers::beginOptionsOverlay), bindBare(&Handlers::endOptionsOverlay)); // .options.overlay
@@ -160,12 +166,12 @@ doSetup(&quot;password&quot;, bindSetup(&amp;Handlers::setupOptionsOverlayPassword)); @@ -160,12 +166,12 @@ doSetup(&quot;password&quot;, bindSetup(&amp;Handlers::setupOptionsOverlayPassword));
160 addParameter("from", [this](char const* p) { c_uo->from(p); }); 166 addParameter("from", [this](char const* p) { c_uo->from(p); });
161 addParameter("repeat", [this](char const* p) { c_uo->repeat(p); }); 167 addParameter("repeat", [this](char const* p) { c_uo->repeat(p); });
162 addParameter("to", [this](char const* p) { c_uo->to(p); }); 168 addParameter("to", [this](char const* p) { c_uo->to(p); });
163 -endDict(); // .options.overlay 169 +endContainer(); // .options.overlay
164 beginDict("underlay", bindJSON(&Handlers::beginOptionsUnderlay), bindBare(&Handlers::endOptionsUnderlay)); // .options.underlay 170 beginDict("underlay", bindJSON(&Handlers::beginOptionsUnderlay), bindBare(&Handlers::endOptionsUnderlay)); // .options.underlay
165 doSetup("file", bindSetup(&Handlers::setupOptionsUnderlayFile)); 171 doSetup("file", bindSetup(&Handlers::setupOptionsUnderlayFile));
166 doSetup("password", bindSetup(&Handlers::setupOptionsUnderlayPassword)); 172 doSetup("password", bindSetup(&Handlers::setupOptionsUnderlayPassword));
167 addParameter("from", [this](char const* p) { c_uo->from(p); }); 173 addParameter("from", [this](char const* p) { c_uo->from(p); });
168 addParameter("repeat", [this](char const* p) { c_uo->repeat(p); }); 174 addParameter("repeat", [this](char const* p) { c_uo->repeat(p); });
169 addParameter("to", [this](char const* p) { c_uo->to(p); }); 175 addParameter("to", [this](char const* p) { c_uo->to(p); });
170 -endDict(); // .options.underlay  
171 -endDict(); // .options 176 +endContainer(); // .options.underlay
  177 +endContainer(); // .options