Loading...
Searching...
No Matches
tags.hpp
// ***************************************************************** -*- C++ -*-
/*
* Copyright (C) 2004-2021 Exiv2 authors
* This program is part of the Exiv2 distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA.
*/
#ifndef TAGS_HPP_
#define TAGS_HPP_
// *****************************************************************************
#include "exiv2lib_export.h"
// included header files
#include "metadatum.hpp"
// + standard includes
#include <string>
#include <iosfwd>
#include <memory>
// *****************************************************************************
// namespace extensions
namespace Exiv2 {
// *****************************************************************************
// class declarations
class ExifData;
class ExifKey;
class Value;
struct TagInfo;
// *****************************************************************************
// type definitions
typedef std::ostream& (*PrintFct)(std::ostream&, const Value&, const ExifData* pExifData);
typedef const TagInfo* (*TagListFct)();
// *****************************************************************************
// class definitions
struct EXIV2API GroupInfo {
struct GroupName;
bool operator==(int ifdId) const;
bool operator==(const GroupName& groupName) const;
int ifdId_;
const char* ifdName_;
const char* groupName_;
TagListFct tagList_;
};
struct EXIV2API GroupInfo::GroupName {
explicit GroupName(const std::string& groupName);
std::string g_;
};
struct EXIV2API TagInfo {
TagInfo(
uint16_t tag,
const char* name,
const char* title,
const char* desc,
int ifdId,
int sectionId,
TypeId typeId,
int16_t count,
PrintFct printFct
);
uint16_t tag_;
const char* name_;
const char* title_;
const char* desc_;
int ifdId_;
int sectionId_;
TypeId typeId_;
int16_t count_;
PrintFct printFct_;
}; // struct TagInfo
class EXIV2API ExifTags {
ExifTags();
ExifTags(const ExifTags& rhs);
ExifTags& operator=(const ExifTags& rhs);
public:
static const GroupInfo* groupList();
static const TagInfo* tagList(const std::string& groupName);
static void taglist(std::ostream& os);
static void taglist(std::ostream& os, const std::string& groupName);
static const char* sectionName(const ExifKey& key);
static uint16_t defaultCount(const ExifKey& key);
static const char* ifdName(const std::string& groupName);
static bool isMakerGroup(const std::string& groupName);
static bool isExifGroup(const std::string& groupName);
}; // class ExifTags
class EXIV2API ExifKey : public Key {
public:
typedef std::auto_ptr<ExifKey> AutoPtr;
explicit ExifKey(const std::string& key);
ExifKey(uint16_t tag, const std::string& groupName);
explicit ExifKey(const TagInfo& ti);
ExifKey(const ExifKey& rhs);
virtual ~ExifKey();
ExifKey& operator=(const ExifKey& rhs);
void setIdx(int idx);
virtual std::string key() const;
virtual const char* familyName() const;
virtual std::string groupName() const;
int ifdId() const;
virtual std::string tagName() const;
virtual uint16_t tag() const;
virtual std::string tagLabel() const;
std::string tagDesc() const; // Todo: should be in the base class
TypeId defaultTypeId() const; // Todo: should be in the base class
AutoPtr clone() const;
int idx() const;
private:
virtual ExifKey* clone_() const;
private:
// Pimpl idiom
struct Impl;
std::auto_ptr<Impl> p_;
}; // class ExifKey
// *****************************************************************************
// free functions
EXIV2API std::ostream& operator<<(std::ostream& os, const TagInfo& ti);
} // namespace Exiv2
#endif // #ifndef TAGS_HPP_
Exiv2::ExifData
A container for Exif data. This is a top-level class of the Exiv2 library. The container holds Exifda...
Definition exif.hpp:434
Exiv2::ExifKey
Concrete keys for Exif metadata and access to Exif tag reference data.
Definition tags.hpp:140
Exiv2::ExifKey::AutoPtr
std::auto_ptr< ExifKey > AutoPtr
Shortcut for an ExifKey auto pointer.
Definition tags.hpp:143
Exiv2::ExifTags
Access to Exif group and tag lists and misc. tag reference methods, implemented as a static class.
Definition tags.hpp:99
Exiv2::Key
Abstract base class defining the Key of a metadatum. Keys are used to identify and group metadata.
Definition metadatum.hpp:44
Exiv2::Value
Common interface for all types of values used with metadata.
Definition value.hpp:51
Exiv2::Internal::groupName
const char * groupName(IfdId ifdId)
Return the group name for a group id.
Definition tags_int.cpp:2569
Exiv2::Internal::taglist
void taglist(std::ostream &os, IfdId ifdId)
Print the list of tags for ifdId to the output stream os.
Definition tags_int.cpp:2512
Exiv2::Internal::tagList
const TagInfo * tagList(IfdId ifdId)
Return the tag list for ifdId.
Definition tags_int.cpp:2522
Exiv2::Internal::ifdName
const char * ifdName(IfdId ifdId)
Return the name of the IFD.
Definition tags_int.cpp:2562
Exiv2::Internal::operator==
bool operator==(const TagDetails &td, const LensTypeAndFocalLengthAndMaxAperture &ltfl)
Compare tag details with a lens entry.
Definition canonmn_int.cpp:2820
Exiv2
Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of ...
Definition asfvideo.hpp:36
Exiv2::operator<<
EXIV2API std::ostream & operator<<(std::ostream &os, const DataSet &dataSet)
Output operator for dataSet.
Definition datasets.cpp:709
Exiv2::TagListFct
const TagInfo *(* TagListFct)()
A function returning a tag list.
Definition tags.hpp:51
Exiv2::TypeId
TypeId
Exiv2 value type identifiers.
Definition types.hpp:119
Exiv2::PrintFct
std::ostream &(* PrintFct)(std::ostream &, const Value &, const ExifData *pExifData)
Type for a function pointer for functions interpreting the tag value.
Definition tags.hpp:49
Exiv2::ExifKey::Impl
Internal Pimpl structure with private members and data of class ExifKey.
Definition tags.cpp:210
Exiv2::GroupInfo
The details of an Exif group. Groups include IFDs and binary arrays.
Definition tags.hpp:57
Exiv2::GroupInfo::ifdId_
int ifdId_
IFD id.
Definition tags.hpp:61
Exiv2::GroupInfo::g_
std::string g_
Group name.
Definition tags.hpp:70
Exiv2::GroupInfo::tagList_
TagListFct tagList_
Tag list.
Definition tags.hpp:64
Exiv2::GroupInfo::ifdName_
const char * ifdName_
IFD name.
Definition tags.hpp:62
Exiv2::GroupInfo::groupName_
const char * groupName_
Group name, unique for each group.
Definition tags.hpp:63
Exiv2::TagInfo
Tag information.
Definition tags.hpp:74
Exiv2::TagInfo::tag_
uint16_t tag_
Tag.
Definition tags.hpp:87
Exiv2::TagInfo::sectionId_
int sectionId_
Section id.
Definition tags.hpp:92
Exiv2::TagInfo::count_
int16_t count_
The number of values (not bytes!), 0=any, -1=count not known.
Definition tags.hpp:94
Exiv2::TagInfo::typeId_
TypeId typeId_
Type id.
Definition tags.hpp:93
Exiv2::TagInfo::ifdId_
int ifdId_
Link to the (preferred) IFD.
Definition tags.hpp:91
Exiv2::TagInfo::desc_
const char * desc_
Short tag description.
Definition tags.hpp:90
Exiv2::TagInfo::title_
const char * title_
Tag title.
Definition tags.hpp:89
Exiv2::TagInfo::printFct_
PrintFct printFct_
Pointer to tag print function.
Definition tags.hpp:95
Exiv2::TagInfo::name_
const char * name_
One word tag label.
Definition tags.hpp:88