![]() |
Exiv2
|
A container for IPTC data. This is a top-level class of the Exiv2 library. More...
#include <iptc.hpp>
Public Types | |
| using | iterator = IptcMetadata::iterator |
| IptcMetadata iterator type. | |
| using | const_iterator = IptcMetadata::const_iterator |
| IptcMetadata const iterator type. | |
Public Member Functions | |
Manipulators | |
| Iptcdatum & | operator[] (const std::string &key) |
| Returns a reference to the Iptcdatum that is associated with a particular key. If IptcData does not already contain such an Iptcdatum, operator[] adds object Iptcdatum(key). | |
| int | add (const IptcKey &key, const Value *value) |
| Add an Iptcdatum from the supplied key and value pair. This method copies (clones) the value. A check for non-repeatable datasets is performed. | |
| int | add (const Iptcdatum &iptcdatum) |
| Add a copy of the Iptcdatum to the IPTC metadata. A check for non-repeatable datasets is performed. | |
| iterator | erase (iterator pos) |
| Delete the Iptcdatum at iterator position pos, return the position of the next Iptcdatum. Note that iterators into the metadata, including pos, are potentially invalidated by this call. | |
| void | clear () |
| Delete all Iptcdatum instances resulting in an empty container. | |
| void | sortByKey () |
| Sort metadata by key. | |
| void | sortByTag () |
| Sort metadata by tag (aka dataset). | |
| iterator | begin () |
| Begin of the metadata. | |
| iterator | end () |
| End of the metadata. | |
| iterator | findKey (const IptcKey &key) |
| Find the first Iptcdatum with the given key, return an iterator to it. | |
| iterator | findId (uint16_t dataset, uint16_t record=IptcDataSets::application2) |
| Find the first Iptcdatum with the given record and dataset it, return a const iterator to it. | |
Accessors | |
| const_iterator | begin () const |
| Begin of the metadata. | |
| const_iterator | end () const |
| End of the metadata. | |
| const_iterator | findKey (const IptcKey &key) const |
| Find the first Iptcdatum with the given key, return a const iterator to it. | |
| const_iterator | findId (uint16_t dataset, uint16_t record=IptcDataSets::application2) const |
| Find the first Iptcdatum with the given record and dataset number, return a const iterator to it. | |
| bool | empty () const |
| Return true if there is no IPTC metadata. | |
| size_t | count () const |
| Get the number of metadata entries. | |
| size_t | size () const |
| Return the exact size of all contained IPTC metadata. | |
| const char * | detectCharset () const |
| Return the metadata charset name or 0. | |
| static void | printStructure (std::ostream &out, const Slice< byte * > &bytes, size_t depth) |
| dump iptc formatted binary data (used by printStructure kpsRecursive) | |
A container for IPTC data. This is a top-level class of the Exiv2 library.
Provide high-level access to the IPTC data of an image:
| int Exiv2::IptcData::add | ( | const Iptcdatum & | iptcdatum | ) |
Add a copy of the Iptcdatum to the IPTC metadata. A check for non-repeatable datasets is performed.
References Exiv2::IptcDataSets::dataSetRepeatable(), end(), findId(), Exiv2::Iptcdatum::record(), and Exiv2::Iptcdatum::tag().
Add an Iptcdatum from the supplied key and value pair. This method copies (clones) the value. A check for non-repeatable datasets is performed.
References add(), and Exiv2::Iptcdatum::Iptcdatum().
Referenced by add().
|
inline |
Begin of the metadata.
Referenced by detectCharset(), and Exiv2::IptcParser::encode().
|
inline |
Delete all Iptcdatum instances resulting in an empty container.
Referenced by Exiv2::Image::clearIptcData(), Exiv2::IptcParser::decode(), and Exiv2::JpegBase::readMetadata().
|
nodiscard |
Return the metadata charset name or 0.
References begin(), end(), findKey(), and Exiv2::IptcKey::IptcKey().
Referenced by Exiv2::copyIptcToXmp(), and Exiv2::moveIptcToXmp().
|
inlinenodiscard |
Return true if there is no IPTC metadata.
Referenced by Exiv2::ExifParser::decode(), and Exiv2::IptcParser::encode().
|
inline |
End of the metadata.
Referenced by add(), detectCharset(), Exiv2::IptcParser::encode(), and operator[]().
| IptcData::iterator Exiv2::IptcData::findId | ( | uint16_t | dataset, |
| uint16_t | record = IptcDataSets::application2 ) |
| IptcData::iterator Exiv2::IptcData::findKey | ( | const IptcKey & | key | ) |
Find the first Iptcdatum with the given key, return an iterator to it.
References Exiv2::IptcKey::record(), and Exiv2::IptcKey::tag().
Referenced by detectCharset(), and operator[]().
|
nodiscard |
Find the first Iptcdatum with the given key, return a const iterator to it.
References Exiv2::IptcKey::record(), and Exiv2::IptcKey::tag().
| Iptcdatum & Exiv2::IptcData::operator[] | ( | const std::string & | key | ) |
|
static |
dump iptc formatted binary data (used by printStructure kpsRecursive)
References Exiv2::Internal::MutableSliceBase< storage_type, data_type >::at(), Exiv2::Internal::binaryToString(), Exiv2::IptcDataSets::dataSetName(), Exiv2::Internal::enforce(), Exiv2::getUShort(), Exiv2::Internal::indent(), Exiv2::makeSlice(), Exiv2::Internal::SliceBase::size(), and Exiv2::Slice< container >::subSlice().
Referenced by Exiv2::Image::printIFDStructure(), Exiv2::Jp2Image::printStructure(), and Exiv2::JpegBase::printStructure().
|
nodiscard |
Return the exact size of all contained IPTC metadata.
Referenced by Exiv2::IptcParser::encode().
| void Exiv2::IptcData::sortByKey | ( | ) |
Sort metadata by key.
References Exiv2::cmpMetadataByKey().
| void Exiv2::IptcData::sortByTag | ( | ) |
Sort metadata by tag (aka dataset).
References Exiv2::cmpMetadataByTag().