Improved consistency of handling unsupported functions across image subclasses. setExif/Iptc/Comment methods throw Error(32), writeMetadata throws Error(31) if not yet implemented or not available for an image format.

v0.27.3
Andreas Huggel 19 years ago
parent 10681d6c3e
commit 4a1f79c8b4

@ -92,6 +92,18 @@ namespace Exiv2 {
{ {
} // Cr2Image::Cr2Image } // Cr2Image::Cr2Image
void Cr2Image::setExifData(const ExifData& /*exifData*/)
{
// Todo: implement me!
throw(Error(32, "Exif metadata", "CR2"));
}
void Cr2Image::setIptcData(const IptcData& /*iptcData*/)
{
// Todo: implement me!
throw(Error(32, "IPTC metadata", "CR2"));
}
void Cr2Image::setComment(const std::string& /*comment*/) void Cr2Image::setComment(const std::string& /*comment*/)
{ {
// not supported // not supported
@ -120,10 +132,8 @@ namespace Exiv2 {
void Cr2Image::writeMetadata() void Cr2Image::writeMetadata()
{ {
/* //! Todo: implement me!
Todo: implement me! throw(Error(31, "CR2"));
*/
throw(Error(31, "metadata", "CR2"));
} // Cr2Image::writeMetadata } // Cr2Image::writeMetadata
const uint16_t Cr2Header::tag_ = 42; const uint16_t Cr2Header::tag_ = 42;

@ -85,6 +85,16 @@ namespace Exiv2 {
yet implemented. Calling it will throw an Error(31). yet implemented. Calling it will throw an Error(31).
*/ */
void writeMetadata(); void writeMetadata();
/*!
@brief Todo: Not supported yet, requires writeMetadata(). Calling
this function will throw an Error(32).
*/
void setExifData(const ExifData& exifData);
/*!
@brief Todo: Not supported yet, requires writeMetadata(). Calling
this function will throw an Error(32).
*/
void setIptcData(const IptcData& iptcData);
/*! /*!
@brief Not supported. CR2 format does not contain a comment. @brief Not supported. CR2 format does not contain a comment.
Calling this function will throw an Error(32). Calling this function will throw an Error(32).

@ -73,7 +73,7 @@ namespace Exiv2 {
ErrMsg( 28, N_("Invalid charset: `%1'")), // %1=charset name ErrMsg( 28, N_("Invalid charset: `%1'")), // %1=charset name
ErrMsg( 29, N_("Unsupported date format")), ErrMsg( 29, N_("Unsupported date format")),
ErrMsg( 30, N_("Unsupported time format")), ErrMsg( 30, N_("Unsupported time format")),
ErrMsg( 31, N_("Writing %1 to %2 images is not supported")), // %1=metadata type, %2=image format ErrMsg( 31, N_("Writing to %2 images is not supported")), // %2=image format
ErrMsg( 32, N_("%1 in %2 images is not supported")), // %1=metadata type, %2=image format ErrMsg( 32, N_("%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( 33, N_("This does not look like a CRW image")),
ErrMsg( 34, N_("%1: Not supported")), // %1=function ErrMsg( 34, N_("%1: Not supported")), // %1=function

@ -59,6 +59,18 @@ namespace Exiv2 {
{ {
} // MrwImage::MrwImage } // MrwImage::MrwImage
void MrwImage::setExifData(const ExifData& /*exifData*/)
{
// Todo: implement me!
throw(Error(32, "Exif metadata", "MRW"));
}
void MrwImage::setIptcData(const IptcData& /*iptcData*/)
{
// Todo: implement me!
throw(Error(32, "IPTC metadata", "MRW"));
}
void MrwImage::setComment(const std::string& /*comment*/) void MrwImage::setComment(const std::string& /*comment*/)
{ {
// not supported // not supported
@ -116,10 +128,8 @@ namespace Exiv2 {
void MrwImage::writeMetadata() void MrwImage::writeMetadata()
{ {
/* // Todo: implement me!
Todo: implement me! throw(Error(31, "MRW"));
*/
throw(Error(31, "metadata", "MRW"));
} // MrwImage::writeMetadata } // MrwImage::writeMetadata
// ************************************************************************* // *************************************************************************

@ -84,6 +84,16 @@ namespace Exiv2 {
yet implemented. Calling it will throw an Error(31). yet implemented. Calling it will throw an Error(31).
*/ */
void writeMetadata(); void writeMetadata();
/*!
@brief Todo: Not supported yet, requires writeMetadata(). Calling
this function will throw an Error(32).
*/
void setExifData(const ExifData& exifData);
/*!
@brief Todo: Not supported yet, requires writeMetadata(). Calling
this function will throw an Error(32).
*/
void setIptcData(const IptcData& iptcData);
/*! /*!
@brief Not supported. MRW format does not contain a comment. @brief Not supported. MRW format does not contain a comment.
Calling this function will throw an Error(32). Calling this function will throw an Error(32).

@ -62,10 +62,22 @@ namespace Exiv2 {
{ {
} // PngImage::PngImage } // PngImage::PngImage
void PngImage::setExifData(const ExifData& /*exifData*/)
{
// Todo: implement me!
throw(Error(32, "Exif metadata", "PNG"));
}
void PngImage::setIptcData(const IptcData& /*iptcData*/)
{
// Todo: implement me!
throw(Error(32, "IPTC metadata", "PNG"));
}
void PngImage::setComment(const std::string& /*comment*/) void PngImage::setComment(const std::string& /*comment*/)
{ {
// not yet supported // Todo: implement me!
// TODO : Add 'iTXt' chunk 'Description' tag support here // Add 'iTXt' chunk 'Description' tag support here
throw(Error(32, "Image comment", "PNG")); throw(Error(32, "Image comment", "PNG"));
} }
@ -104,10 +116,8 @@ namespace Exiv2 {
void PngImage::writeMetadata() void PngImage::writeMetadata()
{ {
/* //! Todo: implement me!
Todo: implement me! throw(Error(31, "PNG"));
*/
throw(Error(31, "metadata", "PNG"));
} // PngImage::writeMetadata } // PngImage::writeMetadata
// ************************************************************************* // *************************************************************************

@ -88,9 +88,18 @@ namespace Exiv2 {
*/ */
void writeMetadata(); void writeMetadata();
/*! /*!
@brief Not supported. PNG format does not contain a comment. @brief Todo: Not supported yet, requires writeMetadata(). Calling
Calling it will throw an Error(32).<br> this function will throw an Error(32).
Todo: Add 'iTXt' chunk 'Description' tag support here. */
void setExifData(const ExifData& exifData);
/*!
@brief Todo: Not supported yet, requires writeMetadata(). Calling
this function will throw an Error(32).
*/
void setIptcData(const IptcData& iptcData);
/*!
@brief Todo: Not supported yet, requires writeMetadata(). Calling
this function will throw an Error(32).
*/ */
void setComment(const std::string& comment); void setComment(const std::string& comment);
//@} //@}

@ -59,6 +59,18 @@ namespace Exiv2 {
{ {
} // RafImage::RafImage } // RafImage::RafImage
void RafImage::setExifData(const ExifData& /*exifData*/)
{
// Todo: implement me!
throw(Error(32, "Exif metadata", "RAF"));
}
void RafImage::setIptcData(const IptcData& /*iptcData*/)
{
// Todo: implement me!
throw(Error(32, "IPTC metadata", "RAF"));
}
void RafImage::setComment(const std::string& /*comment*/) void RafImage::setComment(const std::string& /*comment*/)
{ {
// not supported // not supported
@ -96,10 +108,8 @@ namespace Exiv2 {
void RafImage::writeMetadata() void RafImage::writeMetadata()
{ {
/* //! Todo: implement me!
Todo: implement me! throw(Error(31, "RAF"));
*/
throw(Error(31, "metadata", "RAF"));
} // RafImage::writeMetadata } // RafImage::writeMetadata
// ************************************************************************* // *************************************************************************

@ -83,6 +83,16 @@ namespace Exiv2 {
yet implemented. Calling it will throw an Error(31). yet implemented. Calling it will throw an Error(31).
*/ */
void writeMetadata(); void writeMetadata();
/*!
@brief Todo: Not supported yet, requires writeMetadata(). Calling
this function will throw an Error(32).
*/
void setExifData(const ExifData& exifData);
/*!
@brief Todo: Not supported yet, requires writeMetadata(). Calling
this function will throw an Error(32).
*/
void setIptcData(const IptcData& iptcData);
/*! /*!
@brief Not supported. RAF format does not contain a comment. @brief Not supported. RAF format does not contain a comment.
Calling this function will throw an Error(32). Calling this function will throw an Error(32).

@ -59,6 +59,18 @@ namespace Exiv2 {
{ {
} // TiffImage::TiffImage } // TiffImage::TiffImage
void TiffImage::setExifData(const ExifData& /*exifData*/)
{
// Todo: implement me!
throw(Error(32, "Exif metadata", "TIFF"));
}
void TiffImage::setIptcData(const IptcData& /*iptcData*/)
{
// Todo: implement me!
throw(Error(32, "IPTC metadata", "TIFF"));
}
void TiffImage::setComment(const std::string& /*comment*/) void TiffImage::setComment(const std::string& /*comment*/)
{ {
// not supported // not supported
@ -84,10 +96,8 @@ namespace Exiv2 {
void TiffImage::writeMetadata() void TiffImage::writeMetadata()
{ {
/* //! Todo: implement me!
Todo: implement me! throw(Error(31, "TIFF"));
*/
throw(Error(31, "metadata", "TIFF"));
} // TiffImage::writeMetadata } // TiffImage::writeMetadata
const uint16_t TiffHeade2::tag_ = 42; const uint16_t TiffHeade2::tag_ = 42;

@ -83,6 +83,16 @@ namespace Exiv2 {
yet implemented. Calling it will throw an Error(31). yet implemented. Calling it will throw an Error(31).
*/ */
void writeMetadata(); void writeMetadata();
/*!
@brief Todo: Not supported yet, requires writeMetadata(). Calling
this function will throw an Error(32).
*/
void setExifData(const ExifData& exifData);
/*!
@brief Todo: Not supported yet, requires writeMetadata(). Calling
this function will throw an Error(32).
*/
void setIptcData(const IptcData& iptcData);
/*! /*!
@brief Not supported. TIFF format does not contain a comment. @brief Not supported. TIFF format does not contain a comment.
Calling this function will throw an Error(32). Calling this function will throw an Error(32).

Loading…
Cancel
Save