24#include "exiv2lib_export.h"
27#include "metadatum.hpp"
28#include "properties.hpp"
62 const Value* pValue =0);
114 std::ostream&
write(std::ostream& os,
const ExifData* pMetadata =0)
const;
121 std::string
key()
const;
129 uint16_t
tag()
const;
139 long toLong(
long n =0)
const;
140 float toFloat(
long n =0)
const;
149 std::auto_ptr<Impl> p_;
169 XmpData() : xmpMetadata_(), xmpPacket_(), usePacket_(0) {}
248 bool usePacket(
bool b) {
bool r = usePacket_; usePacket_=b ;
return r; };
252 const std::string& xmpPacket()
const {
return xmpPacket_ ; };
258 XmpMetadata xmpMetadata_;
259 std::string xmpPacket_ ;
293 static int decode(
XmpData& xmpData,
294 const std::string& xmpPacket);
312 static int encode( std::string& xmpPacket,
314 uint16_t formatFlags =useCompactFormat,
315 uint32_t padding =0);
326 typedef void (*
XmpLockFct)(
void* pLockData,
bool lockUnlock);
391 static void registerNs(
const std::string& ns,
392 const std::string& prefix);
398 static void unregisterNs(
const std::string& ns);
406 static bool initialized_;
408 static void* pLockData_;
410 friend class XmpProperties;
A container for Exif data. This is a top-level class of the Exiv2 library. The container holds Exifda...
Definition exif.hpp:434
Common interface for all types of values used with metadata.
Definition value.hpp:51
std::auto_ptr< Value > AutoPtr
Shortcut for a Value auto pointer.
Definition value.hpp:54
A container for XMP data. This is a top-level class of the Exiv2 library.
Definition xmp_exiv2.hpp:166
bool empty() const
Return true if there is no XMP metadata.
Definition xmp.cpp:528
iterator end()
End of the metadata.
Definition xmp.cpp:543
XmpData()
Default constructor.
Definition xmp_exiv2.hpp:169
long count() const
Get the number of metadata entries.
Definition xmp.cpp:533
XmpMetadata::iterator iterator
XmpMetadata iterator type.
Definition xmp_exiv2.hpp:172
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:552
bool usePacket(bool b)
set usePacket_
Definition xmp_exiv2.hpp:248
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:485
iterator findKey(const XmpKey &key)
Find the first Xmpdatum with the given key, return an iterator to it.
Definition xmp.cpp:502
XmpMetadata::const_iterator const_iterator
XmpMetadata const iterator type.
Definition xmp_exiv2.hpp:174
void sortByKey()
Sort metadata by key.
Definition xmp.cpp:513
bool usePacket() const
are we to use the packet?
Definition xmp_exiv2.hpp:245
iterator begin()
Begin of the metadata.
Definition xmp.cpp:538
void clear()
Delete all Xmpdatum instances resulting in an empty container.
Definition xmp.cpp:508
void setPacket(const std::string &xmpPacket)
setPacket
Definition xmp_exiv2.hpp:250
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:474
Concrete keys for XMP metadata.
Definition properties.hpp:231
Stateless parser class for XMP packets. Images use this class to parse and serialize XMP packets....
Definition xmp_exiv2.hpp:268
static bool initialize(XmpParser::XmpLockFct xmpLockFct=0, void *pLockData=0)
Initialize the XMP Toolkit.
Definition xmp.cpp:641
XmpFormatFlags
Options to control the format of the serialized XMP packet.
Definition xmp_exiv2.hpp:271
@ omitAllFormatting
Omit all formatting whitespace.
Definition xmp_exiv2.hpp:278
@ writeAliasComments
Show aliases as XML comments.
Definition xmp_exiv2.hpp:277
@ omitPacketWrapper
Omit the XML packet wrapper.
Definition xmp_exiv2.hpp:272
@ readOnlyPacket
Default is a writeable packet.
Definition xmp_exiv2.hpp:273
@ includeThumbnailPad
Include a padding allowance for a thumbnail image.
Definition xmp_exiv2.hpp:275
@ exactPacketLength
The padding parameter is the overall packet length.
Definition xmp_exiv2.hpp:276
@ useCompactFormat
Use a compact form of RDF.
Definition xmp_exiv2.hpp:274
static void terminate()
Terminate the XMP Toolkit and unregister custom namespaces.
Definition xmp.cpp:703
void(* XmpLockFct)(void *pLockData, bool lockUnlock)
Lock/unlock function type.
Definition xmp_exiv2.hpp:326
Information related to an XMP property. An XMP metadatum consists of an XmpKey and a Value and provid...
Definition xmp_exiv2.hpp:45
std::string tagLabel() const
Return a label for the tag.
Definition xmp.cpp:362
Value::AutoPtr getValue() const
Return an auto-pointer to a copy (clone) of the value. The caller owns this copy and the auto-poiner ...
Definition xmp.cpp:422
const char * typeName() const
Return the name of the type.
Definition xmp.cpp:377
long copy(byte *buf, ByteOrder byteOrder) const
Not implemented. Calling this method will raise an exception.
Definition xmp.cpp:433
Xmpdatum & operator=(const Xmpdatum &rhs)
Assignment operator.
Definition xmp.cpp:330
TypeId typeId() const
Return the type id of the value.
Definition xmp.cpp:372
Rational toRational(long n=0) const
Return the n-th component of the value converted to Rational. The return value is -1/1 if the value i...
Definition xmp.cpp:417
long typeSize() const
The Exif typeSize doesn't make sense here. Return 0.
Definition xmp.cpp:382
long size() const
Return the size of the value in bytes.
Definition xmp.cpp:392
std::string key() const
Return the key of the Xmpdatum. The key is of the form 'Xmp.prefix.property'. Note however that the k...
Definition xmp.cpp:342
std::ostream & write(std::ostream &os, const ExifData *pMetadata=0) const
Write the interpreted value to an output stream, return the stream.
Definition xmp.cpp:439
std::string tagName() const
Return the property name.
Definition xmp.cpp:357
const Value & value() const
Return a constant reference to the value.
Definition xmp.cpp:427
long toLong(long n=0) const
Return the n-th component of the value converted to long. The return value is -1 if the value is not ...
Definition xmp.cpp:407
Xmpdatum(const XmpKey &key, const Value *pValue=0)
Constructor for new tags created by an application. The Xmpdatum is created from a key / value pair....
Definition xmp.cpp:320
std::string toString() const
Return the value as a string.
Definition xmp.cpp:397
long count() const
Return the number of components in the value.
Definition xmp.cpp:387
float toFloat(long n=0) const
Return the n-th component of the value converted to float. The return value is -1 if the value is not...
Definition xmp.cpp:412
const char * familyName() const
Return the name of the metadata family (which is also the first part of the key).
Definition xmp.cpp:347
uint16_t tag() const
Properties don't have a tag number. Return 0.
Definition xmp.cpp:367
std::string groupName() const
Return the (preferred) schema namespace prefix.
Definition xmp.cpp:352
void setValue(const Value *pValue)
Set the value. This method copies (clones) the value pointed to by pValue.
Definition xmp.cpp:456
Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of ...
Definition asfvideo.hpp:36
TypeId
Exiv2 value type identifiers.
Definition types.hpp:119
ByteOrder
Type to express the byte order (little or big endian).
Definition types.hpp:102
std::pair< int32_t, int32_t > Rational
8 byte signed rational type.
Definition types.hpp:99
std::string toString(const T &arg)
Utility function to convert the argument of any type to a string.
Definition types.hpp:510
std::vector< Xmpdatum > XmpMetadata
Container type to hold all metadata.
Definition xmp_exiv2.hpp:154
std::map< std::string, std::string > Dictionary
typedef for string:string map
Definition datasets.hpp:364
Internal Pimpl structure of class Xmpdatum.
Definition xmp.cpp:288