[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:36:03 UTC 2017


Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=9890b51

The following commit has been merged in the master branch:
commit 9890b51ed2a8ab21408fa91a53df844e548e1110
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Sun Feb 15 10:16:21 2004 +0000

    Added print mode option
---
 src/exiv2.cpp | 46 +++++++++++++++++++++-------------------------
 src/exiv2.hpp | 11 ++++++++---
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/exiv2.cpp b/src/exiv2.cpp
index 1de751f..88f3158 100644
--- a/src/exiv2.cpp
+++ b/src/exiv2.cpp
@@ -22,13 +22,13 @@
   Abstract:  Command line program to display and manipulate image %Exif data
 
   File:      exiv2.cpp
-  Version:   $Name:  $ $Revision: 1.2 $
+  Version:   $Name:  $ $Revision: 1.3 $
   Author(s): Andreas Huggel (ahu) <ahuggel at gmx.net>
   History:   10-Dec-03, ahu: created
  */
 // *****************************************************************************
 #include "rcsid.hpp"
-EXIV2_RCSID("@(#) $Name:  $ $Revision: 1.2 $ $RCSfile: exiv2.cpp,v $")
+EXIV2_RCSID("@(#) $Name:  $ $Revision: 1.3 $ $RCSfile: exiv2.cpp,v $")
 
 // *****************************************************************************
 // included header files
@@ -129,6 +129,9 @@ void Params::help(std::ostream& os) const
        << "   -f      Do not prompt before overwriting existing files (force).
"
        << "   -a time Time adjustment in the format [-]HH[:MM[:SS]]. This option
"
        << "           is only used with the `adjust' action.
"
+       << "   -m mode Print mode for the `print' action. Possible modes are `s'
"
+       << "           for a summary (the default), `i' for interpreted data, `v'
"
+       << "           for uninterpreted data values and `h' for a hexdump
"
        << "   -r fmt  Filename format for the `rename' action. The format string
"
        << "           follows strftime(3). Default filename format is " 
        << format_ << ".
"
@@ -144,22 +147,11 @@ int Params::option(int opt, const std::string& optarg, int optopt)
 {
     int rc = 0;
     switch (opt) {
-    case 'h':
-        help_ = true;
-        break;
-
-    case 'V':
-        version_ = true;
-        break;
-
-    case 'v':
-        verbose_ = true;
-        break;
-
-    case 'f':
-        force_ = true;
-        break;
-
+    case 'h': help_ = true; break;
+    case 'V': version_ = true; break;
+    case 'v': verbose_ = true; break;
+    case 'f': force_ = true; break;
+    case 'r': format_ = optarg; break;
     case 'a':
         adjust_ = parseTime(optarg, adjustment_);
         if (!adjust_) {
@@ -168,30 +160,34 @@ int Params::option(int opt, const std::string& optarg, int optopt)
             rc = 1;
         }
         break;
-
-    case 'r':
-        format_ = optarg;
+    case 'm':
+        switch (optarg[0]) {
+        case 's': printMode_ = summary; break;
+        case 'i': printMode_ = interpreted; break;
+        case 'v': printMode_ = values; break;
+        case 'h': printMode_ = hexdump; break;
+        default:
+            std::cerr << progname() << ": Unrecognized print mode `"
+                      << optarg << "'
";
+            rc = 1;
+        }
         break;
-
     case ':':
         std::cerr << progname() << ": Option -" << static_cast<char>(optopt) 
                   << " requires an argument
";
         rc = 1;
         break;
-
     case '?':
         std::cerr << progname() << ": Unrecognized option -" 
                   << static_cast<char>(optopt) << "
";
         rc = 1;
         break;
-
     default:
         std::cerr << progname() 
                   << ": getopt returned unexpected character code " 
                   << std::hex << opt << "
";
         rc = 1;
     }
-
     return rc;
 } // Params::option
 
diff --git a/src/exiv2.hpp b/src/exiv2.hpp
index 8623717..0c48fca 100644
--- a/src/exiv2.hpp
+++ b/src/exiv2.hpp
@@ -21,7 +21,7 @@
 /*!
   @file    exiv2.hpp
   @brief   Defines class Params, used for the command line handling of exiv2
-  @version $Name:  $ $Revision: 1.1 $
+  @version $Name:  $ $Revision: 1.2 $
   @author  Andreas Huggel (ahu)
            <a href="mailto:ahuggel at gmx.net">ahuggel at gmx.net</a>
   @date    08-Dec-03, ahu: created
@@ -85,13 +85,17 @@ public:
     */
     static Params& instance();
 
+    //! Enumerates print modes
+    enum PrintMode { summary, interpreted, values, hexdump };
+
     bool help_;                         //!< Help option flag.
     bool version_;                      //!< Version option flag.
     bool verbose_;                      //!< Verbose (talkative) option flag.
     bool force_;                        //!< Force overwrites flag. 
     bool adjust_;                       //!< Adjustment flag.
+    PrintMode printMode_;               //!< Print mode. 
     //! %Action (integer rather than TaskType to avoid dependency).
-    int  action_;                       
+    int  action_;
 
     long adjustment_;                   //!< Adjustment in seconds.
     std::string format_;                //!< Filename format (-r option arg).
@@ -106,12 +110,13 @@ private:
       @brief Default constructor. Note that optstring_ is initialized here.
              Private to force instantiation through instance().
      */
-    Params() : optstring_(":hVvfa:r:"),
+    Params() : optstring_(":hVvfa:r:m:"),
                help_(false), 
                version_(false),
                verbose_(false), 
                force_(false), 
                adjust_(false),
+               printMode_(summary),
                action_(0),
                adjustment_(0),
                format_("%Y%m%d_%H%M%S"),

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list