Remove bmffimage::printStructure() as discussed in review with @hassec. Corpse removal and cleanup in bmpfimage.hpp

main
Robin Mills 4 years ago
parent dcfe538a09
commit 44d976c2a1

@ -88,19 +88,6 @@ namespace Exiv2
//@{ //@{
void readMetadata() /* override */; void readMetadata() /* override */;
void writeMetadata() /* override */; void writeMetadata() /* override */;
/*!
@brief Print out the structure of image file.
@throw Error if reading of the file fails or the image data is
not valid (does not look like data of the specific image type).
@warning This function is not thread safe and intended for exiv2 -pS for debugging.
*/
void printStructure(std::ostream& out, PrintStructureOption option, int depth) /* override */;
/*!
@brief Todo: Not supported yet(?). Calling this function will throw
an instance of Error(kerInvalidSettingForImage).
*/
void setComment(const std::string& comment) /* override */; void setComment(const std::string& comment) /* override */;
//@} //@}
@ -110,12 +97,6 @@ namespace Exiv2
int pixelWidth() const; int pixelWidth() const;
int pixelHeight() const; int pixelHeight() const;
//@} //@}
#if 0
BmffImage& operator=(const BmffImage& rhs) /* = delete*/ ;
BmffImage& operator=(const BmffImage&& rhs) /* = delete */ ;
BmffImage(const BmffImage& rhs) /* = delete */;
BmffImage(const BmffImage&& rhs) /* = delete */;
#endif
private: private:
/*! /*!
@ -125,27 +106,17 @@ namespace Exiv2
@warning This function should only be called by readMetadata() @warning This function should only be called by readMetadata()
*/ */
long boxHandler(int depth = 0); long boxHandler(int depth = 0);
uint32_t fileType;
std::set<uint64_t> visits_;
uint64_t visits_max_;
std::string indent(int i) std::string indent(int i)
{ {
return std::string(2*i,' '); return std::string(2*i,' ');
} }
uint16_t unknownID_; // 0xffff uint32_t fileType_;
uint16_t exifID_; std::set<uint64_t> visits_;
uint64_t visits_max_;
uint16_t unknownID_; // 0xffff
uint16_t exifID_;
std::map<uint32_t, Iloc> ilocs_; std::map<uint32_t, Iloc> ilocs_;
/*!
@brief Provides the main implementation of writeMetadata() by
writing all buffered metadata to the provided BasicIo.
@param oIo BasicIo instance to write to (a temporary location).
@return 4 if opening or writing to the associated BasicIo fails
*/
void doWriteMetadata(BasicIo& outIo);
//@} //@}
/*! /*!
@ -153,8 +124,8 @@ namespace Exiv2
*/ */
std::string toAscii(long n); std::string toAscii(long n);
std::string boxName(uint32_t box); std::string boxName(uint32_t box);
bool superBox(uint32_t box); bool superBox(uint32_t box);
bool fullBox(uint32_t box); bool fullBox(uint32_t box);
std::string uuidName(Exiv2::DataBuf& uuid); std::string uuidName(Exiv2::DataBuf& uuid);
}; // class BmffImage }; // class BmffImage

@ -141,7 +141,7 @@ namespace Exiv2
std::string BmffImage::mimeType() const std::string BmffImage::mimeType() const
{ {
switch (fileType) { switch (fileType_) {
case TAG_avif: case TAG_avif:
return "image/avif"; return "image/avif";
case TAG_heic: case TAG_heic:
@ -238,9 +238,9 @@ namespace Exiv2
switch (box.type) { switch (box.type) {
case TAG_ftyp: { case TAG_ftyp: {
fileType = getLong(data.pData_, bigEndian); fileType_ = getLong(data.pData_, bigEndian);
#ifdef EXIV2_DEBUG_MESSAGES #ifdef EXIV2_DEBUG_MESSAGES
std::cerr << "brand: " << toAscii(fileType); std::cerr << "brand: " << toAscii(fileType_);
#endif #endif
} break; } break;
@ -439,7 +439,7 @@ namespace Exiv2
void BmffImage::setComment(const std::string& /*comment*/) void BmffImage::setComment(const std::string& /*comment*/)
{ {
// Todo: implement me! // bmff files are read-only
throw(Error(kerInvalidSettingForImage, "Image comment", "BMFF")); throw(Error(kerInvalidSettingForImage, "Image comment", "BMFF"));
} // BmffImage::setComment } // BmffImage::setComment
@ -469,24 +469,10 @@ namespace Exiv2
} }
} // BmffImage::readMetadata } // BmffImage::readMetadata
void BmffImage::printStructure(std::ostream& out, PrintStructureOption option, int depth)
{
if (io_->open() != 0)
throw Error(kerDataSourceOpenFailed, io_->path(), strError());
// Ensure that this is the correct image type
if (!isBmffType(*io_, false)) {
if (io_->error() || io_->eof())
throw Error(kerFailedToReadImageData);
throw Error(kerNotAnImage);
}
UNUSED(out);
UNUSED(option);
UNUSED(depth);
} // BmffImage::printStructure
void BmffImage::writeMetadata() void BmffImage::writeMetadata()
{ {
// bmff files are read-only
throw(Error(kerInvalidSettingForImage, "Image comment", "BMFF"));
} // BmffImage::writeMetadata } // BmffImage::writeMetadata
// ************************************************************************* // *************************************************************************

Loading…
Cancel
Save