mirror of
https://github.com/qpdf/qpdf.git
synced 2025-01-02 22:50:20 +00:00
QPDFJob: use pointers instead of references for Config
Why? The main methods that create them return smart pointers so that users can initialize them when needed, which you can't do with references. Returning pointers instead of references makes for a more uniform interface.
This commit is contained in:
parent
03f3369f35
commit
c62ab2ee9f
@ -315,7 +315,7 @@ class Main:
|
||||
arg = ''
|
||||
if decl_arg:
|
||||
arg = 'char const* parameter'
|
||||
fn = f'{config_prefix}& {identifier}({arg})'
|
||||
fn = f'{config_prefix}* {identifier}({arg})'
|
||||
if fn not in self.declared_configs:
|
||||
self.declared_configs.add(fn)
|
||||
self.config_decls[cfg].append(f'QPDF_DLL {fn};')
|
||||
|
@ -154,17 +154,17 @@ class QPDFJob
|
||||
friend class Config;
|
||||
public:
|
||||
QPDF_DLL
|
||||
Config& endAddAttachment();
|
||||
Config* endAddAttachment();
|
||||
QPDF_DLL
|
||||
AttConfig& path(char const* parameter);
|
||||
AttConfig* path(char const* parameter);
|
||||
|
||||
# include <qpdf/auto_job_c_att.hh>
|
||||
|
||||
private:
|
||||
AttConfig(Config&);
|
||||
AttConfig(Config*);
|
||||
AttConfig(AttConfig const&) = delete;
|
||||
|
||||
Config& config;
|
||||
Config* config;
|
||||
AddAttachment att;
|
||||
};
|
||||
|
||||
@ -174,17 +174,17 @@ class QPDFJob
|
||||
friend class Config;
|
||||
public:
|
||||
QPDF_DLL
|
||||
Config& endCopyAttachmentsFrom();
|
||||
Config* endCopyAttachmentsFrom();
|
||||
QPDF_DLL
|
||||
CopyAttConfig& path(char const* parameter);
|
||||
CopyAttConfig* path(char const* parameter);
|
||||
|
||||
# include <qpdf/auto_job_c_copy_att.hh>
|
||||
|
||||
private:
|
||||
CopyAttConfig(Config&);
|
||||
CopyAttConfig(Config*);
|
||||
CopyAttConfig(CopyAttConfig const&) = delete;
|
||||
|
||||
Config& config;
|
||||
Config* config;
|
||||
CopyAttachmentFrom caf;
|
||||
};
|
||||
|
||||
@ -194,19 +194,19 @@ class QPDFJob
|
||||
friend class Config;
|
||||
public:
|
||||
QPDF_DLL
|
||||
Config& endPages();
|
||||
Config* endPages();
|
||||
QPDF_DLL
|
||||
PagesConfig& pageSpec(std::string const& filename,
|
||||
PagesConfig* pageSpec(std::string const& filename,
|
||||
std::string const& range,
|
||||
char const* password = nullptr);
|
||||
|
||||
# include <qpdf/auto_job_c_pages.hh>
|
||||
|
||||
private:
|
||||
PagesConfig(Config&);
|
||||
PagesConfig(Config*);
|
||||
PagesConfig(PagesConfig const&) = delete;
|
||||
|
||||
Config& config;
|
||||
Config* config;
|
||||
};
|
||||
|
||||
class UOConfig
|
||||
@ -215,17 +215,17 @@ class QPDFJob
|
||||
friend class Config;
|
||||
public:
|
||||
QPDF_DLL
|
||||
Config& endUnderlayOverlay();
|
||||
Config* endUnderlayOverlay();
|
||||
QPDF_DLL
|
||||
UOConfig& path(char const* parameter);
|
||||
UOConfig* path(char const* parameter);
|
||||
|
||||
# include <qpdf/auto_job_c_uo.hh>
|
||||
|
||||
private:
|
||||
UOConfig(Config&);
|
||||
UOConfig(Config*);
|
||||
UOConfig(PagesConfig const&) = delete;
|
||||
|
||||
Config& config;
|
||||
Config* config;
|
||||
};
|
||||
|
||||
class EncConfig
|
||||
@ -234,17 +234,17 @@ class QPDFJob
|
||||
friend class Config;
|
||||
public:
|
||||
QPDF_DLL
|
||||
Config& endEncrypt();
|
||||
Config* endEncrypt();
|
||||
QPDF_DLL
|
||||
EncConfig& path(char const* parameter);
|
||||
EncConfig* path(char const* parameter);
|
||||
|
||||
# include <qpdf/auto_job_c_enc.hh>
|
||||
|
||||
private:
|
||||
EncConfig(Config&);
|
||||
EncConfig(Config*);
|
||||
EncConfig(PagesConfig const&) = delete;
|
||||
|
||||
Config& config;
|
||||
Config* config;
|
||||
};
|
||||
|
||||
// Configuration is performed by calling methods XXX QXXXQ document
|
||||
@ -253,13 +253,13 @@ class QPDFJob
|
||||
friend class QPDFJob;
|
||||
public:
|
||||
QPDF_DLL
|
||||
Config& inputFile(char const* filename);
|
||||
Config* inputFile(char const* filename);
|
||||
QPDF_DLL
|
||||
Config& emptyInput();
|
||||
Config* emptyInput();
|
||||
QPDF_DLL
|
||||
Config& outputFile(char const* filename);
|
||||
Config* outputFile(char const* filename);
|
||||
QPDF_DLL
|
||||
Config& replaceInput();
|
||||
Config* replaceInput();
|
||||
|
||||
QPDF_DLL
|
||||
std::shared_ptr<CopyAttConfig> copyAttachmentsFrom();
|
||||
|
@ -3,10 +3,10 @@
|
||||
// Edits will be automatically overwritten if the build is
|
||||
// run in maintainer mode.
|
||||
//
|
||||
QPDF_DLL AttConfig& replace();
|
||||
QPDF_DLL AttConfig& key(char const* parameter);
|
||||
QPDF_DLL AttConfig& filename(char const* parameter);
|
||||
QPDF_DLL AttConfig& creationdate(char const* parameter);
|
||||
QPDF_DLL AttConfig& moddate(char const* parameter);
|
||||
QPDF_DLL AttConfig& mimetype(char const* parameter);
|
||||
QPDF_DLL AttConfig& description(char const* parameter);
|
||||
QPDF_DLL AttConfig* replace();
|
||||
QPDF_DLL AttConfig* key(char const* parameter);
|
||||
QPDF_DLL AttConfig* filename(char const* parameter);
|
||||
QPDF_DLL AttConfig* creationdate(char const* parameter);
|
||||
QPDF_DLL AttConfig* moddate(char const* parameter);
|
||||
QPDF_DLL AttConfig* mimetype(char const* parameter);
|
||||
QPDF_DLL AttConfig* description(char const* parameter);
|
||||
|
@ -3,5 +3,5 @@
|
||||
// Edits will be automatically overwritten if the build is
|
||||
// run in maintainer mode.
|
||||
//
|
||||
QPDF_DLL CopyAttConfig& prefix(char const* parameter);
|
||||
QPDF_DLL CopyAttConfig& password(char const* parameter);
|
||||
QPDF_DLL CopyAttConfig* prefix(char const* parameter);
|
||||
QPDF_DLL CopyAttConfig* password(char const* parameter);
|
||||
|
@ -3,16 +3,16 @@
|
||||
// Edits will be automatically overwritten if the build is
|
||||
// run in maintainer mode.
|
||||
//
|
||||
QPDF_DLL EncConfig& extract(char const* parameter);
|
||||
QPDF_DLL EncConfig& annotate(char const* parameter);
|
||||
QPDF_DLL EncConfig& print(char const* parameter);
|
||||
QPDF_DLL EncConfig& modify(char const* parameter);
|
||||
QPDF_DLL EncConfig& cleartextMetadata();
|
||||
QPDF_DLL EncConfig& forceV4();
|
||||
QPDF_DLL EncConfig& accessibility(char const* parameter);
|
||||
QPDF_DLL EncConfig& assemble(char const* parameter);
|
||||
QPDF_DLL EncConfig& form(char const* parameter);
|
||||
QPDF_DLL EncConfig& modifyOther(char const* parameter);
|
||||
QPDF_DLL EncConfig& useAes(char const* parameter);
|
||||
QPDF_DLL EncConfig& forceR5();
|
||||
QPDF_DLL EncConfig& allowInsecure();
|
||||
QPDF_DLL EncConfig* extract(char const* parameter);
|
||||
QPDF_DLL EncConfig* annotate(char const* parameter);
|
||||
QPDF_DLL EncConfig* print(char const* parameter);
|
||||
QPDF_DLL EncConfig* modify(char const* parameter);
|
||||
QPDF_DLL EncConfig* cleartextMetadata();
|
||||
QPDF_DLL EncConfig* forceV4();
|
||||
QPDF_DLL EncConfig* accessibility(char const* parameter);
|
||||
QPDF_DLL EncConfig* assemble(char const* parameter);
|
||||
QPDF_DLL EncConfig* form(char const* parameter);
|
||||
QPDF_DLL EncConfig* modifyOther(char const* parameter);
|
||||
QPDF_DLL EncConfig* useAes(char const* parameter);
|
||||
QPDF_DLL EncConfig* forceR5();
|
||||
QPDF_DLL EncConfig* allowInsecure();
|
||||
|
@ -3,76 +3,76 @@
|
||||
// Edits will be automatically overwritten if the build is
|
||||
// run in maintainer mode.
|
||||
//
|
||||
QPDF_DLL Config& allowWeakCrypto();
|
||||
QPDF_DLL Config& check();
|
||||
QPDF_DLL Config& checkLinearization();
|
||||
QPDF_DLL Config& coalesceContents();
|
||||
QPDF_DLL Config& decrypt();
|
||||
QPDF_DLL Config& deterministicId();
|
||||
QPDF_DLL Config& externalizeInlineImages();
|
||||
QPDF_DLL Config& filteredStreamData();
|
||||
QPDF_DLL Config& flattenRotation();
|
||||
QPDF_DLL Config& generateAppearances();
|
||||
QPDF_DLL Config& ignoreXrefStreams();
|
||||
QPDF_DLL Config& isEncrypted();
|
||||
QPDF_DLL Config& json();
|
||||
QPDF_DLL Config& keepInlineImages();
|
||||
QPDF_DLL Config& linearize();
|
||||
QPDF_DLL Config& listAttachments();
|
||||
QPDF_DLL Config& newlineBeforeEndstream();
|
||||
QPDF_DLL Config& noOriginalObjectIds();
|
||||
QPDF_DLL Config& noWarn();
|
||||
QPDF_DLL Config& optimizeImages();
|
||||
QPDF_DLL Config& passwordIsHexKey();
|
||||
QPDF_DLL Config& preserveUnreferenced();
|
||||
QPDF_DLL Config& preserveUnreferencedResources();
|
||||
QPDF_DLL Config& progress();
|
||||
QPDF_DLL Config& qdf();
|
||||
QPDF_DLL Config& rawStreamData();
|
||||
QPDF_DLL Config& recompressFlate();
|
||||
QPDF_DLL Config& removePageLabels();
|
||||
QPDF_DLL Config& requiresPassword();
|
||||
QPDF_DLL Config& showEncryption();
|
||||
QPDF_DLL Config& showEncryptionKey();
|
||||
QPDF_DLL Config& showLinearization();
|
||||
QPDF_DLL Config& showNpages();
|
||||
QPDF_DLL Config& showPages();
|
||||
QPDF_DLL Config& showXref();
|
||||
QPDF_DLL Config& staticAesIv();
|
||||
QPDF_DLL Config& staticId();
|
||||
QPDF_DLL Config& suppressPasswordRecovery();
|
||||
QPDF_DLL Config& suppressRecovery();
|
||||
QPDF_DLL Config& verbose();
|
||||
QPDF_DLL Config& warningExit0();
|
||||
QPDF_DLL Config& withImages();
|
||||
QPDF_DLL Config& collate(char const* parameter);
|
||||
QPDF_DLL Config& splitPages(char const* parameter);
|
||||
QPDF_DLL Config& compressionLevel(char const* parameter);
|
||||
QPDF_DLL Config& copyEncryption(char const* parameter);
|
||||
QPDF_DLL Config& encryptionFilePassword(char const* parameter);
|
||||
QPDF_DLL Config& forceVersion(char const* parameter);
|
||||
QPDF_DLL Config& iiMinBytes(char const* parameter);
|
||||
QPDF_DLL Config& jobJsonFile(char const* parameter);
|
||||
QPDF_DLL Config& jsonObject(char const* parameter);
|
||||
QPDF_DLL Config& keepFilesOpenThreshold(char const* parameter);
|
||||
QPDF_DLL Config& linearizePass1(char const* parameter);
|
||||
QPDF_DLL Config& minVersion(char const* parameter);
|
||||
QPDF_DLL Config& oiMinArea(char const* parameter);
|
||||
QPDF_DLL Config& oiMinHeight(char const* parameter);
|
||||
QPDF_DLL Config& oiMinWidth(char const* parameter);
|
||||
QPDF_DLL Config& password(char const* parameter);
|
||||
QPDF_DLL Config& passwordFile(char const* parameter);
|
||||
QPDF_DLL Config& removeAttachment(char const* parameter);
|
||||
QPDF_DLL Config& rotate(char const* parameter);
|
||||
QPDF_DLL Config& showAttachment(char const* parameter);
|
||||
QPDF_DLL Config& showObject(char const* parameter);
|
||||
QPDF_DLL Config& compressStreams(char const* parameter);
|
||||
QPDF_DLL Config& decodeLevel(char const* parameter);
|
||||
QPDF_DLL Config& flattenAnnotations(char const* parameter);
|
||||
QPDF_DLL Config& jsonKey(char const* parameter);
|
||||
QPDF_DLL Config& keepFilesOpen(char const* parameter);
|
||||
QPDF_DLL Config& normalizeContent(char const* parameter);
|
||||
QPDF_DLL Config& objectStreams(char const* parameter);
|
||||
QPDF_DLL Config& passwordMode(char const* parameter);
|
||||
QPDF_DLL Config& removeUnreferencedResources(char const* parameter);
|
||||
QPDF_DLL Config& streamData(char const* parameter);
|
||||
QPDF_DLL Config* allowWeakCrypto();
|
||||
QPDF_DLL Config* check();
|
||||
QPDF_DLL Config* checkLinearization();
|
||||
QPDF_DLL Config* coalesceContents();
|
||||
QPDF_DLL Config* decrypt();
|
||||
QPDF_DLL Config* deterministicId();
|
||||
QPDF_DLL Config* externalizeInlineImages();
|
||||
QPDF_DLL Config* filteredStreamData();
|
||||
QPDF_DLL Config* flattenRotation();
|
||||
QPDF_DLL Config* generateAppearances();
|
||||
QPDF_DLL Config* ignoreXrefStreams();
|
||||
QPDF_DLL Config* isEncrypted();
|
||||
QPDF_DLL Config* json();
|
||||
QPDF_DLL Config* keepInlineImages();
|
||||
QPDF_DLL Config* linearize();
|
||||
QPDF_DLL Config* listAttachments();
|
||||
QPDF_DLL Config* newlineBeforeEndstream();
|
||||
QPDF_DLL Config* noOriginalObjectIds();
|
||||
QPDF_DLL Config* noWarn();
|
||||
QPDF_DLL Config* optimizeImages();
|
||||
QPDF_DLL Config* passwordIsHexKey();
|
||||
QPDF_DLL Config* preserveUnreferenced();
|
||||
QPDF_DLL Config* preserveUnreferencedResources();
|
||||
QPDF_DLL Config* progress();
|
||||
QPDF_DLL Config* qdf();
|
||||
QPDF_DLL Config* rawStreamData();
|
||||
QPDF_DLL Config* recompressFlate();
|
||||
QPDF_DLL Config* removePageLabels();
|
||||
QPDF_DLL Config* requiresPassword();
|
||||
QPDF_DLL Config* showEncryption();
|
||||
QPDF_DLL Config* showEncryptionKey();
|
||||
QPDF_DLL Config* showLinearization();
|
||||
QPDF_DLL Config* showNpages();
|
||||
QPDF_DLL Config* showPages();
|
||||
QPDF_DLL Config* showXref();
|
||||
QPDF_DLL Config* staticAesIv();
|
||||
QPDF_DLL Config* staticId();
|
||||
QPDF_DLL Config* suppressPasswordRecovery();
|
||||
QPDF_DLL Config* suppressRecovery();
|
||||
QPDF_DLL Config* verbose();
|
||||
QPDF_DLL Config* warningExit0();
|
||||
QPDF_DLL Config* withImages();
|
||||
QPDF_DLL Config* collate(char const* parameter);
|
||||
QPDF_DLL Config* splitPages(char const* parameter);
|
||||
QPDF_DLL Config* compressionLevel(char const* parameter);
|
||||
QPDF_DLL Config* copyEncryption(char const* parameter);
|
||||
QPDF_DLL Config* encryptionFilePassword(char const* parameter);
|
||||
QPDF_DLL Config* forceVersion(char const* parameter);
|
||||
QPDF_DLL Config* iiMinBytes(char const* parameter);
|
||||
QPDF_DLL Config* jobJsonFile(char const* parameter);
|
||||
QPDF_DLL Config* jsonObject(char const* parameter);
|
||||
QPDF_DLL Config* keepFilesOpenThreshold(char const* parameter);
|
||||
QPDF_DLL Config* linearizePass1(char const* parameter);
|
||||
QPDF_DLL Config* minVersion(char const* parameter);
|
||||
QPDF_DLL Config* oiMinArea(char const* parameter);
|
||||
QPDF_DLL Config* oiMinHeight(char const* parameter);
|
||||
QPDF_DLL Config* oiMinWidth(char const* parameter);
|
||||
QPDF_DLL Config* password(char const* parameter);
|
||||
QPDF_DLL Config* passwordFile(char const* parameter);
|
||||
QPDF_DLL Config* removeAttachment(char const* parameter);
|
||||
QPDF_DLL Config* rotate(char const* parameter);
|
||||
QPDF_DLL Config* showAttachment(char const* parameter);
|
||||
QPDF_DLL Config* showObject(char const* parameter);
|
||||
QPDF_DLL Config* compressStreams(char const* parameter);
|
||||
QPDF_DLL Config* decodeLevel(char const* parameter);
|
||||
QPDF_DLL Config* flattenAnnotations(char const* parameter);
|
||||
QPDF_DLL Config* jsonKey(char const* parameter);
|
||||
QPDF_DLL Config* keepFilesOpen(char const* parameter);
|
||||
QPDF_DLL Config* normalizeContent(char const* parameter);
|
||||
QPDF_DLL Config* objectStreams(char const* parameter);
|
||||
QPDF_DLL Config* passwordMode(char const* parameter);
|
||||
QPDF_DLL Config* removeUnreferencedResources(char const* parameter);
|
||||
QPDF_DLL Config* streamData(char const* parameter);
|
||||
|
@ -3,7 +3,7 @@
|
||||
// Edits will be automatically overwritten if the build is
|
||||
// run in maintainer mode.
|
||||
//
|
||||
QPDF_DLL UOConfig& to(char const* parameter);
|
||||
QPDF_DLL UOConfig& from(char const* parameter);
|
||||
QPDF_DLL UOConfig& repeat(char const* parameter);
|
||||
QPDF_DLL UOConfig& password(char const* parameter);
|
||||
QPDF_DLL UOConfig* to(char const* parameter);
|
||||
QPDF_DLL UOConfig* from(char const* parameter);
|
||||
QPDF_DLL UOConfig* repeat(char const* parameter);
|
||||
QPDF_DLL UOConfig* password(char const* parameter);
|
||||
|
12
job.sums
12
job.sums
@ -1,11 +1,11 @@
|
||||
# Generated by generate_auto_job
|
||||
generate_auto_job 3108658e47e17655e761842cd76bab48fdaf5e9792942c8bf1ca03f6f1934809
|
||||
include/qpdf/auto_job_c_att.hh 9d21a86169938a187c55e56e1ef915cd4211d13745c21d85c5c06306fd8ed023
|
||||
include/qpdf/auto_job_c_copy_att.hh d954c29ca74ef2e3abf0a0d99446bb974585700750fad8cee31340cbf2304a94
|
||||
include/qpdf/auto_job_c_enc.hh 7a64974ba970390f38bcea9c2471e620b92329c71eb7fa428ad0e09844007ca8
|
||||
include/qpdf/auto_job_c_main.hh e7f23e24ddbd16b5e7cb720c7da9ef76b89c2e23b5c4eecc5d8e10f0c0d60f4e
|
||||
generate_auto_job e5c58868f4cb2c3ec1689bf44fb57cc57930f981f52fa4aa21d6b990a83f7163
|
||||
include/qpdf/auto_job_c_att.hh 7ad43bb374c1370ef32ebdcdcb7b73a61d281f7f4e3f12755585872ab30fb60e
|
||||
include/qpdf/auto_job_c_copy_att.hh 32275d03cdc69b703dd7e02ba0bbe15756e714e9ad185484773a6178dc09e1ee
|
||||
include/qpdf/auto_job_c_enc.hh 72e138c7b96ed5aacdce78c1dec04b1c20d361faec4f8faf52f64c1d6be99265
|
||||
include/qpdf/auto_job_c_main.hh 516adb23cc7e44e614e436880be870d0574e4ebbc706cd855a1360000eed31bb
|
||||
include/qpdf/auto_job_c_pages.hh 931840b329a36ca0e41401190e04537b47f2867671a6643bfd8da74014202671
|
||||
include/qpdf/auto_job_c_uo.hh 0fd370c70a1974197804f62c308ca2ec44727bf2f95a89cde48c4284823b6fbc
|
||||
include/qpdf/auto_job_c_uo.hh 0585b7de459fa479d9e51a45fa92de0ff6dee748efc9ec1cedd0dde6cee1ad50
|
||||
job.yml 1590fd16fd17ed40db9aa56b6713c844cfd61b3a6d0441a3ccd122b7371c68e9
|
||||
libqpdf/qpdf/auto_job_decl.hh 9f79396ec459f191be4c5fe34cf88c265cf47355a1a945fa39169d1c94cf04f6
|
||||
libqpdf/qpdf/auto_job_help.hh 383eea80e2c185ef5295fc126246457a7ceeffea759fdb90bb2e6727532ea538
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user