Exiv2
Loading...
Searching...
No Matches
Exiv2::ExifData Class Reference

A container for Exif data. This is a top-level class of the Exiv2 library. The container holds Exifdatum objects. More...

#include <exif.hpp>

Public Types

using iterator = ExifMetadata::iterator
 ExifMetadata iterator type.
using const_iterator = ExifMetadata::const_iterator
 ExifMetadata const iterator type.

Public Member Functions

Manipulators
Exifdatumoperator[] (const std::string &key)
 Returns a reference to the Exifdatum that is associated with a particular key. If ExifData does not already contain such an Exifdatum, operator[] adds object Exifdatum(key).
void add (const ExifKey &key, const Value *pValue)
 Add an Exifdatum from the supplied key and value pair. This method copies (clones) key and value. No duplicate checks are performed, i.e., it is possible to add multiple metadata with the same key.
void add (const Exifdatum &exifdatum)
 Add a copy of the exifdatum to the Exif metadata. No duplicate checks are performed, i.e., it is possible to add multiple metadata with the same key.
iterator erase (iterator pos)
 Delete the Exifdatum at iterator position pos, return the position of the next exifdatum. Note that iterators into the metadata, including pos, are potentially invalidated by this call.
iterator erase (iterator beg, iterator end)
 Remove all elements of the range beg, end, return the position of the next element. Note that iterators into the metadata are potentially invalidated by this call.
void clear ()
 Delete all Exifdatum instances resulting in an empty container. Note that this also removes thumbnails.
void sortByKey ()
 Sort metadata by key.
void sortByTag ()
 Sort metadata by tag.
iterator begin ()
 Begin of the metadata.
iterator end ()
 End of the metadata.
iterator findKey (const ExifKey &key)
 Find the first Exifdatum with the given key, return an iterator to it.

Accessors

const_iterator begin () const
 Begin of the metadata.
const_iterator end () const
 End of the metadata.
const_iterator findKey (const ExifKey &key) const
 Find the first Exifdatum with the given key, return a const iterator to it.
bool empty () const
 Return true if there is no Exif metadata.
size_t count () const
 Get the number of metadata entries.

Detailed Description

A container for Exif data. This is a top-level class of the Exiv2 library. The container holds Exifdatum objects.

Provide high-level access to the Exif data of an image:

  • read Exif information from JPEG files
  • access metadata through keys and standard C++ iterators
  • add, modify and delete metadata
  • write Exif data to JPEG files
  • extract Exif metadata to files, insert from these files
  • extract and delete Exif thumbnail (JPEG and TIFF thumbnails)
Examples
addmoddel.cpp, exifcomment.cpp, exifdata.cpp, exifprint.cpp, exifvalue.cpp, geotag.cpp, and mrwthumb.cpp.

Member Typedef Documentation

◆ const_iterator

using Exiv2::ExifData::const_iterator = ExifMetadata::const_iterator

ExifMetadata const iterator type.

Examples
exifdata.cpp.

Member Function Documentation

◆ add() [1/2]

void Exiv2::ExifData::add ( const Exifdatum & exifdatum)

Add a copy of the exifdatum to the Exif metadata. No duplicate checks are performed, i.e., it is possible to add multiple metadata with the same key.

Exceptions
Errorif the makernote cannot be created

◆ add() [2/2]

void Exiv2::ExifData::add ( const ExifKey & key,
const Value * pValue )

Add an Exifdatum from the supplied key and value pair. This method copies (clones) key and value. No duplicate checks are performed, i.e., it is possible to add multiple metadata with the same key.

Examples
addmoddel.cpp.

References add(), and Exiv2::Exifdatum::Exifdatum().

Referenced by add(), Exiv2::Rw2Image::readMetadata(), and Exiv2::TiffImage::writeMetadata().

◆ begin()

iterator Exiv2::ExifData::begin ( )
inline

◆ clear()

void Exiv2::ExifData::clear ( )

Delete all Exifdatum instances resulting in an empty container. Note that this also removes thumbnails.

