[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a
Maximiliano Curia
maxy at moszumanska.debian.org
Thu Jul 13 17:39:44 UTC 2017
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=66af728
The following commit has been merged in the master branch:
commit 66af728d3883c831c18262fc744842739770f955
Author: Andreas Huggel <ahuggel at gmx.net>
Date: Sat Aug 23 04:28:06 2008 +0000
Removed struct ErrMsg from public API.
---
src/error.cpp | 130 +++++++++++++++++++++++++++++++---------------------------
src/error.hpp | 12 ------
2 files changed, 70 insertions(+), 72 deletions(-)
diff --git a/src/error.cpp b/src/error.cpp
index 9e2e4a6..fe97d7c 100644
--- a/src/error.cpp
+++ b/src/error.cpp
@@ -37,73 +37,83 @@ EXIV2_RCSID("@(#) $Id$")
#include <string>
// *****************************************************************************
-// class member definitions
-namespace Exiv2 {
+namespace {
- const ErrMsg Error::errMsg_[] = {
- ErrMsg( -1, N_("Error %0: arg1=%1, arg2=%2, arg3=%3.")),
- ErrMsg( 0, N_("Success")),
- ErrMsg( 1, "%1"), // %1=error message
- ErrMsg( 2, "%1: %2 (%3)"), // %1=path, %2=strerror, %3=function that failed
- ErrMsg( 3, N_("This does not look like a %1 image")), // %1=Image type
- ErrMsg( 4, N_("Invalid dataset name `%1'")), // %1=dataset name
- ErrMsg( 5, N_("Invalid record name `%1'")), // %1=record name
- ErrMsg( 6, N_("Invalid key `%1'")), // %1=key
- ErrMsg( 7, N_("Invalid tag name or ifdId `%1', ifdId %2")), // %1=tag name, %2=ifdId
- ErrMsg( 8, N_("Value not set")),
- ErrMsg( 9, N_("%1: Failed to open the data source: %2")), // %1=path, %2=strerror
- ErrMsg( 10, N_("%1: Failed to open file (%2): %3")), // %1=path, %2=mode, %3=strerror
- ErrMsg( 11, N_("%1: The file contains data of an unknown image type")), // %1=path
- ErrMsg( 12, N_("The memory contains data of an unknown image type")),
- ErrMsg( 13, N_("Image type %1 is not supported")), // %1=image type
- ErrMsg( 14, N_("Failed to read image data")),
- ErrMsg( 15, N_("This does not look like a JPEG image")),
-// ErrMsg( 16, N_("")), -- currently not used
- ErrMsg( 17, N_("%1: Failed to rename file to %2: %3")), // %1=old path, %2=new path, %3=strerror
- ErrMsg( 18, N_("%1: Transfer failed: %2")), // %1=path, %2=strerror
- ErrMsg( 19, N_("Memory transfer failed: %1")), // %1=strerror
- ErrMsg( 20, N_("Failed to read input data")),
- ErrMsg( 21, N_("Failed to write image")),
- ErrMsg( 22, N_("Input data does not contain a valid image")),
- ErrMsg( 23, N_("Invalid ifdId %1")), // %1=ifdId
- ErrMsg( 24, N_("Entry::setValue: Value too large (tag=%1, size=%2, requested=%3)")), // %1=tag, %2=dataSize, %3=required size
- ErrMsg( 25, N_("Entry::setDataArea: Value too large (tag=%1, size=%2, requested=%3)")), // %1=tag, %2=dataAreaSize, %3=required size
- ErrMsg( 26, N_("Offset out of range")),
- ErrMsg( 27, N_("Unsupported data area offset type")),
- ErrMsg( 28, N_("Invalid charset: `%1'")), // %1=charset name
- ErrMsg( 29, N_("Unsupported date format")),
- ErrMsg( 30, N_("Unsupported time format")),
- ErrMsg( 31, N_("Writing to %2 images is not supported")), // %2=image format
- ErrMsg( 32, N_("Setting %1 in %2 images is not supported")), // %1=metadata type, %2=image format
- ErrMsg( 33, N_("This does not look like a CRW image")),
- ErrMsg( 34, N_("%1: Not supported")), // %1=function
- ErrMsg( 35, N_("No namespace info available for XMP prefix `%1'")), // %1=prefix
- ErrMsg( 36, N_("No prefix registered for namespace `%1'")), // %1=namespace
- ErrMsg( 37, N_("Size of %1 JPEG segment is larger than 65535 bytes")), // %1=type of metadata (Exif, IPTC, JPEG comment)
- ErrMsg( 38, N_("Unhandled Xmpdatum %1 of type %2")), // %1=key, %2=value type
- ErrMsg( 39, N_("Unhandled XMP node %1 with opt=%2")), // %1=key, %2=XMP Toolkit option flags
- ErrMsg( 40, N_("XMP Toolkit error %1: %2")), // %1=XMP_Error::GetID(), %2=XMP_Error::GetErrMsg()
- ErrMsg( 41, N_("Failed to decode Lang Alt property %1 with opt=%2")), // %1=property path, %3=XMP Toolkit option flags
- ErrMsg( 42, N_("Failed to decode Lang Alt qualifier %1 with opt=%2")), // %1=qualifier path, %3=XMP Toolkit option flags
- ErrMsg( 43, N_("Failed to encode Lang Alt property %1")), // %1=key
- ErrMsg( 44, N_("Failed to determine property name from path %1, namespace %2")), // %1=property path, %2=namespace
- ErrMsg( 45, N_("Schema namespace %1 is not registered with the XMP Toolkit")), // %1=namespace
- ErrMsg( 46, N_("No namespace registered for prefix `%1'")), // %1=prefix
- ErrMsg( 47, N_("Aliases are not supported. Please send this XMP packet to ahuggel at gmx.net `%1', `%2', `%3'")), // %1=namespace, %2=property path, %3=value
- ErrMsg( 48, N_("Invalid XmpText type `%1'")), // %1=type
- ErrMsg( 49, N_("TIFF directory %1 has too many entries")), // %1=TIFF directory name
- ErrMsg( 50, N_("Multiple TIFF array element tags %1 in one directory")), // %1=tag number
- ErrMsg( 51, N_("TIFF array element tag %1 has wrong type")), // %1=tag number
+ //! Helper structure defining an error message.
+ struct ErrMsg {
+ int code_; //!< Error code
+ const char* message_; //!< Error message
+ };
+ const ErrMsg errMsg[] = {
+ { -1, N_("Error %0: arg1=%1, arg2=%2, arg3=%3.") },
+ { 0, N_("Success") },
+ { 1, "%1" }, // %1=error message
+ { 2, "%1: %2 (%3)" }, // %1=path, %2=strerror, %3=function that failed
+ { 3, N_("This does not look like a %1 image") }, // %1=Image type
+ { 4, N_("Invalid dataset name `%1'") }, // %1=dataset name
+ { 5, N_("Invalid record name `%1'") }, // %1=record name
+ { 6, N_("Invalid key `%1'") }, // %1=key
+ { 7, N_("Invalid tag name or ifdId `%1', ifdId %2") }, // %1=tag name, %2=ifdId
+ { 8, N_("Value not set") },
+ { 9, N_("%1: Failed to open the data source: %2") }, // %1=path, %2=strerror
+ { 10, N_("%1: Failed to open file (%2): %3") }, // %1=path, %2=mode, %3=strerror
+ { 11, N_("%1: The file contains data of an unknown image type") }, // %1=path
+ { 12, N_("The memory contains data of an unknown image type") },
+ { 13, N_("Image type %1 is not supported") }, // %1=image type
+ { 14, N_("Failed to read image data") },
+ { 15, N_("This does not look like a JPEG image") },
+// { 16, N_("") }, -- currently not used
+ { 17, N_("%1: Failed to rename file to %2: %3") }, // %1=old path, %2=new path, %3=strerror
+ { 18, N_("%1: Transfer failed: %2") }, // %1=path, %2=strerror
+ { 19, N_("Memory transfer failed: %1") }, // %1=strerror
+ { 20, N_("Failed to read input data") },
+ { 21, N_("Failed to write image") },
+ { 22, N_("Input data does not contain a valid image") },
+ { 23, N_("Invalid ifdId %1") }, // %1=ifdId
+ { 24, N_("Entry::setValue: Value too large (tag=%1, size=%2, requested=%3)") }, // %1=tag, %2=dataSize, %3=required size
+ { 25, N_("Entry::setDataArea: Value too large (tag=%1, size=%2, requested=%3)") }, // %1=tag, %2=dataAreaSize, %3=required size
+ { 26, N_("Offset out of range") },
+ { 27, N_("Unsupported data area offset type") },
+ { 28, N_("Invalid charset: `%1'") }, // %1=charset name
+ { 29, N_("Unsupported date format") },
+ { 30, N_("Unsupported time format") },
+ { 31, N_("Writing to %2 images is not supported") }, // %2=image format
+ { 32, N_("Setting %1 in %2 images is not supported") }, // %1=metadata type, %2=image format
+ { 33, N_("This does not look like a CRW image") },
+ { 34, N_("%1: Not supported") }, // %1=function
+ { 35, N_("No namespace info available for XMP prefix `%1'") }, // %1=prefix
+ { 36, N_("No prefix registered for namespace `%1'") }, // %1=namespace
+ { 37, N_("Size of %1 JPEG segment is larger than 65535 bytes") }, // %1=type of metadata (Exif, IPTC, JPEG comment)
+ { 38, N_("Unhandled Xmpdatum %1 of type %2") }, // %1=key, %2=value type
+ { 39, N_("Unhandled XMP node %1 with opt=%2") }, // %1=key, %2=XMP Toolkit option flags
+ { 40, N_("XMP Toolkit error %1: %2") }, // %1=XMP_Error::GetID(), %2=XMP_Error::GetErrMsg()
+ { 41, N_("Failed to decode Lang Alt property %1 with opt=%2") }, // %1=property path, %3=XMP Toolkit option flags
+ { 42, N_("Failed to decode Lang Alt qualifier %1 with opt=%2") }, // %1=qualifier path, %3=XMP Toolkit option flags
+ { 43, N_("Failed to encode Lang Alt property %1") }, // %1=key
+ { 44, N_("Failed to determine property name from path %1, namespace %2") }, // %1=property path, %2=namespace
+ { 45, N_("Schema namespace %1 is not registered with the XMP Toolkit") }, // %1=namespace
+ { 46, N_("No namespace registered for prefix `%1'") }, // %1=prefix
+ { 47, N_("Aliases are not supported. Please send this XMP packet to ahuggel at gmx.net `%1', `%2', `%3'") }, // %1=namespace, %2=property path, %3=value
+ { 48, N_("Invalid XmpText type `%1'") }, // %1=type
+ { 49, N_("TIFF directory %1 has too many entries") }, // %1=TIFF directory name
+ { 50, N_("Multiple TIFF array element tags %1 in one directory") }, // %1=tag number
+ { 51, N_("TIFF array element tag %1 has wrong type") }, // %1=tag number
// Last error message (message is not used)
- ErrMsg( -2, N_("(Unknown Error)"))
+ { -2, N_("(Unknown Error)") }
};
+}
+
+// *****************************************************************************
+// class member definitions
+namespace Exiv2 {
+
int Error::errorIdx(int code)
{
int idx;
- for (idx = 0; errMsg_[idx].code_ != code; ++idx) {
- if (errMsg_[idx].code_ == -2) return 0;
+ for (idx = 0; errMsg[idx].code_ != code; ++idx) {
+ if (errMsg[idx].code_ == -2) return 0;
}
return idx;
}
@@ -111,7 +121,7 @@ namespace Exiv2 {
void Error::setMsg()
{
int idx = errorIdx(code_);
- msg_ = std::string(_(errMsg_[idx].message_));
+ msg_ = std::string(_(errMsg[idx].message_));
std::string::size_type pos;
pos = msg_.find("%0");
if (pos != std::string::npos) {
diff --git a/src/error.hpp b/src/error.hpp
index 6b97fbe..caed287 100644
--- a/src/error.hpp
+++ b/src/error.hpp
@@ -46,17 +46,6 @@ namespace Exiv2 {
// *****************************************************************************
// class definitions
- //! Helper structure defining an error message.
- struct ErrMsg {
- //! Constructor
- ErrMsg(int code, const char* message)
- : code_(code), message_(message)
- {
- }
- int code_; //!< Error code
- const char* message_; //!< Error message
- };
-
/*!
@brief Error class interface. Allows the definition and use of a hierarchy
of error classes which can all be handled in one catch block.
@@ -155,7 +144,6 @@ namespace Exiv2 {
std::string arg3_; //!< Third argument
std::string msg_; //!< Complete error message
- static const ErrMsg errMsg_[]; //!< List of error messages
}; // class Error
} // namespace Exiv2
--
exiv2 packaging
More information about the pkg-kde-commits
mailing list