From 4928c8d270c49b5199d4e29f872c791e93ab224a Mon Sep 17 00:00:00 2001 From: Andreas Huggel Date: Sun, 29 Aug 2010 11:21:59 +0000 Subject: [PATCH] Added ExifKey::defaultCount() to access the new count reference information. --- src/tags.cpp | 6 ++++++ src/tags.hpp | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/tags.cpp b/src/tags.cpp index 4d610c16..233f6076 100644 --- a/src/tags.cpp +++ b/src/tags.cpp @@ -2887,6 +2887,12 @@ namespace Exiv2 { return p_->tagInfo_->typeId_; } + uint16_t ExifKey::defaultCount() const + { + if (p_->tagInfo_ == 0 || p_->tagInfo_->tag_ == 0xffff) return unknownTag.count_; + return p_->tagInfo_->count_; + } + uint16_t ExifKey::tag() const { return p_->tag_; diff --git a/src/tags.hpp b/src/tags.hpp index aa7aca44..74707ed9 100644 --- a/src/tags.hpp +++ b/src/tags.hpp @@ -172,7 +172,7 @@ namespace Exiv2 { @throw Error if the key cannot be constructed from the tag and IFD item parameters. */ - ExifKey(const TagInfo& tagInfo); + explicit ExifKey(const TagInfo& tagInfo); //! Copy constructor ExifKey(const ExifKey& rhs); //! Destructor @@ -204,6 +204,8 @@ namespace Exiv2 { std::string tagDesc() const; // Todo: should be in the base class //! Return the default type id for this tag. TypeId defaultTypeId() const; // Todo: should be in the base class + //! Return the default number of components (not bytes!) this tag has. (0=any, -1=count not known.) + uint16_t defaultCount() const; virtual uint16_t tag() const; AutoPtr clone() const;