 |
Exiv2
|
Go to the documentation of this file.
31 #include "exiv2lib_export.h"
69 const Value* pValue =0);
84 Iptcdatum& operator=(
const uint16_t& value);
109 long copy(
byte* buf,
ByteOrder byteOrder)
const;
110 std::ostream& write(std::ostream& os,
const ExifData* pMetadata =0)
const;
127 uint16_t record()
const;
128 const char* familyName()
const;
137 uint16_t tag()
const;
139 const char* typeName()
const;
140 long typeSize()
const;
145 long toLong(
long n =0)
const;
146 float toFloat(
long n =0)
const;
147 Rational toRational(
long n =0)
const;
149 const Value& value()
const;
218 void clear() { iptcMetadata_.clear(); }
231 iterator findKey(
const IptcKey& key);
236 iterator findId(uint16_t dataset,
237 uint16_t record = IptcDataSets::application2);
242 const_iterator begin()
const {
return iptcMetadata_.begin(); }
250 const_iterator findKey(
const IptcKey& key)
const;
255 const_iterator findId(uint16_t dataset,
256 uint16_t record = IptcDataSets::application2)
const;
258 bool empty()
const {
return count() == 0; }
260 long count()
const {
return static_cast<long>(iptcMetadata_.size()); }
268 const char *detectCharset()
const;
272 static void printStructure(std::ostream& out,
const Slice<byte*>& bytes,uint32_t depth);
317 static const byte marker_;
323 #endif // #ifndef IPTC_HPP_
const char * detectCharset() const
Return the metadata charset name or 0.
Definition: iptc.cpp:377
Slice (= view) for STL containers.
Definition: slice.hpp:529
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.
Definition: iptc.cpp:330
byte * pData_
Pointer to the buffer, 0 if none has been allocated.
Definition: types.hpp:269
std::string indent(int32_t d)
indent output for kpsRecursive in printStructure() .
Definition: image_int.cpp:106
long count() const
Return the number of components in the value.
Definition: iptc.cpp:171
iterator begin()
Begin of the metadata.
Definition: iptc.hpp:224
std::ostream & write(std::ostream &os, const ExifData *pMetadata=0) const
Write the interpreted value to an output stream, return the stream.
Definition: iptc.cpp:111
Common interface for all types of values used with metadata.
Definition: value.hpp:60
void sortByKey()
Sort metadata by key.
Definition: iptc.cpp:336
Type definitions for Exiv2 and related functionality.
bool empty() const
Return true if there is no IPTC metadata.
Definition: iptc.hpp:258
static bool dataSetRepeatable(uint16_t number, uint16_t recordId)
Check if a given dataset is repeatable.
Definition: datasets.cpp:517
static int decode(IptcData &iptcData, const byte *pData, uint32_t size)
Decode binary IPTC data in IPTC IIM4 format from a buffer pData of length size to the provided metada...
Definition: iptc.cpp:432
std::string tagLabel() const
Return a label for the tag.
Definition: iptc.cpp:146
Slice< T > makeSlice(T &cont, size_t begin, size_t end)
Return a new slice with the given bounds.
Definition: slice.hpp:673
long size() const
Return the size of the value in bytes.
Definition: iptc.cpp:176
static AutoPtr create(TypeId typeId)
A (simple) factory to create a Value type.
Definition: value.cpp:100
long typeSize() const
Return the size in bytes of one component of this type.
Definition: iptc.cpp:166
An IPTC metadatum ("dataset"), consisting of an IptcKey and a Value and methods to manipulate these.
Definition: iptc.hpp:52
Iptcdatum & operator[](const std::string &key)
Returns a reference to the Iptcdatum that is associated with a particular key. If IptcData does not a...
Definition: iptc.cpp:266
const_iterator end() const
End of the metadata.
Definition: iptc.hpp:245
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: iptc.cpp:191
uint16_t record() const
Return the record id.
Definition: iptc.cpp:126
std::string tagName() const
Return the name of the tag (aka dataset)
Definition: iptc.cpp:141
binaryToStringHelper< T > binaryToString(const Slice< T > sl)
format binary data for display in Image::printStructure()
Definition: image_int.hpp:125
void clear()
Delete all Iptcdatum instances resulting in an empty container.
Definition: iptc.hpp:218
Iptcdatum(const IptcKey &key, const Value *pValue=0)
Constructor for new tags created by an application. The Iptcdatum is created from a key / value pair....
Definition: iptc.cpp:88
static TypeId dataSetType(uint16_t number, uint16_t recordId)
Return the type for dataSet number and Record id.
Definition: datasets.cpp:478
size_t size() const
Definition: slice.hpp:106
const char * groupName(IfdId ifdId)
Return the group name for a group id.
Definition: tags_int.cpp:2158
iterator end()
End of the metadata.
Definition: iptc.hpp:226
std::auto_ptr< IptcKey > AutoPtr
Shortcut for an IptcKey auto pointer.
Definition: datasets.hpp:278
static std::string dataSetName(uint16_t number, uint16_t recordId)
Return the name of the dataset.
Definition: datasets.cpp:485
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
std::string recordName() const
Return the name of the record (deprecated)
Definition: iptc.cpp:121
@ invalidTypeId
Invalid type id.
Definition: types.hpp:157
static void printStructure(std::ostream &out, const Slice< byte * > &bytes, uint32_t depth)
dump iptc formatted binary data (used by printStructure kpsRecursive)
Definition: iptc.cpp:351
uint8_t byte
1 byte unsigned integer type.
Definition: types.hpp:105
void sortByTag()
Sort metadata by tag (aka dataset)
Definition: iptc.cpp:341
virtual ~Iptcdatum()
Destructor.
Definition: iptc.cpp:102
Utility class containing a character array. All it does is to take care of memory allocation and dele...
Definition: types.hpp:204
iterator findKey(const IptcKey &key)
Find the first Iptcdatum with the given key, return an iterator to it.
Definition: iptc.cpp:318
EXIV2API long us2Data(byte *buf, uint16_t s, ByteOrder byteOrder)
Convert an unsigned short to data, write the data to the buffer, return number of bytes written.
Definition: types.cpp:395
value_type & at(size_t index)
Definition: slice.hpp:269
long copy(byte *buf, ByteOrder byteOrder) const
Write value to a data buffer and return the number of bytes written.
Definition: iptc.cpp:106
const char * familyName() const
Return the name of the metadata family (which is also the first part of the key)
Definition: iptc.cpp:131
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
iterator erase(iterator pos)
Delete the Iptcdatum at iterator position pos, return the position of the next Iptcdatum....
Definition: iptc.cpp:346
std::string groupName() const
Return the name of the metadata group (which is also the second part of the key)
Definition: iptc.cpp:136
const Value & value() const
Return a constant reference to the value.
Definition: iptc.cpp:211
Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of ...
Definition: asfvideo.hpp:36
std::pair< int32_t, int32_t > Rational
8 byte signed rational type.
Definition: types.hpp:110
const char * typeName() const
Return the name of the type.
Definition: iptc.cpp:161
Value interface and concrete subclasses.
std::vector< Iptcdatum > IptcMetadata
Container type to hold all metadata.
Definition: iptc.hpp:160
TypeId
Exiv2 value type identifiers.
Definition: types.hpp:130
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: iptc.cpp:206
T getValue(const byte *buf, ByteOrder byteOrder)
Read a value of type T from the data buffer.
Definition: value.hpp:1372
EXIV2API long ul2Data(byte *buf, uint32_t l, ByteOrder byteOrder)
Convert an unsigned long to data, write the data to the buffer, return number of bytes written.
Definition: types.cpp:408
static const char * typeName(TypeId typeId)
Return the name of the type, 0 if unknown.
Definition: types.cpp:107
#define EXV_WARNING
Shorthand for a temp warning log message object and return its ostringstream.
Definition: error.hpp:148
void setValue(const Value *pValue)
Set the value. This method copies (clones) the value pointed to by pValue.
Definition: iptc.cpp:251
int add(const IptcKey &key, Value *value)
Add an Iptcdatum from the supplied key and value pair. This method copies (clones) the value....
Definition: iptc.cpp:295
IptcMetadata::iterator iterator
IptcMetadata iterator type.
Definition: iptc.hpp:176
Stateless parser class for IPTC data. Images use this class to decode and encode binary IPTC data.
Definition: iptc.hpp:284
EXIV2API uint16_t getUShort(const byte *buf, ByteOrder byteOrder)
Read a 2 byte unsigned short value from the data buffer.
Definition: types.cpp:278
ByteOrder
Type to express the byte order (little or big endian)
Definition: types.hpp:113
EXIV2API bool cmpMetadataByTag(const Metadatum &lhs, const Metadatum &rhs)
Compare two metadata by tag. Return true if the tag of metadatum lhs is less than that of rhs.
Definition: metadatum.cpp:78
BasicError< char > Error
Error class used for exceptions (std::string based)
Definition: error.hpp:323
bool cmpIptcdataByRecord(const Iptcdatum &lhs, const Iptcdatum &rhs)
Compare two iptc items by record. Return true if the record of lhs is less than that of rhs.
Definition: iptc.cpp:504
Concrete keys for IPTC metadata.
Definition: datasets.hpp:275
TypeId typeId() const
Return the type id of the value.
Definition: iptc.cpp:156
A container for IPTC data. This is a top-level class of the Exiv2 library.
Definition: iptc.hpp:173
Slice subSlice(size_t begin, size_t end)
Definition: slice.hpp:567
std::auto_ptr< ValueType< T > > AutoPtr
Shortcut for a ValueType<T> auto pointer.
Definition: value.hpp:1247
Iptcdatum & operator=(const Iptcdatum &rhs)
Assignment operator.
Definition: iptc.cpp:217
static DataBuf encode(const IptcData &iptcData)
Encode the IPTC datasets from iptcData to a binary representation in IPTC IIM4 format.
Definition: iptc.cpp:509
@ string
IPTC string type.
Definition: types.hpp:147
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: iptc.cpp:201
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
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: iptc.cpp:196
std::string toString() const
Return the value as a string.
Definition: iptc.cpp:181
IPTC dataset and type information.
std::string toString(const T &arg)
Utility function to convert the argument of any type to a string.
Definition: types.hpp:521
long size() const
Return the exact size of all contained IPTC metadata.
Definition: iptc.cpp:277
Template for a Value of a basic type. This is used for unsigned and signed short, long and rationals.
Definition: value.hpp:1244
uint16_t record() const
Return the record id.
Definition: datasets.cpp:654
long count() const
Get the number of metadata entries.
Definition: iptc.hpp:260
virtual uint16_t tag() const
Return the tag number.
Definition: datasets.cpp:644
std::string key() const
Return the key of the Iptcdatum. The key is of the form 'Iptc.recordName.datasetName'....
Definition: iptc.cpp:116
static long typeSize(TypeId typeId)
Return the size in bytes of one element of this type.
Definition: types.cpp:121
uint16_t tag() const
Return the tag (aka dataset) number.
Definition: iptc.cpp:151
std::auto_ptr< Value > AutoPtr
Shortcut for a Value auto pointer.
Definition: value.hpp:63
Error class for exceptions, log message class.
Class JpegImage to access JPEG images.
Encoding and decoding of IPTC data.
A container for Exif data. This is a top-level class of the Exiv2 library. The container holds Exifda...
Definition: exif.hpp:434
IptcMetadata::const_iterator const_iterator
IptcMetadata const iterator type.
Definition: iptc.hpp:178