Referenced by Exiv2::Image::clearExifData(), and Exiv2::JpegBase::readMetadata().

◆ empty()

bool Exiv2::ExifData::empty ( ) const
inlinenodiscard

Return true if there is no Exif metadata.

Examples
exifprint.cpp, exifvalue.cpp, geotag.cpp, and mrwthumb.cpp.

Referenced by Exiv2::Rw2Image::readMetadata().

◆ end()

iterator Exiv2::ExifData::end ( )
inline

End of the metadata.

Examples
addmoddel.cpp, exifdata.cpp, exifprint.cpp, and mrwthumb.cpp.

Referenced by Exiv2::TiffParser::decode(), Exiv2::Cr2Parser::encode(), Exiv2::ExifParser::encode(), Exiv2::OrfParser::encode(), Exiv2::TiffParser::encode(), erase(), Exiv2::isoSpeed(), Exiv2::lensName(), Exiv2::TiffImage::mimeType(), operator[](), Exiv2::Cr2Image::pixelHeight(), Exiv2::CrwImage::pixelHeight(), Exiv2::MrwImage::pixelHeight(), Exiv2::OrfImage::pixelHeight(), Exiv2::RafImage::pixelHeight(), Exiv2::Rw2Image::pixelHeight(), Exiv2::TiffImage::pixelHeight(), Exiv2::Cr2Image::pixelWidth(), Exiv2::CrwImage::pixelWidth(), Exiv2::MrwImage::pixelWidth(), Exiv2::OrfImage::pixelWidth(), Exiv2::RafImage::pixelWidth(), Exiv2::Rw2Image::pixelWidth(), Exiv2::TiffImage::pixelWidth(), Exiv2::Internal::CanonMakerNote::print0x000c(), Exiv2::Internal::Nikon3MakerNote::print0x0089(), Exiv2::Internal::OlympusMakerNote::print0x0308(), Exiv2::Internal::Nikon3MakerNote::printAfPointsInFocus(), Exiv2::Internal::printCsLensFFFF(), Exiv2::Internal::CanonMakerNote::printFiFileNumber(), Exiv2::Internal::Nikon3MakerNote::printFlashGroupADataFl6(), Exiv2::Internal::Nikon3MakerNote::printFlashGroupADataFl7(), Exiv2::Internal::Nikon3MakerNote::printFlashGroupBDataFl6(), Exiv2::Internal::Nikon3MakerNote::printFlashGroupBDataFl7(), Exiv2::Internal::Nikon3MakerNote::printFlashGroupCDataFl6(), Exiv2::Internal::Nikon3MakerNote::printFlashGroupCDataFl7(), Exiv2::Internal::Nikon3MakerNote::printFlashMasterDataFl6(), Exiv2::Internal::Nikon3MakerNote::printFlashMasterDataFl7(), Exiv2::Internal::CanonMakerNote::printFocalLength(), Exiv2::Internal::Nikon3MakerNote::printLensId(), Exiv2::Internal::PentaxMakerNote::printShutterCount(), Exiv2::Internal::SonyMakerNote::printSony2FpAmbientTemperature(), Exiv2::Internal::SonyMakerNote::printSonyMisc1CameraTemperature(), Exiv2::Rw2Image::readMetadata(), Exiv2::TiffImage::readMetadata(), and Exiv2::TiffImage::writeMetadata().

◆ erase() [1/2]

ExifData::iterator Exiv2::ExifData::erase ( ExifData::iterator beg,
ExifData::iterator end )

Remove all elements of the range beg, end, return the position of the next element. Note that iterators into the metadata are potentially invalidated by this call.

References end().

◆ erase() [2/2]

ExifData::iterator Exiv2::ExifData::erase ( ExifData::iterator pos)

Delete the Exifdatum at iterator position pos, return the position of the next exifdatum. Note that iterators into the metadata, including pos, are potentially invalidated by this call.

Examples
addmoddel.cpp.

