From 311eba8b3cdaacc1c0577237b2aeef412a282a34 Mon Sep 17 00:00:00 2001 From: Andreas Huggel Date: Sat, 20 May 2006 10:49:31 +0000 Subject: [PATCH] Removed TagTranslator, use simple arrays and EXV_PRINT_TAG now. --- src/tags.cpp | 18 ------------------ src/tags.hpp | 23 ----------------------- 2 files changed, 41 deletions(-) diff --git a/src/tags.cpp b/src/tags.cpp index 3b1e3a2d..f5ff473c 100644 --- a/src/tags.cpp +++ b/src/tags.cpp @@ -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. diff --git a/src/tags.hpp b/src/tags.hpp index a83f64f9..1da86925 100644 --- a/src/tags.hpp +++ b/src/tags.hpp @@ -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 - /*! - @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.