|
|
|
@ -39,25 +39,19 @@ enum MetadataId {
|
|
|
|
|
//! Structure for one parsed modification command
|
|
|
|
|
struct ModifyCmd {
|
|
|
|
|
//! C'tor
|
|
|
|
|
ModifyCmd() :
|
|
|
|
|
cmdId_(invalidCmdId), metadataId_(invalidMetadataId), typeId_(Exiv2::invalidTypeId), explicitType_(false) {
|
|
|
|
|
}
|
|
|
|
|
CmdId cmdId_; //!< Command identifier
|
|
|
|
|
ModifyCmd() = default;
|
|
|
|
|
CmdId cmdId_{invalidCmdId}; //!< Command identifier
|
|
|
|
|
std::string key_; //!< Exiv2 key string
|
|
|
|
|
MetadataId metadataId_; //!< Metadata identifier
|
|
|
|
|
Exiv2::TypeId typeId_; //!< Exiv2 type identifier
|
|
|
|
|
MetadataId metadataId_{invalidMetadataId}; //!< Metadata identifier
|
|
|
|
|
Exiv2::TypeId typeId_{Exiv2::invalidTypeId}; //!< Exiv2 type identifier
|
|
|
|
|
//! Flag to indicate if the type was explicitly specified (true)
|
|
|
|
|
bool explicitType_;
|
|
|
|
|
bool explicitType_{false};
|
|
|
|
|
std::string value_; //!< Data
|
|
|
|
|
};
|
|
|
|
|
//! Container for modification commands
|
|
|
|
|
using ModifyCmds = std::vector<ModifyCmd>;
|
|
|
|
|
//! Structure to link command identifiers to strings
|
|
|
|
|
struct CmdIdAndString {
|
|
|
|
|
CmdId cmdId_; //!< Commands identifier
|
|
|
|
|
std::string cmdString_; //!< Command string
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
using CmdIdAndString = std::pair<CmdId, std::string>;
|
|
|
|
|
/*!
|
|
|
|
|
@brief Implements the command line handling for the program.
|
|
|
|
|
|
|
|
|
@ -182,28 +176,28 @@ class Params : public Util::Getopt {
|
|
|
|
|
long adjustment_; //!< Adjustment value.
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
bool help_; //!< Help option flag.
|
|
|
|
|
bool version_; //!< Version option flag.
|
|
|
|
|
bool verbose_; //!< Verbose (talkative) option flag.
|
|
|
|
|
bool force_; //!< Force overwrites flag.
|
|
|
|
|
bool binary_; //!< Suppress long binary values.
|
|
|
|
|
bool unknown_; //!< Suppress unknown tags.
|
|
|
|
|
bool preserve_; //!< Preserve timestamps flag.
|
|
|
|
|
bool timestamp_; //!< Rename also sets the file timestamp.
|
|
|
|
|
bool timestampOnly_; //!< Rename only sets the file timestamp.
|
|
|
|
|
FileExistsPolicy fileExistsPolicy_; //!< What to do if file to rename exists.
|
|
|
|
|
bool adjust_; //!< Adjustment flag.
|
|
|
|
|
PrintMode printMode_; //!< Print mode.
|
|
|
|
|
unsigned long printItems_; //!< Print items.
|
|
|
|
|
unsigned long printTags_; //!< Print tags (bitmap of MetadataId flags).
|
|
|
|
|
bool help_{false}; //!< Help option flag.
|
|
|
|
|
bool version_{false}; //!< Version option flag.
|
|
|
|
|
bool verbose_{false}; //!< Verbose (talkative) option flag.
|
|
|
|
|
bool force_{false}; //!< Force overwrites flag.
|
|
|
|
|
bool binary_{false}; //!< Suppress long binary values.
|
|
|
|
|
bool unknown_{true}; //!< Suppress unknown tags.
|
|
|
|
|
bool preserve_{false}; //!< Preserve timestamps flag.
|
|
|
|
|
bool timestamp_{false}; //!< Rename also sets the file timestamp.
|
|
|
|
|
bool timestampOnly_{false}; //!< Rename only sets the file timestamp.
|
|
|
|
|
FileExistsPolicy fileExistsPolicy_{askPolicy}; //!< What to do if file to rename exists.
|
|
|
|
|
bool adjust_{false}; //!< Adjustment flag.
|
|
|
|
|
PrintMode printMode_{pmSummary}; //!< Print mode.
|
|
|
|
|
unsigned long printItems_{0}; //!< Print items.
|
|
|
|
|
unsigned long printTags_{Exiv2::mdNone}; //!< Print tags (bitmap of MetadataId flags).
|
|
|
|
|
//! %Action (integer rather than TaskType to avoid dependency).
|
|
|
|
|
int action_;
|
|
|
|
|
int action_{0};
|
|
|
|
|
int target_; //!< What common target to process.
|
|
|
|
|
|
|
|
|
|
long adjustment_; //!< Adjustment in seconds.
|
|
|
|
|
long adjustment_{0}; //!< Adjustment in seconds.
|
|
|
|
|
YodAdjust yodAdjust_[3]; //!< Year, month and day adjustment info.
|
|
|
|
|
std::string format_; //!< Filename format (-r option arg).
|
|
|
|
|
bool formatSet_; //!< Whether the format is set with -r
|
|
|
|
|
bool formatSet_{false}; //!< Whether the format is set with -r
|
|
|
|
|
CmdFiles cmdFiles_; //!< Names of the modification command files
|
|
|
|
|
CmdLines cmdLines_; //!< Commands from the command line
|
|
|
|
|
ModifyCmds modifyCmds_; //!< Parsed modification commands
|
|
|
|
@ -219,7 +213,7 @@ class Params : public Util::Getopt {
|
|
|
|
|
Exiv2::DataBuf stdinBuf; //!< DataBuf with the binary bytes from stdin
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
bool first_;
|
|
|
|
|
bool first_{true};
|
|
|
|
|
|
|
|
|
|
Params();
|
|
|
|
|
|
|
|
|
|