Taglist takes a stream now

v0.27.3
Andreas Huggel 22 years ago
parent d21943ca94
commit b870d3d1a0

@ -3,13 +3,13 @@
Abstract: Print a simple comma separated list of tags defined in Exiv2 Abstract: Print a simple comma separated list of tags defined in Exiv2
File: taglist.cpp File: taglist.cpp
Version: $Name: $ $Revision: 1.2 $ Version: $Name: $ $Revision: 1.3 $
Author(s): Andreas Huggel (ahu) <ahuggel@gmx.net> Author(s): Andreas Huggel (ahu) <ahuggel@gmx.net>
History: 07-Jan-04, ahu: created History: 07-Jan-04, ahu: created
*/ */
// ***************************************************************************** // *****************************************************************************
#include "rcsid.hpp" #include "rcsid.hpp"
EXIV2_RCSID("@(#) $Name: $ $Revision: 1.2 $ $RCSfile: taglist.cpp,v $") EXIV2_RCSID("@(#) $Name: $ $Revision: 1.3 $ $RCSfile: taglist.cpp,v $")
#include "tags.hpp" #include "tags.hpp"
#include "error.hpp" #include "error.hpp"
@ -20,7 +20,7 @@ using namespace Exif;
int main() int main()
try { try {
ExifTags::taglist(); ExifTags::taglist(std::cout);
return 0; return 0;
} }
catch (Error& e) { catch (Error& e) {

@ -20,13 +20,13 @@
*/ */
/* /*
File: tags.cpp File: tags.cpp
Version: $Name: $ $Revision: 1.13 $ Version: $Name: $ $Revision: 1.14 $
Author(s): Andreas Huggel (ahu) <ahuggel@gmx.net> Author(s): Andreas Huggel (ahu) <ahuggel@gmx.net>
History: 15-Jan-04, ahu: created History: 15-Jan-04, ahu: created
*/ */
// ***************************************************************************** // *****************************************************************************
#include "rcsid.hpp" #include "rcsid.hpp"
EXIV2_RCSID("@(#) $Name: $ $Revision: 1.13 $ $RCSfile: tags.cpp,v $") EXIV2_RCSID("@(#) $Name: $ $Revision: 1.14 $ $RCSfile: tags.cpp,v $")
// ***************************************************************************** // *****************************************************************************
// included header files // included header files
@ -389,19 +389,19 @@ namespace Exif {
return tagInfos_[ifdId][idx].printFct_; return tagInfos_[ifdId][idx].printFct_;
} }
void ExifTags::taglist() void ExifTags::taglist(std::ostream& os)
{ {
for (int i=0; ifdTagInfo[i].tag_ != 0xffff; ++i) { for (int i=0; ifdTagInfo[i].tag_ != 0xffff; ++i) {
std::cout << ifdTagInfo[i] << "\n"; os << ifdTagInfo[i] << "\n";
} }
for (int i=0; exifTagInfo[i].tag_ != 0xffff; ++i) { for (int i=0; exifTagInfo[i].tag_ != 0xffff; ++i) {
std::cout << exifTagInfo[i] << "\n"; os << exifTagInfo[i] << "\n";
} }
for (int i=0; iopTagInfo[i].tag_ != 0xffff; ++i) { for (int i=0; iopTagInfo[i].tag_ != 0xffff; ++i) {
std::cout << iopTagInfo[i] << "\n"; os << iopTagInfo[i] << "\n";
} }
for (int i=0; gpsTagInfo[i].tag_ != 0xffff; ++i) { for (int i=0; gpsTagInfo[i].tag_ != 0xffff; ++i) {
std::cout << gpsTagInfo[i] << "\n"; os << gpsTagInfo[i] << "\n";
} }
} // ExifTags::taglist } // ExifTags::taglist

@ -21,7 +21,7 @@
/*! /*!
@file tags.hpp @file tags.hpp
@brief %Exif tag and type information @brief %Exif tag and type information
@version $Name: $ $Revision: 1.13 $ @version $Name: $ $Revision: 1.14 $
@author Andreas Huggel (ahu) @author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a> <a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@date 15-Jan-04, ahu: created @date 15-Jan-04, ahu: created
@ -180,7 +180,7 @@ namespace Exif {
//! Return the print function for the tag, IFD id combination //! Return the print function for the tag, IFD id combination
static PrintFct printFct(uint16 tag, IfdId ifdId); static PrintFct printFct(uint16 tag, IfdId ifdId);
//! Print a list of all tags to standart output //! Print a list of all tags to standart output
static void taglist(); static void taglist(std::ostream& os);
private: private:
static int tagInfoIdx(uint16 tag, IfdId ifdId); static int tagInfoIdx(uint16 tag, IfdId ifdId);

Loading…
Cancel
Save