@@ -39,25 +39,19 @@ enum MetadataId {
3939// ! Structure for one parsed modification command
4040struct ModifyCmd {
4141 // ! C'tor
42- ModifyCmd () :
43- cmdId_ (invalidCmdId), metadataId_(invalidMetadataId), typeId_(Exiv2::invalidTypeId), explicitType_(false ) {
44- }
45- CmdId cmdId_; // !< Command identifier
46- std::string key_; // !< Exiv2 key string
47- MetadataId metadataId_; // !< Metadata identifier
48- Exiv2::TypeId typeId_; // !< Exiv2 type identifier
42+ ModifyCmd () = default ;
43+ CmdId cmdId_{invalidCmdId}; // !< Command identifier
44+ std::string key_; // !< Exiv2 key string
45+ MetadataId metadataId_{invalidMetadataId}; // !< Metadata identifier
46+ Exiv2::TypeId typeId_{Exiv2::invalidTypeId}; // !< Exiv2 type identifier
4947 // ! Flag to indicate if the type was explicitly specified (true)
50- bool explicitType_;
48+ bool explicitType_{ false } ;
5149 std::string value_; // !< Data
5250};
5351// ! Container for modification commands
5452using ModifyCmds = std::vector<ModifyCmd>;
5553// ! Structure to link command identifiers to strings
56- struct CmdIdAndString {
57- CmdId cmdId_; // !< Commands identifier
58- std::string cmdString_; // !< Command string
59- };
60-
54+ using CmdIdAndString = std::pair<CmdId, std::string>;
6155/* !
6256 @brief Implements the command line handling for the program.
6357
@@ -182,28 +176,28 @@ class Params : public Util::Getopt {
182176 long adjustment_; // !< Adjustment value.
183177 };
184178
185- bool help_; // !< Help option flag.
186- bool version_; // !< Version option flag.
187- bool verbose_; // !< Verbose (talkative) option flag.
188- bool force_; // !< Force overwrites flag.
189- bool binary_; // !< Suppress long binary values.
190- bool unknown_; // !< Suppress unknown tags.
191- bool preserve_; // !< Preserve timestamps flag.
192- bool timestamp_; // !< Rename also sets the file timestamp.
193- bool timestampOnly_; // !< Rename only sets the file timestamp.
194- FileExistsPolicy fileExistsPolicy_; // !< What to do if file to rename exists.
195- bool adjust_; // !< Adjustment flag.
196- PrintMode printMode_; // !< Print mode.
197- unsigned long printItems_; // !< Print items.
198- unsigned long printTags_; // !< Print tags (bitmap of MetadataId flags).
179+ bool help_{ false }; // !< Help option flag.
180+ bool version_{ false }; // !< Version option flag.
181+ bool verbose_{ false }; // !< Verbose (talkative) option flag.
182+ bool force_{ false }; // !< Force overwrites flag.
183+ bool binary_{ false }; // !< Suppress long binary values.
184+ bool unknown_{ true }; // !< Suppress unknown tags.
185+ bool preserve_{ false }; // !< Preserve timestamps flag.
186+ bool timestamp_{ false }; // !< Rename also sets the file timestamp.
187+ bool timestampOnly_{ false }; // !< Rename only sets the file timestamp.
188+ FileExistsPolicy fileExistsPolicy_{askPolicy} ; // !< What to do if file to rename exists.
189+ bool adjust_{ false }; // !< Adjustment flag.
190+ PrintMode printMode_{pmSummary} ; // !< Print mode.
191+ unsigned long printItems_{ 0 }; // !< Print items.
192+ unsigned long printTags_{Exiv2::mdNone}; // !< Print tags (bitmap of MetadataId flags).
199193 // ! %Action (integer rather than TaskType to avoid dependency).
200- int action_;
194+ int action_{ 0 } ;
201195 int target_; // !< What common target to process.
202196
203- long adjustment_; // !< Adjustment in seconds.
197+ long adjustment_{ 0 }; // !< Adjustment in seconds.
204198 YodAdjust yodAdjust_[3 ]; // !< Year, month and day adjustment info.
205199 std::string format_; // !< Filename format (-r option arg).
206- bool formatSet_; // !< Whether the format is set with -r
200+ bool formatSet_{ false }; // !< Whether the format is set with -r
207201 CmdFiles cmdFiles_; // !< Names of the modification command files
208202 CmdLines cmdLines_; // !< Commands from the command line
209203 ModifyCmds modifyCmds_; // !< Parsed modification commands
@@ -219,7 +213,7 @@ class Params : public Util::Getopt {
219213 Exiv2::DataBuf stdinBuf; // !< DataBuf with the binary bytes from stdin
220214
221215 private:
222- bool first_;
216+ bool first_{ true } ;
223217
224218 Params ();
225219
0 commit comments