Concrete keys for Exif metadata. More...
#include <tags.hpp>
Public Types | |
typedef std::auto_ptr< ExifKey > | AutoPtr |
Shortcut for an ExifKey auto pointer. | |
Public Member Functions | |
Creators | |
ExifKey (const std::string &key) | |
Constructor to create an Exif key from a key string. | |
ExifKey (uint16_t tag, const std::string &ifdItem) | |
Constructor to create an Exif key from a tag and IFD item string. | |
ExifKey (const ExifKey &rhs) | |
Copy constructor. | |
virtual | ~ExifKey () |
Accessors | |
virtual std::string | key () const |
Return the key of the metadatum as a string. The key is of the form 'familyName.groupName.tagName'. Note however that the key is not necessarily unique, e.g., an ExifData may contain multiple metadata with the same key. | |
virtual const char * | familyName () const |
Return an identifier for the type of metadata (the first part of the key). | |
virtual std::string | groupName () const |
Return the name of the group (the second part of the key). For Exif keys, the group name is the IFD item. | |
virtual std::string | tagName () const |
Return the name of the tag (which is also the third part of the key). | |
virtual std::string | tagLabel () const |
Return a label for the tag. | |
virtual uint16_t | tag () const |
Return the tag number. | |
AutoPtr | clone () const |
Return an auto-pointer to a copy of itself (deep copy). The caller owns this copy and the auto-pointer ensures that it will be deleted. | |
IfdId | ifdId () const |
Return the IFD id. | |
const char * | ifdName () const |
Return the name of the IFD. | |
std::string | ifdItem () const |
Return the related image item. | |
std::string | sectionName () const |
Return the name of the Exif section (deprecated). | |
int | idx () const |
Return the index (unique id of this key within the original Exif data, 0 if not set). | |
Manipulators | |
| |
ExifKey & | operator= (const ExifKey &rhs) |
Assignment operator. | |
void | setIdx (int idx) |
Set the index. | |
void | makeKey () |
Set the key corresponding to the tag and IFD id. The key is of the form 'Exif.ifdItem.tagName'. | |
void | decomposeKey () |
Parse and convert the key string into tag and IFD Id. Updates data members if the string can be decomposed, or throws Error . |
Concrete keys for Exif metadata.
Exiv2::ExifKey::ExifKey | ( | const std::string & | key | ) | [explicit] |
Constructor to create an Exif key from a key string.
key | The key string. |
Error | if the first part of the key is not 'Exif' or the remainin parts of the key cannot be parsed and converted to an ifd-item and tag name. |
References decomposeKey().
Exiv2::ExifKey::ExifKey | ( | uint16_t | tag, | |
const std::string & | ifdItem | |||
) |
Constructor to create an Exif key from a tag and IFD item string.
tag | The tag value | |
ifdItem | The IFD string. For MakerNote tags, this must be the IFD item of the specific MakerNote. "MakerNote" is not allowed. |
Error | if the key cannot be constructed from the tag and IFD item parameters. |
References Exiv2::ExifTags::ifdIdByIfdItem(), Exiv2::ExifTags::isExifIfd(), Exiv2::ExifTags::isMakerIfd(), and makeKey().
void Exiv2::ExifKey::decomposeKey | ( | ) | [protected] |
Parse and convert the key string into tag and IFD Id. Updates data members if the string can be decomposed, or throws Error .
Error | if the key cannot be decomposed. |
References familyName(), Exiv2::ExifTags::ifdIdByIfdItem(), ifdItem(), Exiv2::ExifTags::isExifIfd(), Exiv2::ExifTags::isMakerIfd(), Exiv2::string, tag(), and tagName().
Referenced by ExifKey().