Removed TagTranslator, use simple arrays and EXV_PRINT_TAG now.
This commit is contained in:
@@ -294,24 +294,6 @@ namespace Exiv2 {
|
||||
// Unknown Tag
|
||||
static const TagInfo unknownTag(0xffff, "Unknown tag", "Unknown tag", "Unknown tag", ifdIdNotSet, sectionIdNotSet, asciiString, printValue);
|
||||
|
||||
std::ostream& TagTranslator::print(std::ostream& os, const Value& value) const
|
||||
{
|
||||
if (!pTagDetails_) return os << value;
|
||||
|
||||
long l = value.toLong();
|
||||
|
||||
long e = pTagDetails_[0].val_;
|
||||
int i = 1;
|
||||
for (; pTagDetails_[i].val_ != l && pTagDetails_[i].val_ != e; ++i) {}
|
||||
if (pTagDetails_[i].val_ == l) {
|
||||
os << pTagDetails_[i].label_;
|
||||
}
|
||||
else {
|
||||
os << "(" << l << ")";
|
||||
}
|
||||
return os;
|
||||
} // TagTranslator::print
|
||||
|
||||
// Tag lookup lists with tag names, desc and where they (preferably) belong to;
|
||||
// this is an array with pointers to one list per IFD. The IfdId is used as the
|
||||
// index into the array.
|
||||
|
||||
@@ -144,29 +144,6 @@ namespace Exiv2 {
|
||||
//! Shortcut for the printTag template which requires typing the array name only once.
|
||||
#define EXV_PRINT_TAG(array) printTag<EXV_COUNTOF(array), array>
|
||||
|
||||
/*!
|
||||
@brief Translation from numeric values from a lookup list to human
|
||||
readable labels
|
||||
*/
|
||||
class TagTranslator {
|
||||
public:
|
||||
//! @name Creators
|
||||
//@{
|
||||
//! Default constructor.
|
||||
explicit TagTranslator(const TagDetails* pTagDetails)
|
||||
: pTagDetails_(pTagDetails) {}
|
||||
// No d'tor: Do not delete the list.
|
||||
//@}
|
||||
|
||||
//! @name Accessors
|
||||
//@{
|
||||
//! Translate the tag value and write it out to the provided stream
|
||||
std::ostream& print(std::ostream& os, const Value& value) const;
|
||||
//@}
|
||||
private:
|
||||
const TagDetails* pTagDetails_;
|
||||
}; // class TagTranslator
|
||||
|
||||
//! Container for Exif tag information. Implemented as a static class.
|
||||
class ExifTags {
|
||||
//! Prevent construction: not implemented.
|
||||
|
||||
Reference in New Issue
Block a user