~ubuntu-branches/ubuntu/precise/exiv2/precise

« back to all changes in this revision

Viewing changes to src/exiv2.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Mercatante
  • Date: 2006-12-07 18:40:10 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20061207184010-0ouu8v0dr8nznob9
Tags: 0.12-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
  Abstract:  Command line program to display and manipulate image %Exif data
23
23
 
24
24
  File:      exiv2.cpp
25
 
  Version:   $Rev: 788 $
 
25
  Version:   $Rev: 983 $
26
26
  Author(s): Andreas Huggel (ahu) <ahuggel@gmx.net>
27
27
  History:   10-Dec-03, ahu: created
28
28
 */
29
29
// *****************************************************************************
30
30
#include "rcsid.hpp"
31
 
EXIV2_RCSID("@(#) $Id: exiv2.cpp 788 2006-05-21 10:12:18Z ahuggel $");
 
31
EXIV2_RCSID("@(#) $Id: exiv2.cpp 983 2006-11-16 14:42:38Z ahuggel $")
32
32
 
33
33
// *****************************************************************************
34
34
// included header files
259
259
       << "   -e tgt  Extract target(s) for the 'extract' action. Possible targets\n"
260
260
       << "           are the same as those for the -d option.\n"
261
261
       << "   -r fmt  Filename format for the 'rename' action. The format string\n"
262
 
       << "           follows strftime(3). Default filename format is "
263
 
       <<             format_ << ".\n"
 
262
       << "           follows strftime(3). The following keywords are supported:\n"
 
263
       << "             :basename:   - original filename without extension\n"
 
264
       << "             :dirname:    - name of the directory holding the original file\n"
 
265
       << "             :parentname: - name of parent directory\n"
 
266
       << "           Default filename format is " << format_ << ".\n"
264
267
       << "   -c txt  Jpeg comment string to set in the image.\n"
265
268
       << "   -m file Command file for the modify action. The format for commands is\n"
266
269
       << "           set|add|del <key> [[<type>] <value>].\n"
903
906
 
904
907
            value = line.substr(valStart, valEnd+1-valStart);
905
908
            std::string::size_type last = value.length()-1;
906
 
            if (  (value[0] == '"' || value[last] == '"')
907
 
                && value[0] != value[last]) {
908
 
                throw Exiv2::Error(1, Exiv2::toString(num)
909
 
                                    + ": Unbalanced quotes");
910
 
            }
911
 
            if (value[0] == '"') {
 
909
            if (   (value[0] == '"' && value[last] == '"')
 
910
                || (value[0] == '\'' && value[last] == '\'')) {
912
911
                value = value.substr(1, value.length()-2);
913
912
            }
914
913
        }