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
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*/)
{
// not supported
@ -120,10 +132,8 @@ namespace Exiv2 {
void Cr2Image::writeMetadata()
{
/*
Todo: implement me!
*/
throw(Error(31, "metadata", "CR2"));
//! Todo: implement me!
throw(Error(31, "CR2"));
} // Cr2Image::writeMetadata
const uint16_t Cr2Header::tag_ = 42;

@ -85,6 +85,16 @@ namespace Exiv2 {
yet implemented. Calling it will throw an Error(31).
*/
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.
Calling this function will throw an Error(32).

@ -73,7 +73,7 @@ namespace Exiv2 {
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 %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( 33, N_("This does not look like a CRW image")),
ErrMsg( 34, N_("%1: Not supported")), // %1=function

@ -59,6 +59,18 @@ namespace Exiv2 {
{
} // 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*/)
{
// not supported
@ -116,10 +128,8 @@ namespace Exiv2 {
void MrwImage::writeMetadata()
{
/*
Todo: implement me!
*/
throw(Error(31, "metadata", "MRW"));
// Todo: implement me!
throw(Error(31, "MRW"));
} // MrwImage::writeMetadata
// *************************************************************************

@ -84,6 +84,16 @@ namespace Exiv2 {
yet implemented. Calling it will throw an Error(31).
*/
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.
Calling this function will throw an Error(32).

@ -62,10 +62,22 @@ namespace Exiv2 {
{
} // 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*/)
{
// not yet supported
// TODO : Add 'iTXt' chunk 'Description' tag support here
// Todo: implement me!
// Add 'iTXt' chunk 'Description' tag support here
throw(Error(32, "Image comment", "PNG"));
}
@ -104,10 +116,8 @@ namespace Exiv2 {
void PngImage::writeMetadata()
{
/*
Todo: implement me!
*/
throw(Error(31, "metadata", "PNG"));
//! Todo: implement me!
throw(Error(31, "PNG"));
} // PngImage::writeMetadata
// *************************************************************************

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

@ -59,6 +59,18 @@ namespace Exiv2 {
{
} // 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*/)
{
// not supported
@ -96,10 +108,8 @@ namespace Exiv2 {
void RafImage::writeMetadata()
{
/*
Todo: implement me!
*/
throw(Error(31, "metadata", "RAF"));
//! Todo: implement me!
throw(Error(31, "RAF"));
} // RafImage::writeMetadata
// *************************************************************************

@ -83,6 +83,16 @@ namespace Exiv2 {
yet implemented. Calling it will throw an Error(31).
*/
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.
Calling this function will throw an Error(32).

@ -59,6 +59,18 @@ namespace Exiv2 {
{
} // 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*/)
{
// not supported
@ -84,10 +96,8 @@ namespace Exiv2 {
void TiffImage::writeMetadata()
{
/*
Todo: implement me!
*/
throw(Error(31, "metadata", "TIFF"));
//! Todo: implement me!
throw(Error(31, "TIFF"));
} // TiffImage::writeMetadata
const uint16_t TiffHeade2::tag_ = 42;

@ -77,17 +77,27 @@ namespace Exiv2 {
//! @name Manipulators
//@{
void readMetadata();
void readMetadata();
/*!
@brief Todo: Write metadata back to the image. This method is not
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.
Calling this function will throw an Error(32).
*/
void setComment(const std::string& comment);
void setComment(const std::string& comment);
//@}
private:

Loading…
Cancel
Save