Referenced by Exiv2::Cr2Parser::encode(), Exiv2::ExifParser::encode(), Exiv2::OrfParser::encode(), Exiv2::TiffParser::encode(), Exiv2::Rw2Image::readMetadata(), and Exiv2::TiffImage::writeMetadata().

◆ findKey() [1/2]

ExifData::iterator Exiv2::ExifData::findKey ( const ExifKey & key)

Find the first Exifdatum with the given key, return an iterator to it.

Examples
addmoddel.cpp, and mrwthumb.cpp.

References Exiv2::ExifKey::key().

Referenced by Exiv2::TiffParser::decode(), Exiv2::ExifParser::encode(), Exiv2::lensName(), Exiv2::TiffImage::mimeType(), operator[](), Exiv2::Cr2Image::pixelHeight(), Exiv2::CrwImage::pixelHeight(), Exiv2::MrwImage::pixelHeight(), Exiv2::OrfImage::pixelHeight(), Exiv2::RafImage::pixelHeight(), Exiv2::Rw2Image::pixelHeight(), Exiv2::TiffImage::pixelHeight(), Exiv2::Cr2Image::pixelWidth(), Exiv2::CrwImage::pixelWidth(), Exiv2::MrwImage::pixelWidth(), Exiv2::OrfImage::pixelWidth(), Exiv2::RafImage::pixelWidth(), Exiv2::Rw2Image::pixelWidth(), Exiv2::TiffImage::pixelWidth(), Exiv2::Internal::CanonMakerNote::print0x000c(), Exiv2::Internal::Nikon3MakerNote::print0x0089(), Exiv2::Internal::OlympusMakerNote::print0x0308(), Exiv2::Internal::Nikon3MakerNote::printAfPointsInFocus(), Exiv2::Internal::printCsLensFFFF(), Exiv2::Internal::CanonMakerNote::printFiFileNumber(), Exiv2::Internal::Nikon3MakerNote::printFlashGroupADataFl6(), Exiv2::Internal::Nikon3MakerNote::printFlashGroupADataFl7(), Exiv2::Internal::Nikon3MakerNote::printFlashGroupBDataFl6(), Exiv2::Internal::Nikon3MakerNote::printFlashGroupBDataFl7(), Exiv2::Internal::Nikon3MakerNote::printFlashGroupCDataFl6(), Exiv2::Internal::Nikon3MakerNote::printFlashGroupCDataFl7(), Exiv2::Internal::Nikon3MakerNote::printFlashMasterDataFl6(), Exiv2::Internal::Nikon3MakerNote::printFlashMasterDataFl7(), Exiv2::Internal::CanonMakerNote::printFocalLength(), Exiv2::Internal::Nikon3MakerNote::printLensId(), Exiv2::Internal::PentaxMakerNote::printShutterCount(), Exiv2::Internal::SonyMakerNote::printSony2FpAmbientTemperature(), Exiv2::Internal::SonyMakerNote::printSonyMisc1CameraTemperature(), Exiv2::Rw2Image::readMetadata(), Exiv2::TiffImage::readMetadata(), and Exiv2::TiffImage::writeMetadata().

◆ findKey() [2/2]

ExifData::const_iterator Exiv2::ExifData::findKey ( const ExifKey & key) const
nodiscard

Find the first Exifdatum with the given key, return a const iterator to it.

References Exiv2::ExifKey::key().

◆ operator[]()

Exifdatum & Exiv2::ExifData::operator[] ( const std::string & key)

Returns a reference to the Exifdatum that is associated with a particular key. If ExifData does not already contain such an Exifdatum, operator[] adds object Exifdatum(key).

Note
Since operator[] might insert a new element, it can't be a const member function.

References end(), and findKey().

◆ sortByKey()

void Exiv2::ExifData::sortByKey ( )

Sort metadata by key.

References Exiv2::cmpMetadataByKey().

◆ sortByTag()

void Exiv2::ExifData::sortByTag ( )

Sort metadata by tag.

References Exiv2::cmpMetadataByTag().


The documentation for this class was generated from the following files: