7#include "exiv2lib_export.h"
10#include "metadatum.hpp"
11#include "properties.hpp"
85 std::ostream&
write(std::ostream& os,
const ExifData* pMetadata =
nullptr)
const override;
92 [[nodiscard]] std::string
key()
const override;
93 [[nodiscard]]
const char*
familyName()
const override;
95 [[nodiscard]] std::string
groupName()
const override;
97 [[nodiscard]] std::string
tagName()
const override;
98 [[nodiscard]] std::string
tagLabel()
const override;
99 [[nodiscard]] std::string
tagDesc()
const override;
101 [[nodiscard]] uint16_t
tag()
const override;
103 [[nodiscard]]
const char*
typeName()
const override;
106 [[nodiscard]]
size_t typeSize()
const override;
107 [[nodiscard]]
size_t count()
const override;
108 [[nodiscard]]
size_t size()
const override;
109 [[nodiscard]] std::string
toString()
const override;
110 [[nodiscard]] std::string
toString(
size_t n)
const override;
111 [[nodiscard]] int64_t
toInt64(
size_t n = 0)
const override;
112 [[nodiscard]]
float toFloat(
size_t n = 0)
const override;
115 [[nodiscard]]
const Value&
value()
const override;
121 std::unique_ptr<Impl> p_;
212 [[nodiscard]]
bool empty()
const;
214 [[nodiscard]]
long count()
const;
229 xmpPacket_ = std::move(xmpPacket);
233 [[nodiscard]]
const std::string& xmpPacket()
const {
241 XmpMetadata xmpMetadata_;
242 std::string xmpPacket_;
276 static int decode(
XmpData& xmpData,
const std::string& xmpPacket);
294 static int encode(std::string& xmpPacket,
const XmpData& xmpData, uint16_t formatFlags = useCompactFormat,
295 uint32_t padding = 0);
306 using XmpLockFct = void (*)(
void* pLockData,
bool lockUnlock);
371 static void registerNs(
const std::string& ns,
const std::string& prefix);
377 static void unregisterNs(
const std::string& ns);
385 static bool initialized_;
387 static void* pLockData_;
389 friend class XmpProperties;
398#ifdef __cpp_if_constexpr
399 if constexpr (std::is_same_v<T, bool>) {
401 if (std::is_same<T, bool>::value) {
A container for Exif data. This is a top-level class of the Exiv2 library. The container holds Exifda...
Definition exif.hpp:379
Common interface for all types of values used with metadata.
Definition value.hpp:33
std::unique_ptr< Value > UniquePtr
Shortcut for a Value auto pointer.
Definition value.hpp:36
A container for XMP data. This is a top-level class of the Exiv2 library.
Definition xmp_exiv2.hpp:138
bool empty() const
Return true if there is no XMP metadata.
Definition xmp.cpp:464
iterator end()
End of the metadata.
Definition xmp.cpp:476
long count() const
Get the number of metadata entries.
Definition xmp.cpp:468
XmpData()=default
Default constructor.
void eraseFamily(XmpData::iterator &pos)
Delete the Xmpdatum at iterator position pos and update pos erases all following keys from the same f...
Definition xmp.cpp:484
void setPacket(std::string xmpPacket)
setPacket
Definition xmp_exiv2.hpp:228
bool usePacket(bool b)
set usePacket_
Definition xmp_exiv2.hpp:222
int add(const XmpKey &key, const Value *value)
Add an Xmpdatum from the supplied key and value pair. This method copies (clones) the value.
Definition xmp.cpp:431
iterator findKey(const XmpKey &key)
Find the first Xmpdatum with the given key, return an iterator to it.
Definition xmp.cpp:444
void sortByKey()
Sort metadata by key.
Definition xmp.cpp:452
bool usePacket() const
are we to use the packet?
Definition xmp_exiv2.hpp:217
iterator begin()
Begin of the metadata.
Definition xmp.cpp:472
void clear()
Delete all Xmpdatum instances resulting in an empty container.
Definition xmp.cpp:448
XmpMetadata::const_iterator const_iterator
XmpMetadata const iterator type.
Definition xmp_exiv2.hpp:146
Xmpdatum & operator[](const std::string &key)
Returns a reference to the Xmpdatum that is associated with a particular key. If XmpData does not alr...
Definition xmp.cpp:421
XmpMetadata::iterator iterator
XmpMetadata iterator type.
Definition xmp_exiv2.hpp:144
Concrete keys for XMP metadata.
Definition properties.hpp:207
Stateless parser class for XMP packets. Images use this class to parse and serialize XMP packets....
Definition xmp_exiv2.hpp:251
void(*)(void *pLockData, bool lockUnlock) XmpLockFct
Lock/unlock function type.
Definition xmp_exiv2.hpp:306
static bool initialize(XmpParser::XmpLockFct xmpLockFct=nullptr, void *pLockData=nullptr)
Initialize the XMP Toolkit.
Definition xmp.cpp:568
XmpFormatFlags
Options to control the format of the serialized XMP packet.
Definition xmp_exiv2.hpp:254
@ omitAllFormatting
Omit all formatting whitespace.
Definition xmp_exiv2.hpp:261
@ writeAliasComments
Show aliases as XML comments.
Definition xmp_exiv2.hpp:260
@ omitPacketWrapper
Omit the XML packet wrapper.
Definition xmp_exiv2.hpp:255
@ readOnlyPacket
Default is a writeable packet.
Definition xmp_exiv2.hpp:256
@ includeThumbnailPad
Include a padding allowance for a thumbnail image.
Definition xmp_exiv2.hpp:258
@ exactPacketLength
The padding parameter is the overall packet length.
Definition xmp_exiv2.hpp:259
@ useCompactFormat
Use a compact form of RDF.
Definition xmp_exiv2.hpp:257
static void terminate()
Terminate the XMP Toolkit and unregister custom namespaces.
Definition xmp.cpp:623
Information related to an XMP property. An XMP metadatum consists of an XmpKey and a Value and provid...
Definition xmp_exiv2.hpp:27
float toFloat(size_t n=0) const override
Return the n-th component of the value converted to float. The return value is -1 if the value is not...
Definition xmp.cpp:368
std::ostream & write(std::ostream &os, const ExifData *pMetadata=nullptr) const override
Write the interpreted value to an output stream, return the stream.
Definition xmp.cpp:390
~Xmpdatum() override
Destructor.
std::string key() const override
Return the key of the Xmpdatum. The key is of the form 'Xmp.prefix.property'. Note however that the k...
Definition xmp.cpp:308
Rational toRational(size_t n=0) const override
Return the n-th component of the value converted to Rational. The return value is -1/1 if the value i...
Definition xmp.cpp:372
const Value & value() const override
Return a constant reference to the value.
Definition xmp.cpp:380
TypeId typeId() const override
Return the type id of the value.
Definition xmp.cpp:336
Xmpdatum & operator=(const Xmpdatum &rhs)
Assignment operator.
Definition xmp.cpp:298
std::string tagDesc() const override
Return a description for the tag.
Definition xmp.cpp:328
std::string groupName() const override
Return the (preferred) schema namespace prefix.
Definition xmp.cpp:316
size_t size() const override
Return the size of the value in bytes.
Definition xmp.cpp:352
size_t count() const override
Return the number of components in the value.
Definition xmp.cpp:348
uint16_t tag() const override
Properties don't have a tag number. Return 0.
Definition xmp.cpp:332
std::string tagLabel() const override
Return a label for the tag.
Definition xmp.cpp:324
size_t typeSize() const override
The Exif typeSize doesn't make sense here. Return 0.
Definition xmp.cpp:344
Value::UniquePtr getValue() const override
Return an auto-pointer to a copy (clone) of the value. The caller owns this copy and the auto-poiner ...
Definition xmp.cpp:376
size_t copy(byte *buf, ByteOrder byteOrder) const override
Not implemented. Calling this method will raise an exception.
Definition xmp.cpp:386
std::string tagName() const override
Return the property name.
Definition xmp.cpp:320
const char * typeName() const override
Return the name of the type.
Definition xmp.cpp:340
void setValue(const Value *pValue) override
Set the value. This method copies (clones) the value pointed to by pValue.
Definition xmp.cpp:404
std::string toString() const override
Return the value as a string.
Definition xmp.cpp:356
int64_t toInt64(size_t n=0) const override
Return the n-th component of the value converted to int64_t. The return value is -1 if the value is n...
Definition xmp.cpp:364
const char * familyName() const override
Return the name of the metadata family (which is also the first part of the key)
Definition xmp.cpp:312
Xmpdatum(const XmpKey &key, const Value *pValue=nullptr)
Constructor for new tags created by an application. The Xmpdatum is created from a key / value pair....
Definition xmp.cpp:292
Class CrwImage to access Canon CRW images. References: The Canon RAW (CRW) File Format by Phil Harv...
Definition asfvideo.hpp:15
TypeId
Exiv2 value type identifiers.
Definition types.hpp:70
std::pair< int32_t, int32_t > Rational
8 byte signed rational type.
Definition types.hpp:31
ByteOrder
Type to express the byte order (little or big endian)
Definition types.hpp:34
std::map< std::string, std::string > Dictionary
typedef for string:string map
Definition datasets.hpp:312
std::vector< Xmpdatum > XmpMetadata
Container type to hold all metadata.
Definition xmp_exiv2.hpp:126
Internal Pimpl structure of class Xmpdatum.
Definition xmp.cpp:257