 |
Exiv2
|
31 #include "exiv2lib_export.h"
69 const Value* pValue =0);
89 Xmpdatum& operator=(
const char* value);
94 Xmpdatum& operator=(
const bool& value);
100 Xmpdatum& operator=(
const T& value);
119 long copy(
byte* buf,
ByteOrder byteOrder)
const;
121 std::ostream& write(std::ostream& os,
const ExifData* pMetadata =0)
const;
129 const char* familyName()
const;
136 uint16_t tag()
const;
138 const char* typeName()
const;
141 long typeSize()
const;
146 long toLong(
long n =0)
const;
147 float toFloat(
long n =0)
const;
148 Rational toRational(
long n =0)
const;
150 const Value& value()
const;
156 std::auto_ptr<Impl> p_;
176 XmpData() : xmpMetadata_(), xmpPacket_(), usePacket_(0) {}
255 bool usePacket(
bool b) {
bool r = usePacket_; usePacket_=b ;
return r; };
259 const std::string& xmpPacket()
const {
return xmpPacket_ ; };
279 omitPacketWrapper = 0x0010UL,
280 readOnlyPacket = 0x0020UL,
281 useCompactFormat = 0x0040UL,
282 includeThumbnailPad = 0x0100UL,
283 exactPacketLength = 0x0200UL,
284 writeAliasComments = 0x0400UL,
285 omitAllFormatting = 0x0800UL
300 static int decode(
XmpData& xmpData,
321 uint16_t formatFlags =useCompactFormat,
322 uint32_t padding =0);
333 typedef void (*XmpLockFct)(
void* pLockData,
bool lockUnlock);
392 static void terminate();
413 static bool initialized_;
414 static XmpLockFct xmpLockFct_;
415 static void* pLockData_;
443 #endif // #ifndef XMP_HPP_
std::auto_ptr< LangAltValue > AutoPtr
Shortcut for a LangAltValue auto pointer.
Definition: value.hpp:902
virtual ~Xmpdatum()
Destructor.
Definition: xmp.cpp:175
XmpData()
Default constructor.
Definition: xmp_exiv2.hpp:176
static TypeId propertyType(const XmpKey &key)
Return the type for property key. The default for unknown keys is xmpText.
StringVector::const_iterator StringVector_i
Class to provide a StringVector iterator.
Definition: datasets.hpp:398
void sortByKey()
Sort metadata by key.
Definition: xmp.cpp:350
Value::AutoPtr value_
Value.
Definition: xmp.cpp:132
const Value & value() const
Return a constant reference to the value.
Definition: xmp.cpp:264
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:276
std::vector< std::string > StringVector
typedef for string vector
Definition: datasets.hpp:390
Common interface for all types of values used with metadata.
Definition: value.hpp:60
void setValue(const Value *pValue)
Set the value. This method copies (clones) the value pointed to by pValue.
Definition: xmp.cpp:293
Xmpdatum & operator=(const Xmpdatum &rhs)
Assignment operator.
Definition: xmp.cpp:167
const char * typeName() const
Return the name of the type.
Definition: xmp.cpp:214
@ includeThumbnailPad
Include a padding allowance for a thumbnail image.
Definition: xmp_exiv2.hpp:282
Impl & operator=(const Impl &rhs)
Assignment.
Definition: xmp.cpp:147
Type definitions for Exiv2 and related functionality.
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:157
Stateless parser class for XMP packets. Images use this class to parse and serialize XMP packets....
Definition: xmp_exiv2.hpp:275
@ omitAllFormatting
Omit all formatting whitespace.
Definition: xmp_exiv2.hpp:285
long copy(byte *buf, ByteOrder byteOrder) const
Not implemented. Calling this method will raise an exception.
Definition: xmp.cpp:270
std::vector< Xmpdatum > XmpMetadata
Container type to hold all metadata.
Definition: xmp_exiv2.hpp:161
XmpArrayType
XMP array types.
Definition: value.hpp:639
XmpFormatFlags
Options to control the format of the serialized XMP packet.
Definition: xmp_exiv2.hpp:278
XmpMetadata::iterator iterator
XmpMetadata iterator type.
Definition: xmp_exiv2.hpp:179
void clear()
Delete all Xmpdatum instances resulting in an empty container.
Definition: xmp.cpp:345
static AutoPtr create(TypeId typeId)
A (simple) factory to create a Value type.
Definition: value.cpp:100
iterator begin()
Begin of the metadata.
Definition: xmp.cpp:355
TypeId typeId() const
Return the type id of the value.
Definition: xmp.cpp:209
void setPacket(const std::string &xmpPacket)
setPacket
Definition: xmp_exiv2.hpp:257
XmpArrayType xmpArrayType() const
Return XMP array type, indicates if an XMP value is an array.
Definition: value.cpp:651
static std::string ns(const std::string &prefix)
Return the namespace name for the schema associated with prefix.
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:254
std::auto_ptr< XmpTextValue > AutoPtr
Shortcut for a XmpTextValue auto pointer.
Definition: value.hpp:727
Information related to an XMP property. An XMP metadatum consists of an XmpKey and a Value and provid...
Definition: xmp_exiv2.hpp:52
Concrete keys for XMP metadata.
Definition: properties.hpp:241
Impl(const XmpKey &key, const Value *pValue)
Constructor.
Definition: xmp.cpp:135
const char * familyName() const
Return the name of the metadata family (which is also the first part of the key)
Definition: xmp.cpp:184
const char * groupName(IfdId ifdId)
Return the group name for a group id.
Definition: tags_int.cpp:2158
iterator findKey(const XmpKey &key)
Find the first Xmpdatum with the given key, return an iterator to it.
Definition: xmp.cpp:339
std::string groupName() const
Return the (preferred) schema namespace prefix.
Definition: xmp.cpp:189
long count() const
Return the number of components in the value.
Definition: xmp.cpp:224
@ readOnlyPacket
Default is a writeable packet.
Definition: xmp_exiv2.hpp:280
AutoPtr clone() const
Return an auto-pointer to a copy of itself (deep copy). The caller owns this copy and the auto-pointe...
Definition: value.hpp:119
static void terminate()
Terminate the XMP Toolkit and unregister custom namespaces.
Definition: xmp.cpp:540
@ invalidTypeId
Invalid type id.
Definition: types.hpp:157
static void unregisterNs()
Unregister all custom namespaces.
@ xmpBag
XMP bag type.
Definition: types.hpp:154
std::string toString() const
Return the value as a string.
Definition: xmp.cpp:234
@ useCompactFormat
Use a compact form of RDF.
Definition: xmp_exiv2.hpp:281
long count() const
Get the number of metadata entries.
Definition: xmp.cpp:370
@ omitPacketWrapper
Omit the XML packet wrapper.
Definition: xmp_exiv2.hpp:279
static int encode(std::string &xmpPacket, const XmpData &xmpData, uint16_t formatFlags=useCompactFormat, uint32_t padding=0)
Encode (serialize) XMP metadata from xmpData into a string xmpPacket. The XMP packet returned in the ...
Definition: xmp.cpp:836
EXIV2API bool cmpMetadataByKey(const Metadatum &lhs, const Metadatum &rhs)
Compare two metadata by key. Return true if the key of metadatum lhs is less than that of rhs.
Definition: metadatum.cpp:84
@ langAlt
XMP language alternative type.
Definition: types.hpp:156
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:179
XMP property and type information. References: XMP Specification from Adobe (Property descriptions c...
XmpStruct
XMP structure indicator.
Definition: value.hpp:641
XmpKey::AutoPtr key_
Key.
Definition: xmp.cpp:131
void(* XmpLockFct)(void *pLockData, bool lockUnlock)
Lock/unlock function type.
Definition: xmp_exiv2.hpp:333
Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of ...
Definition: asfvideo.hpp:36
A container for XMP data. This is a top-level class of the Exiv2 library.
Definition: xmp_exiv2.hpp:173
std::pair< int32_t, int32_t > Rational
8 byte signed rational type.
Definition: types.hpp:110
bool empty() const
Return true if there is no XMP metadata.
Definition: xmp.cpp:365
Value interface and concrete subclasses.
TypeId
Exiv2 value type identifiers.
Definition: types.hpp:130
T getValue(const byte *buf, ByteOrder byteOrder)
Read a value of type T from the data buffer.
Definition: value.hpp:1372
static void registerNs(const std::string &ns, const std::string &prefix)
Register namespace ns with preferred prefix prefix.
long size() const
Return the size of the value in bytes.
Definition: xmp.cpp:229
static const char * typeName(TypeId typeId)
Return the name of the type, 0 if unknown.
Definition: types.cpp:107
bool usePacket(bool b)
set usePacket_
Definition: xmp_exiv2.hpp:255
#define EXV_WARNING
Shorthand for a temp warning log message object and return its ostringstream.
Definition: error.hpp:148
uint16_t tag() const
Properties don't have a tag number. Return 0.
Definition: xmp.cpp:204
XmpMetadata::const_iterator const_iterator
XmpMetadata const iterator type.
Definition: xmp_exiv2.hpp:181
@ writeAliasComments
Show aliases as XML comments.
Definition: xmp_exiv2.hpp:284
ByteOrder
Type to express the byte order (little or big endian)
Definition: types.hpp:113
std::string tagName() const
Return the property name.
Definition: xmp.cpp:194
bool usePacket() const
are we to use the packet?
Definition: xmp_exiv2.hpp:252
static NsRegistry nsRegistry_
Namespace registry.
Definition: properties.hpp:229
@ exactPacketLength
The padding parameter is the overall packet length.
Definition: xmp_exiv2.hpp:283
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:311
std::auto_ptr< XmpArrayValue > AutoPtr
Shortcut for a XmpArrayValue auto pointer.
Definition: value.hpp:809
std::auto_ptr< XmpKey > AutoPtr
Shortcut for an XmpKey auto pointer.
Definition: properties.hpp:245
BasicError< char > Error
Error class used for exceptions (std::string based)
Definition: error.hpp:323
@ xmpText
XMP text type.
Definition: types.hpp:152
std::string tagLabel() const
Return a label for the tag.
Definition: xmp.cpp:199
static bool initialize(XmpParser::XmpLockFct xmpLockFct=0, void *pLockData=0)
Initialize the XMP Toolkit.
Definition: xmp.cpp:478
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:322
static std::string prefix(const std::string &ns)
Return the (preferred) prefix for schema namespace ns.
@ string
IPTC string type.
Definition: types.hpp:147
std::map< std::string, std::string > Dictionary
typedef for string:string map
Definition: datasets.hpp:364
Exiv2::Exifdatum & setValue(Exiv2::Exifdatum &exifDatum, const T &value)
Set the value of exifDatum to value. If the object already has a value, it is replaced....
Definition: exif.cpp:193
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:259
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:389
#define EXV_ERROR
Shorthand for a temp error log message object and return its ostringstream.
Definition: error.hpp:150
@ xmpSeq
XMP sequence type.
Definition: types.hpp:155
std::string toString(const T &arg)
Utility function to convert the argument of any type to a string.
Definition: types.hpp:521
long typeSize() const
The Exif typeSize doesn't make sense here. Return 0.
Definition: xmp.cpp:219
static std::ostream & printProperty(std::ostream &os, const std::string &key, const Value &value)
Interpret and print the value of an XMP property.
@ xmpAlt
XMP alternative type.
Definition: types.hpp:153
XMP property reference, implemented as a static class.
Definition: properties.hpp:96
iterator end()
End of the metadata.
Definition: xmp.cpp:360
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:249
std::auto_ptr< Value > AutoPtr
Shortcut for a Value auto pointer.
Definition: value.hpp:63
static int decode(XmpData &xmpData, const std::string &xmpPacket)
Decode XMP metadata from an XMP packet xmpPacket into xmpData. The format of the XMP packet must foll...
Definition: xmp.cpp:723
Error class for exceptions, log message class.
Internal Pimpl structure of class Xmpdatum.
Definition: xmp.cpp:125
A container for Exif data. This is a top-level class of the Exiv2 library. The container holds Exifda...
Definition: exif.hpp:434
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:244