Merge pull request #2130 from neheb/1

misc stuff
main
Luis Díaz Más 3 years ago committed by GitHub
commit 02b0541bbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -80,6 +80,7 @@ namespace Exiv2 {
public:
//! Constructor
explicit Impl(std::string path);
~Impl() = default;
// Enumerations
//! Mode of operation
enum OpMode { opRead, opWrite, opSeek };
@ -126,7 +127,7 @@ namespace Exiv2 {
int FileIo::Impl::switchMode(OpMode opMode)
{
assert(fp_ != 0);
assert(fp_);
if (opMode_ == opMode) return 0;
OpMode oldOpMode = opMode_;
opMode_ = opMode;
@ -231,7 +232,7 @@ namespace Exiv2 {
byte* FileIo::mmap(bool isWriteable)
{
assert(p_->fp_ != 0);
assert(p_->fp_);
if (munmap() != 0) {
throw Error(kerCallFailed, path(), strError(), "munmap");
}
@ -304,7 +305,7 @@ namespace Exiv2 {
size_t FileIo::write(const byte* data, size_t wcount)
{
assert(p_->fp_ != 0);
assert(p_->fp_);
if (p_->switchMode(Impl::opWrite) != 0)
return 0;
return std::fwrite(data, 1, wcount, p_->fp_);
@ -312,7 +313,7 @@ namespace Exiv2 {
size_t FileIo::write(BasicIo& src)
{
assert(p_->fp_ != 0);
assert(p_->fp_);
if (static_cast<BasicIo*>(this) == &src)
return 0;
if (!src.isopen())
@ -446,14 +447,14 @@ namespace Exiv2 {
int FileIo::putb(byte data)
{
assert(p_->fp_ != 0);
assert(p_->fp_);
if (p_->switchMode(Impl::opWrite) != 0) return EOF;
return putc(data, p_->fp_);
}
int FileIo::seek( int64_t offset, Position pos )
{
assert(p_->fp_ != 0);
assert(p_->fp_);
int fileSeek = 0;
switch (pos) {
@ -472,7 +473,7 @@ namespace Exiv2 {
long FileIo::tell() const
{
assert(p_->fp_ != 0);
assert(p_->fp_);
return std::ftell(p_->fp_);
}
@ -531,7 +532,7 @@ namespace Exiv2 {
DataBuf FileIo::read(size_t rcount)
{
assert(p_->fp_ != 0);
assert(p_->fp_);
if (static_cast<size_t>(rcount) > size())
throw Error(kerInvalidMalloc);
DataBuf buf(rcount);
@ -545,7 +546,7 @@ namespace Exiv2 {
size_t FileIo::read(byte* buf, size_t rcount)
{
assert(p_->fp_ != 0);
assert(p_->fp_);
if (p_->switchMode(Impl::opRead) != 0) {
return 0;
}
@ -554,7 +555,7 @@ namespace Exiv2 {
int FileIo::getb()
{
assert(p_->fp_ != 0);
assert(p_->fp_);
if (p_->switchMode(Impl::opRead) != 0) return EOF;
return getc(p_->fp_);
}
@ -583,6 +584,7 @@ namespace Exiv2 {
public:
Impl() = default; //!< Default constructor
Impl(const byte* data, size_t size); //!< Constructor 2
~Impl() = default;
// DATA
byte* data_{nullptr}; //!< Pointer to the start of the memory area
@ -623,6 +625,9 @@ namespace Exiv2 {
delete [] data_;
}
BlockMap(const BlockMap&) = delete;
BlockMap& operator=(const BlockMap&) = delete;
//! @brief Populate the block.
//! @param source The data populate to the block
//! @param num The size of data
@ -1038,6 +1043,9 @@ namespace Exiv2 {
//! Destructor. Releases all managed memory.
virtual ~Impl();
Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;
// DATA
std::string path_; //!< (Standard) path
size_t blockSize_; //!< Size of the block memory.
@ -1450,6 +1458,8 @@ namespace Exiv2 {
HttpImpl(const std::string& url, size_t blockSize);
Exiv2::Uri hostInfo_; //!< the host information extracted from the path
~HttpImpl() override = default;
// METHODS
/*!
@brief Get the length (in bytes) of the remote file.

@ -21,11 +21,7 @@
// *****************************************************************************
// namespace extensions
namespace Exiv2 {
class Value;
namespace Internal {
namespace Exiv2::Internal {
// *****************************************************************************
// class definitions
@ -205,7 +201,7 @@ namespace Exiv2 {
*/
float canonEv(int64_t val);
}} // namespace Internal, Exiv2
} // namespace Exiv2::Internal
#endif // #ifndef CANONMN_INT_HPP_

@ -18,8 +18,7 @@
// *****************************************************************************
// namespace extensions
namespace Exiv2 {
namespace Internal {
namespace Exiv2::Internal {
// *****************************************************************************
// class definitions
@ -56,6 +55,6 @@ namespace Exiv2 {
}; // class Casio2MakerNote
}} // namespace Internal, Exiv2
} // namespace Exiv2::Internal
#endif // #ifndef CasioMN_INT_HPP_

@ -16,8 +16,7 @@
// *****************************************************************************
// namespace extensions
namespace Exiv2 {
namespace Internal {
namespace Exiv2::Internal {
// *****************************************************************************
// class definitions
@ -53,6 +52,6 @@ namespace Exiv2 {
static constexpr auto cr2sig_ = "CR\2\0"; //!< Signature for CR2 type TIFF
}; // class Cr2Header
}} // namespace Internal, Exiv2
} // namespace Exiv2::Internal
#endif // #ifndef CR2IMAGE_INT_HPP_

@ -14,13 +14,7 @@
// *****************************************************************************
// namespace extensions
namespace Exiv2 {
// *****************************************************************************
// class declarations
class ExifData;
namespace Internal {
namespace Exiv2::Internal {
// *****************************************************************************
// class declarations
@ -691,6 +685,6 @@ namespace Exiv2 {
IfdId ifdId,
ByteOrder byteOrder);
}} // namespace Internal, Exiv2
} // namespace Exiv2::Internal
#endif // #ifndef CRWIMAGE_INT_HPP_

@ -102,12 +102,7 @@ namespace {
public:
//! Shortcut for a %TiffThumbnail auto pointer.
using UniquePtr = std::unique_ptr<TiffThumbnail>;
//! @name Manipulators
//@{
//! Assignment operator.
TiffThumbnail& operator=(const TiffThumbnail& rhs);
//@}
~TiffThumbnail() override = default;
//! @name Accessors
//@{
@ -123,12 +118,7 @@ namespace {
public:
//! Shortcut for a %JpegThumbnail auto pointer.
using UniquePtr = std::unique_ptr<JpegThumbnail>;
//! @name Manipulators
//@{
//! Assignment operator.
JpegThumbnail& operator=(const JpegThumbnail& rhs);
//@}
~JpegThumbnail() override = default;
//! @name Accessors
//@{

@ -9,8 +9,7 @@
// *****************************************************************************
// namespace extensions
namespace Exiv2 {
namespace Internal {
namespace Exiv2::Internal {
// *****************************************************************************
// class definitions
@ -24,9 +23,8 @@ namespace Exiv2 {
private:
//! Tag information
static const TagInfo tagInfo_[];
}; // class FujiMakerNote
}} // namespace Internal, Exiv2
} // namespace Exiv2::Internal
#endif // #ifndef FUJIMN_INT_HPP_

@ -18,8 +18,7 @@
// *****************************************************************************
// namespace extensions
namespace Exiv2 {
namespace Internal {
namespace Exiv2::Internal {
// *****************************************************************************
// class definitions
@ -106,6 +105,6 @@ namespace Exiv2 {
/// @brief indent output for kpsRecursive in \em printStructure() \em .
std::string indent(int32_t depth);
}} // namespace Internal, Exiv2
} // namespace Exiv2::Internal
#endif // #ifndef IMAGE_INT_HPP_

@ -11,8 +11,7 @@
// *****************************************************************************
// namespace extensions
namespace Exiv2 {
namespace Internal {
namespace Exiv2::Internal {
// *****************************************************************************
// function prototypes
/*!
@ -25,7 +24,6 @@ namespace Exiv2 {
*/
std::string readExiv2Config(const std::string& section, const std::string& value, const std::string& def);
// *****************************************************************************
// class definitions
@ -748,6 +746,6 @@ namespace Exiv2 {
*/
DataBuf nikonCrypt(uint16_t tag, const byte* pData, uint32_t size, TiffComponent* const pRoot);
}} // namespace Internal, Exiv2
} // namespace Exiv2::Internal
#endif // #ifndef MAKERNOTE_INT_HPP_

@ -13,8 +13,7 @@
// *****************************************************************************
// namespace extensions
namespace Exiv2 {
namespace Internal {
namespace Exiv2::Internal {
// *****************************************************************************
// class definitions
@ -121,6 +120,6 @@ namespace Exiv2 {
// TODO: Added shared methods here.
}} // namespace Internal, Exiv2
} // namespace Exiv2::Internal
#endif // #ifndef MINOLTAMN_INT_HPP_

@ -27,8 +27,7 @@
// *****************************************************************************
// namespace extensions
namespace Exiv2 {
namespace Internal {
namespace Exiv2::Internal {
// *****************************************************************************
// class definitions
@ -286,6 +285,6 @@ namespace Exiv2 {
}; // class Nikon3MakerNote
}} // namespace Internal, Exiv2
} // namespace Exiv2::Internal
#endif // #ifndef NIKONMN_INT_HPP_

@ -22,8 +22,7 @@
// *****************************************************************************
// namespace extensions
namespace Exiv2 {
namespace Internal {
namespace Exiv2::Internal {
// *****************************************************************************
// class definitions
@ -96,6 +95,6 @@ namespace Exiv2 {
}; // class OlympusMakerNote
}} // namespace Internal, Exiv2
} // namespace Exiv2::Internal
#endif // #ifndef OLYMPUSMN_INT_HPP_

@ -10,8 +10,7 @@
// *****************************************************************************
// namespace extensions
namespace Exiv2 {
namespace Internal {
namespace Exiv2::Internal {
// *****************************************************************************
// class definitions
@ -43,6 +42,6 @@ namespace Exiv2 {
uint16_t sig_; //<! The actual magic number
}; // class OrfHeader
}} // namespace Internal, Exiv2
} // namespace Exiv2::Internal
#endif // #ifndef ORFIMAGE_INT_HPP_

@ -10,8 +10,7 @@
// *****************************************************************************
// namespace extensions
namespace Exiv2 {
namespace Internal {
namespace Exiv2::Internal {
// *****************************************************************************
// class definitions
@ -57,7 +56,6 @@ namespace Exiv2 {
static const TagInfo tagInfoRaw_[];
}; // class PanasonicMakerNote
}} // namespace Internal, Exiv2
} // namespace Exiv2::Internal
#endif // #ifndef PANASONICMN_INT_HPP_

@ -11,8 +11,7 @@
// *****************************************************************************
// namespace extensions
namespace Exiv2 {
namespace Internal {
namespace Exiv2::Internal {
// *****************************************************************************
// class definitions
@ -90,8 +89,6 @@ namespace Exiv2 {
//! Shortcut for the printCombiTag template which requires typing the array name only once.
#define EXV_PRINT_COMBITAG_MULTI(array, count, ignoredcount, ignoredcountmax) printCombiTag<EXV_COUNTOF(array), array, count, ignoredcount, ignoredcountmax>
} // namespace Internal
} // namespace Exiv2
} // namespace Exiv2::Internal
#endif // #ifndef PENTAXMN_INT_HPP_

@ -10,14 +10,7 @@
// *****************************************************************************
// namespace extensions
namespace Exiv2 {
// *****************************************************************************
// class declarations
class Image;
namespace Internal {
namespace Exiv2::Internal {
// *****************************************************************************
// class definitions
@ -161,6 +154,6 @@ namespace Exiv2 {
}; // class PngChunk
}} // namespace Internal, Exiv2
} // namespace Exiv2::Internal
#endif // #ifndef PNGCHUNK_INT_HPP_

@ -9,8 +9,7 @@
// *****************************************************************************
// namespace extensions
namespace Exiv2 {
namespace Internal {
namespace Exiv2::Internal {
// *****************************************************************************
// class definitions
@ -36,6 +35,6 @@ namespace Exiv2 {
}; // class Rw2Header
}} // namespace Internal, Exiv2
} // namespace Exiv2::Internal
#endif // #ifndef RW2IMAGE_INT_HPP_

@ -10,8 +10,7 @@
// *****************************************************************************
// namespace extensions
namespace Exiv2 {
namespace Internal {
namespace Exiv2::Internal {
// *****************************************************************************
// class definitions
@ -32,6 +31,6 @@ namespace Exiv2 {
}; // class Samsung2MakerNote
}} // namespace Internal, Exiv2
} // namespace Exiv2::Internal
#endif // #ifndef SAMSUNGMN_INT_HPP_

@ -10,8 +10,7 @@
// *****************************************************************************
// namespace extensions
namespace Exiv2 {
namespace Internal {
namespace Exiv2::Internal {
// *****************************************************************************
// class definitions
@ -38,6 +37,6 @@ namespace Exiv2 {
}; // class SigmaMakerNote
}} // namespace Internal, Exiv2
} // namespace Exiv2::Internal
#endif // #ifndef SIGMAMN_INT_HPP_

@ -9,8 +9,7 @@
// *****************************************************************************
// namespace extensions
namespace Exiv2 {
namespace Internal {
namespace Exiv2::Internal {
// *****************************************************************************
// class definitions
@ -83,6 +82,6 @@ namespace Exiv2 {
DataBuf sonyTagDecipher(uint16_t, const byte*, uint32_t, TiffComponent* const);
DataBuf sonyTagEncipher(uint16_t, const byte*, uint32_t, TiffComponent* const);
}} // namespace Internal, Exiv2
} // namespace Exiv2::Internal
#endif // #ifndef SONYMN_INT_HPP_

@ -332,10 +332,7 @@ namespace Exiv2 {
return p_->key_;
}
const char* ExifKey::familyName() const
{
return p_->familyName_;
}
const char* ExifKey::familyName() const { return Exiv2::ExifKey::Impl::familyName_; }
std::string ExifKey::groupName() const
{

@ -69,21 +69,10 @@ namespace Exiv2::Internal {
if (pow_) pow_->setTarget(OffsetWriter::OffsetId(id), static_cast<uint32_t>(target));
}
TiffComponent::TiffComponent(uint16_t tag, IfdId group) : tag_(tag), group_(group), pStart_(nullptr)
{
}
TiffComponent::TiffComponent(uint16_t tag, IfdId group) : tag_(tag), group_(group) {}
TiffEntryBase::TiffEntryBase(uint16_t tag, IfdId group, TiffType tiffType)
: TiffComponent(tag, group),
tiffType_(tiffType),
count_(0),
offset_(0),
size_(0),
pData_(nullptr),
idx_(0),
pValue_(nullptr)
{
}
: TiffComponent(tag, group), tiffType_(tiffType) {}
TiffSubIfd::TiffSubIfd(uint16_t tag, IfdId group, IfdId newGroup)
: TiffEntryBase(tag, group, ttUnsignedLong), newGroup_(newGroup)
@ -91,9 +80,7 @@ namespace Exiv2::Internal {
}
TiffMnEntry::TiffMnEntry(uint16_t tag, IfdId group, IfdId mnGroup)
: TiffEntryBase(tag, group, ttUndefined), mnGroup_(mnGroup), mn_(nullptr)
{
}
: TiffEntryBase(tag, group, ttUndefined), mnGroup_(mnGroup) {}
TiffIfdMakernote::TiffIfdMakernote(uint16_t tag,
IfdId group,
@ -103,7 +90,6 @@ namespace Exiv2::Internal {
: TiffComponent(tag, group),
pHeader_(pHeader),
ifd_(tag, mnGroup, hasNext),
mnOffset_(0),
imageByteOrder_(invalidByteOrder)
{
}
@ -111,17 +97,9 @@ namespace Exiv2::Internal {
TiffBinaryArray::TiffBinaryArray(uint16_t tag, IfdId group, const ArrayCfg* arrayCfg, const ArrayDef* arrayDef,
int defSize)
: TiffEntryBase(tag, group, arrayCfg->elTiffType_),
cfgSelFct_(nullptr),
arraySet_(nullptr),
arrayCfg_(arrayCfg),
arrayDef_(arrayDef),
defSize_(defSize),
setSize_(0),
origData_(nullptr),
origSize_(0),
pRoot_(nullptr),
decoded_(false)
{
defSize_(defSize) {
assert(arrayCfg != 0);
}
@ -130,15 +108,7 @@ namespace Exiv2::Internal {
: TiffEntryBase(tag, group), // Todo: Does it make a difference that there is no type?
cfgSelFct_(cfgSelFct),
arraySet_(arraySet),
arrayCfg_(nullptr),
arrayDef_(nullptr),
defSize_(0),
setSize_(setSize),
origData_(nullptr),
origSize_(0),
pRoot_(nullptr),
decoded_(false)
{
setSize_(setSize) {
// We'll figure out the correct cfg later
assert(cfgSelFct != 0);
assert(arraySet_ != 0);
@ -203,9 +173,7 @@ namespace Exiv2::Internal {
{
}
TiffDirectory::TiffDirectory(const TiffDirectory& rhs) : TiffComponent(rhs), hasNext_(rhs.hasNext_), pNext_(nullptr)
{
}
TiffDirectory::TiffDirectory(const TiffDirectory& rhs) : TiffComponent(rhs), hasNext_(rhs.hasNext_) {}
TiffSubIfd::TiffSubIfd(const TiffSubIfd& rhs)
: TiffEntryBase(rhs),
@ -223,10 +191,7 @@ namespace Exiv2::Internal {
setSize_(rhs.setSize_),
origData_(rhs.origData_),
origSize_(rhs.origSize_),
pRoot_(rhs.pRoot_),
decoded_(false)
{
}
pRoot_(rhs.pRoot_) {}
TiffComponent::UniquePtr TiffComponent::clone() const
{

@ -342,7 +342,7 @@ namespace Exiv2 {
Pointer to the start of the binary representation of the component in
a memory buffer. The buffer is allocated and freed outside of this class.
*/
byte* pStart_;
byte* pStart_{};
}; // class TiffComponent
@ -535,23 +535,23 @@ namespace Exiv2 {
// DATA
TiffType tiffType_; //!< Field TIFF type
size_t count_; //!< The number of values of the indicated type
int64_t offset_; //!< Offset to the data area
size_t count_{}; //!< The number of values of the indicated type
int64_t offset_{}; //!< Offset to the data area
/*!
Size of the data buffer holding the value in bytes, there is no
minimum size.
*/
uint32_t size_;
uint32_t size_{};
// Notes on the ownership model of pData_: pData_ is a always a
// pointer to a buffer owned by somebody else. Usually it is a
// pointer into a copy of the image file, but if
// TiffEntryBase::setData is used then it is a pointer into the
// storage_ DataBuf below.
byte* pData_; //!< Pointer to the data area
byte* pData_{}; //!< Pointer to the data area
int idx_; //!< Unique id of the entry in the image
Value* pValue_; //!< Converted data value
int idx_{}; //!< Unique id of the entry in the image
Value* pValue_{}; //!< Converted data value
// This DataBuf is only used when TiffEntryBase::setData is called.
// Otherwise, it remains empty. It is wrapped in a shared_ptr because
@ -653,15 +653,7 @@ namespace Exiv2 {
class TiffDataEntry : public TiffDataEntryBase {
friend class TiffEncoder;
public:
//! @name Creators
//@{
//! Constructor
TiffDataEntry(uint16_t tag, IfdId group, uint16_t szTag, IfdId szGroup)
: TiffDataEntryBase(tag, group, szTag, szGroup),
pDataArea_(0), sizeDataArea_(0) {}
//! Virtual destructor.
~TiffDataEntry() override = default;
//@}
using TiffDataEntryBase::TiffDataEntryBase;
//! @name Manipulators
//@{
@ -706,8 +698,8 @@ namespace Exiv2 {
private:
// DATA
byte* pDataArea_; //!< Pointer to the data area (never alloc'd)
uint32_t sizeDataArea_; //!< Size of the data area
byte* pDataArea_{}; //!< Pointer to the data area (never alloc'd)
uint32_t sizeDataArea_{}; //!< Size of the data area
}; // class TiffDataEntry
@ -725,16 +717,9 @@ namespace Exiv2 {
*/
class TiffImageEntry : public TiffDataEntryBase {
friend class TiffEncoder;
public:
//! @name Creators
//@{
//! Constructor
TiffImageEntry(uint16_t tag, IfdId group, uint16_t szTag, IfdId szGroup)
: TiffDataEntryBase(tag, group, szTag, szGroup) {}
//! Virtual destructor.
~TiffImageEntry() override = default;
//@}
using TiffDataEntryBase::TiffDataEntryBase;
public:
//! @name Manipulators
//@{
void setStrips(const Value* pSize, const byte* pData, uint32_t sizeData, uint32_t baseOffset) override;
@ -844,8 +829,7 @@ namespace Exiv2 {
//! @name Creators
//@{
//! Default constructor
TiffDirectory(uint16_t tag, IfdId group, bool hasNext =true)
: TiffComponent(tag, group), hasNext_(hasNext), pNext_(0) {}
TiffDirectory(uint16_t tag, IfdId group, bool hasNext = true) : TiffComponent(tag, group), hasNext_(hasNext) {}
//! Virtual destructor
~TiffDirectory() override;
//@}
@ -932,11 +916,10 @@ namespace Exiv2 {
uint32_t& imageIdx);
//@}
private:
// DATA
Components components_; //!< List of components in this directory
const bool hasNext_; //!< True if the directory has a next pointer
TiffComponent* pNext_; //!< Pointer to the next IFD
TiffComponent* pNext_{}; //!< Pointer to the next IFD
}; // class TiffDirectory
@ -1083,7 +1066,7 @@ namespace Exiv2 {
// DATA
IfdId mnGroup_; //!< New group for concrete mn
TiffComponent* mn_; //!< The Makernote
TiffComponent* mn_{}; //!< The Makernote
}; // class TiffMnEntry
@ -1237,7 +1220,7 @@ namespace Exiv2 {
// DATA
MnHeader* pHeader_; //!< Makernote header
TiffDirectory ifd_; //!< Makernote IFD
uint32_t mnOffset_; //!< Makernote offset
uint32_t mnOffset_{}; //!< Makernote offset
ByteOrder imageByteOrder_; //!< Byte order for the image
}; // class TiffIfdMakernote
@ -1410,17 +1393,19 @@ namespace Exiv2 {
//@}
// DATA
const CfgSelFct cfgSelFct_; //!< Pointer to a function to determine which cfg to use (may be 0)
const ArraySet* arraySet_; //!< Pointer to the array set, if any (may be 0)
const ArrayCfg* arrayCfg_; //!< Pointer to the array configuration (must not be 0, except for unrecognized complex binary arrays)
const ArrayDef* arrayDef_; //!< Pointer to the array definition (may be 0)
int defSize_; //!< Size of the array definition array (may be 0)
int setSize_; //!< Size of the array set (may be 0)
const CfgSelFct cfgSelFct_{}; //!< Pointer to a function to determine which cfg to use (may be 0)
const ArraySet* arraySet_{}; //!< Pointer to the array set, if any (may be 0)
const ArrayCfg* arrayCfg_{}; //!< Pointer to the array configuration (must not be 0, except for unrecognized
//!< complex binary arrays)
const ArrayDef* arrayDef_{}; //!< Pointer to the array definition (may be 0)
int defSize_{}; //!< Size of the array definition array (may be 0)
int setSize_{}; //!< Size of the array set (may be 0)
Components elements_; //!< List of elements in this composite
byte* origData_; //!< Pointer to the original data buffer (unencrypted)
uint32_t origSize_; //!< Size of the original data buffer
TiffComponent* pRoot_; //!< Pointer to the root component of the TIFF tree. (Only used for intrusive writing.)
bool decoded_; //!< Flag to indicate if the array was decoded
byte* origData_{}; //!< Pointer to the original data buffer (unencrypted)
uint32_t origSize_{}; //!< Size of the original data buffer
TiffComponent*
pRoot_{}; //!< Pointer to the root component of the TIFF tree. (Only used for intrusive writing.)
bool decoded_{}; //!< Flag to indicate if the array was decoded
}; // class TiffBinaryArray
/*!

@ -11,12 +11,11 @@
// *****************************************************************************
// namespace extensions
namespace Exiv2 {
namespace Exiv2::Internal {
/*!
@brief Contains internal objects which are not published and are not part
of the <b>libexiv2</b> API.
*/
namespace Internal {
// *****************************************************************************
// class definitions
@ -270,16 +269,9 @@ namespace Exiv2 {
@return Byte order in which the data is encoded, invalidByteOrder if
decoding failed.
*/
static ByteOrder decode(
ExifData& exifData,
IptcData& iptcData,
XmpData& xmpData,
const byte* pData,
uint32_t size,
uint32_t root,
FindDecoderFct findDecoderFct,
TiffHeaderBase* pHeader =0
);
static ByteOrder decode(ExifData& exifData, IptcData& iptcData, XmpData& xmpData, const byte* pData,
uint32_t size, uint32_t root, FindDecoderFct findDecoderFct,
TiffHeaderBase* pHeader = nullptr);
/*!
@brief Encode TIFF metadata from the metadata containers into a
memory block \em blob.
@ -423,12 +415,12 @@ namespace Exiv2 {
//! Data structure for the offset list.
struct OffsetData {
//! Default constructor
OffsetData() : origin_(0), target_(0), byteOrder_(littleEndian) {}
OffsetData() : origin_(0), byteOrder_(littleEndian) {}
//! Constructor
OffsetData(uint32_t origin, ByteOrder byteOrder) : origin_(origin), target_(0), byteOrder_(byteOrder) {}
OffsetData(uint32_t origin, ByteOrder byteOrder) : origin_(origin), byteOrder_(byteOrder) {}
// DATA
uint32_t origin_; //!< Origin address
uint32_t target_; //!< Target address
uint32_t target_{}; //!< Target address
ByteOrder byteOrder_; //!< Byte order to use to encode target address
};
//! Type of the list containing an identifier and an address pair.
@ -453,6 +445,6 @@ namespace Exiv2 {
}; // class FindExifdatum
}} // namespace Internal, Exiv2
} // namespace Exiv2::Internal
#endif // #ifndef TIFFIMAGE_INT_HPP_

@ -669,10 +669,7 @@ namespace Exiv2::Internal {
setGo(geTraverse, !flag);
}
bool TiffEncoder::dirty() const
{
return dirty_ || exifData_.count() > 0;
}
bool TiffEncoder::dirty() const { return dirty_ || !exifData_.empty(); }
void TiffEncoder::visitEntry(TiffEntry* object)
{
@ -768,7 +765,7 @@ namespace Exiv2::Internal {
}
if (del_) {
// Remove remaining synthesized tags
static const char* synthesizedTags[] = {
static constexpr auto synthesizedTags = std::array{
"Exif.MakerNote.Offset",
};
for (auto&& synthesizedTag : synthesizedTags) {
@ -1636,9 +1633,7 @@ namespace Exiv2::Internal {
if (cryptFct != nullptr) {
const byte* pData = object->pData();
int32_t size = object->TiffEntryBase::doSize();
std::shared_ptr<DataBuf> buf = std::make_shared<DataBuf>(
cryptFct(object->tag(), pData, size, pRoot_)
);
auto buf = std::make_shared<DataBuf>(cryptFct(object->tag(), pData, size, pRoot_));
if (!buf->empty())
object->setData(buf);
}

@ -136,8 +136,7 @@ namespace Exiv2 {
//! @name Creators
//@{
//! Constructor, taking \em tag and \em group of the component to find.
TiffFinder(uint16_t tag, IfdId group)
: tag_(tag), group_(group), tiffComponent_(0) {}
TiffFinder(uint16_t tag, IfdId group) : tag_(tag), group_(group) {}
//! Virtual destructor
~TiffFinder() override = default;
//@}
@ -183,7 +182,7 @@ namespace Exiv2 {
private:
uint16_t tag_;
IfdId group_;
TiffComponent* tiffComponent_;
TiffComponent* tiffComponent_{};
}; // class TiffFinder
/*!
@ -324,7 +323,6 @@ namespace Exiv2 {
const TiffEntryBase* object);
//@}
private:
// DATA
ExifData& exifData_; //!< Exif metadata container
IptcData& iptcData_; //!< IPTC metadata container
@ -415,10 +413,7 @@ namespace Exiv2 {
@note Encoder functions may use metadata other than \em datum.
*/
void encodeTiffComponent(
TiffEntryBase* object,
const Exifdatum* datum =0
);
void encodeTiffComponent(TiffEntryBase* object, const Exifdatum* datum = nullptr);
//! Callback encoder function for an element of a binary array.
void encodeBinaryElement(TiffBinaryElement* object, const Exifdatum* datum);
@ -520,7 +515,6 @@ namespace Exiv2 {
bool isImageTag(uint16_t tag, IfdId group) const;
//@}
private:
// DATA
ExifData exifData_; //!< Copy of the Exif data to encode
const IptcData& iptcData_; //!< IPTC data to encode, just a reference
@ -645,7 +639,7 @@ namespace Exiv2 {
Uses the \em state passed in, if any, and remembers it for use during
subsequent calls without any argument.
*/
void setMnState(const TiffRwState* state =0);
void setMnState(const TiffRwState* state = nullptr);
//! Set the state to the original state as set in the constructor.
void setOrigState();
//! Check IFD directory pointer \em start for circular reference

@ -64,6 +64,9 @@ namespace {
validator.check_internal(buf, buflen);
}
XMLValidator(const XMLValidator&) = delete;
XMLValidator& operator=(const XMLValidator&) = delete;
private:
// Private constructor, because this class is only constructed by
// the (static) check method.
@ -253,6 +256,10 @@ namespace {
{
if (xmpLockFct_) xmpLockFct_(pLockData_, false);
}
AutoLock(const AutoLock&) = delete;
AutoLock& operator=(const AutoLock&) = delete;
private:
Exiv2::XmpParser::XmpLockFct xmpLockFct_;
void* pLockData_;
@ -268,6 +275,7 @@ namespace Exiv2 {
Impl(const XmpKey& key, const Value* pValue); //!< Constructor
Impl(const Impl& rhs); //!< Copy constructor
Impl& operator=(const Impl& rhs); //!< Assignment
~Impl() = default;
// DATA
XmpKey::UniquePtr key_; //!< Key

Loading…
Cancel
Save