24#include "exiv2lib_export.h"
85 virtual int read(
const std::string& buf) =0;
132 virtual std::ostream&
write(std::ostream& os)
const =0;
144 virtual std::string
toString(
long n)
const;
227 static AutoPtr create(
TypeId typeId);
240 virtual Value* clone_()
const =0;
249 return value.
write(os);
253 class EXIV2API DataValue :
public Value {
260 DataValue(
const byte* buf,
261 long len,
ByteOrder byteOrder =invalidByteOrder,
264 virtual ~DataValue();
280 virtual int read(
const byte* buf,
284 virtual int read(
const std::string& buf);
303 virtual long copy(
byte* buf,
ByteOrder byteOrder =invalidByteOrder)
const;
304 virtual long count()
const;
305 virtual long size()
const;
306 virtual std::ostream& write(std::ostream& os)
const;
312 virtual std::string
toString(
long n)
const;
313 virtual long toLong(
long n =0)
const;
314 virtual float toFloat(
long n =0)
const;
315 virtual Rational toRational(
long n =0)
const;
338 typedef std::auto_ptr<StringValueBase>
AutoPtr;
355 virtual int read(
const std::string& buf);
368 virtual int read(
const byte* buf,
389 virtual long copy(
byte* buf,
ByteOrder byteOrder =invalidByteOrder)
const;
390 virtual long count()
const;
391 virtual long size()
const;
392 virtual long toLong(
long n =0)
const;
393 virtual float toFloat(
long n =0)
const;
394 virtual Rational toRational(
long n =0)
const;
395 virtual std::ostream& write(std::ostream& os)
const;
472 virtual int read(
const std::string& buf);
483 virtual std::ostream& write(std::ostream& os)
const;
504 invalidCharsetId, lastCharsetId };
517 class EXIV2API CharsetInfo {
521 CharsetInfo(
const CharsetInfo&);
523 CharsetInfo& operator=(
const CharsetInfo&);
576 long copy(
byte* buf,
ByteOrder byteOrder)
const;
581 std::ostream& write(std::ostream& os)
const;
596 std::string
comment(
const char* encoding =0)
const;
606 const char* detectCharset(std::string& c)
const;
608 CharsetId charsetId()
const;
624 class EXIV2API XmpValue :
public Value {
642 XmpArrayType xmpArrayType()
const;
644 XmpStruct xmpStruct()
const;
645 virtual long size()
const;
659 virtual long copy(
byte* buf,
ByteOrder byteOrder =invalidByteOrder)
const;
665 void setXmpArrayType(XmpArrayType xmpArrayType);
667 void setXmpStruct(XmpStruct xmpStruct =xsStruct);
682 virtual int read(
const byte* buf,
685 virtual int read(
const std::string& buf) =0;
699 XmpValue&
operator=(
const XmpValue& rhs);
746 virtual int read(
const std::string& buf);
753 virtual long count()
const;
760 virtual long toLong(
long n =0)
const;
767 virtual float toFloat(
long n =0)
const;
775 virtual std::ostream&
write(std::ostream& os)
const;
821 virtual int read(
const std::string& buf);
827 virtual long count()
const;
833 virtual std::string
toString(
long n)
const;
834 virtual long toLong(
long n =0)
const;
835 virtual float toFloat(
long n =0)
const;
843 virtual std::ostream&
write(std::ostream& os)
const;
850 std::vector<std::string> value_;
863 bool operator() (
const std::string& str1,
const std::string& str2)
const
865 int result = str1.size() < str2.size() ? 1
866 : str1.size() > str2.size() ? -1
869 std::string::const_iterator c1 = str1.begin();
870 std::string::const_iterator c2 = str2.begin();
871 if ( result==0 )
for (
872 ; result==0 && c1 != str1.end()
875 result = tolower(*c1) < tolower(*c2) ? 1
876 : tolower(*c1) > tolower(*c2) ? -1
923 virtual int read(
const std::string& buf);
929 virtual long count()
const;
937 virtual std::string
toString(
long n)
const;
943 std::string
toString(
const std::string& qualifier)
const;
944 virtual long toLong(
long n =0)
const;
945 virtual float toFloat(
long n =0)
const;
953 virtual std::ostream&
write(std::ostream& os)
const;
962 typedef std::map<std::string, std::string,LangAltValueComparator>
ValueType;
994 struct EXIV2API Date {
1016 virtual int read(
const byte* buf,
1027 virtual int read(
const std::string& buf);
1048 virtual long copy(
byte* buf,
ByteOrder byteOrder =invalidByteOrder)
const;
1050 virtual const Date& getDate()
const;
1051 virtual long count()
const;
1052 virtual long size()
const;
1053 virtual std::ostream& write(std::ostream& os)
const;
1055 virtual long toLong(
long n =0)
const;
1057 virtual float toFloat(
long n =0)
const;
1059 virtual Rational toRational(
long n =0)
const;
1089 TimeValue(
int hour,
int minute,
int second =0,
1090 int tzHour =0,
int tzMinute =0);
1123 virtual int read(
const byte* buf,
1134 virtual int read(
const std::string& buf);
1155 virtual long copy(
byte* buf,
ByteOrder byteOrder =invalidByteOrder)
const;
1157 virtual const Time& getTime()
const;
1158 virtual long count()
const;
1159 virtual long size()
const;
1160 virtual std::ostream& write(std::ostream& os)
const;
1162 virtual long toLong(
long n =0)
const;
1164 virtual float toFloat(
long n =0)
const;
1166 virtual Rational toRational(
long n =0)
const;
1182 int scanTime3(
const char* buf,
const char* format);
1193 int scanTime6(
const char* buf,
const char* format);
1234 template<
typename T>
1268 virtual int read(
const std::string& buf);
1282 virtual std::ostream&
write(std::ostream& os)
const;
1389 return getLong(buf, byteOrder);
1430 return us2Data(buf, t, byteOrder);
1439 return ul2Data(buf, t, byteOrder);
1448 return ur2Data(buf, t, byteOrder);
1457 return s2Data(buf, t, byteOrder);
1466 return l2Data(buf, t, byteOrder);
1475 return r2Data(buf, t, byteOrder);
1484 return f2Data(buf, t, byteOrder);
1493 return d2Data(buf, t, byteOrder);
1496 template<
typename T>
1502 template<
typename T>
1508 template<
typename T>
1512 read(buf, len, byteOrder);
1515 template<
typename T>
1522 template<
typename T>
1526 if (rhs.sizeDataArea_ > 0) {
1527 pDataArea_ = new byte[rhs.sizeDataArea_];
1528 std::memcpy(pDataArea_, rhs.pDataArea_, rhs.sizeDataArea_);
1529 sizeDataArea_ = rhs.sizeDataArea_;
1533 template<
typename T>
1536 delete[] pDataArea_;
1539 template<
typename T>
1542 if (
this == &rhs)
return *
this;
1547 if (rhs.sizeDataArea_ > 0) {
1548 tmp =
new byte[rhs.sizeDataArea_];
1549 std::memcpy(tmp, rhs.pDataArea_, rhs.sizeDataArea_);
1551 delete[] pDataArea_;
1553 sizeDataArea_ = rhs.sizeDataArea_;
1558 template<
typename T>
1564 if (len % ts != 0) len = (len / ts) * ts;
1565 for (
long i = 0; i < len; i += ts) {
1571 template<
typename T>
1574 std::istringstream is(buf);
1577 while (!(is.eof())) {
1579 if (is.fail())
return 1;
1586 template<
typename T>
1590 typename ValueList::const_iterator end =
value_.end();
1591 for (
typename ValueList::const_iterator i =
value_.begin(); i != end; ++i) {
1592 offset +=
toData(buf + offset, *i, byteOrder);
1597 template<
typename T>
1600 return static_cast<long>(
value_.size());
1603 template<
typename T>
1609 template<
typename T>
1615 template<
typename T>
1618 typename ValueList::const_iterator end =
value_.end();
1619 typename ValueList::const_iterator i =
value_.begin();
1621 os << std::setprecision(15) << *i;
1622 if (++i != end) os <<
" ";
1627 template<
typename T>
1635 template<
typename T>
1639 return static_cast<long>(
value_.at(n));
1642#define LARGE_INT 1000000
1647 const double v =
value_.at(n);
1648 ok_ = (INT_MIN <= v && v <= INT_MAX);
1650 return static_cast<long>(v);
1656 const double v =
value_.at(n);
1657 ok_ = (INT_MIN <= v && v <= INT_MAX);
1659 return static_cast<long>(v);
1678 template<
typename T>
1682 return static_cast<float>(
value_.at(n));
1689 if (!
ok_)
return 0.0f;
1690 return static_cast<float>(
value_.at(n).first) /
value_.at(n).second;
1697 if (!
ok_)
return 0.0f;
1698 return static_cast<float>(
value_.at(n).first) /
value_.at(n).second;
1701 template<
typename T>
1738 template<
typename T>
1741 return sizeDataArea_;
1744 template<
typename T>
1747 return DataBuf(pDataArea_, sizeDataArea_);
1750 template<
typename T>
1755 tmp =
new byte[len];
1756 std::memcpy(tmp, buf, len);
1758 delete[] pDataArea_;
1760 sizeDataArea_ = len;
Value for an Ascii string type.
Definition value.hpp:449
AsciiValue()
Default constructor.
Definition value.cpp:389
std::auto_ptr< AsciiValue > AutoPtr
Shortcut for a AsciiValue auto pointer.
Definition value.hpp:452
virtual int read(const std::string &buf)
Set the value to that of the string buf. Overrides base class to append a terminating '\0' character ...
Definition value.cpp:403
Utility class containing a character array. All it does is to take care of memory allocation and dele...
Definition types.hpp:193
Value for an undefined data type.
Definition value.hpp:253
std::auto_ptr< DataValue > AutoPtr
Shortcut for a DataValue auto pointer.
Definition value.hpp:256
virtual int read(const byte *buf, long len, ByteOrder byteOrder=invalidByteOrder)
Read the value from a character buffer.
Definition value.cpp:211
Value for simple ISO 8601 dates
Definition value.hpp:978
DateValue()
Default constructor.
Definition value.cpp:967
virtual int read(const byte *buf, long len, ByteOrder byteOrder=invalidByteOrder)
Read the value from a character buffer.
Definition value.cpp:984
void setDate(const Date &src)
Set the date.
Definition value.cpp:1033
std::auto_ptr< DateValue > AutoPtr
Shortcut for a DateValue auto pointer.
Definition value.hpp:981
std::auto_ptr< LangAltValue > AutoPtr
Shortcut for a LangAltValue auto pointer.
Definition value.hpp:893
virtual std::ostream & write(std::ostream &os) const
Write all elements of the value to os, separated by commas.
Definition value.cpp:906
virtual float toFloat(long n=0) const
Convert the n-th component of the value to a float. The behaviour of this method may be undefined if ...
Definition value.cpp:950
virtual long toLong(long n=0) const
Convert the n-th component of the value to a long. The behaviour of this method may be undefined if t...
Definition value.cpp:944
LangAltValue()
Constructor.
Definition value.cpp:841
std::map< std::string, std::string, LangAltValueComparator > ValueType
Type used to store language alternative arrays.
Definition value.hpp:962
virtual Rational toRational(long n=0) const
Convert the n-th component of the value to a Rational. The behaviour of this method may be undefined ...
Definition value.cpp:956
virtual std::string toString(long n) const
Return the text value associated with the default language qualifier x-default. The parameter n is no...
Definition value.cpp:928
virtual long count() const
Return the number of components of the value.
Definition value.cpp:899
ValueType value_
Map to store the language alternative values. The language qualifier is used as the key for the map e...
Definition value.hpp:968
virtual int read(const std::string &buf)
Read a simple property value from buf and append it to the value.
Definition value.cpp:852
Abstract base class for a string based Value type.
Definition value.hpp:335
StringValueBase(TypeId typeId)
Constructor for subclasses.
Definition value.cpp:286
std::string value_
Stores the string value.
Definition value.hpp:406
std::auto_ptr< StringValueBase > AutoPtr
Shortcut for a StringValueBase auto pointer.
Definition value.hpp:338
virtual int read(const std::string &buf)
Read the value from buf. This default implementation uses buf as it is.
Definition value.cpp:314
virtual StringValueBase * clone_() const =0
Internal virtual copy constructor.
Value for string type.
Definition value.hpp:417
std::auto_ptr< StringValue > AutoPtr
Shortcut for a StringValue auto pointer.
Definition value.hpp:420
StringValue()
Default constructor.
Definition value.cpp:370
Value for simple ISO 8601 times.
Definition value.hpp:1079
std::auto_ptr< TimeValue > AutoPtr
Shortcut for a TimeValue auto pointer.
Definition value.hpp:1082
virtual int read(const byte *buf, long len, ByteOrder byteOrder=invalidByteOrder)
Read the value from a character buffer.
Definition value.cpp:1126
void setTime(const Time &src)
Set the time.
Definition value.cpp:1207
TimeValue()
Default constructor.
Definition value.cpp:1105
static long typeSize(TypeId typeId)
Return the size in bytes of one element of this type.
Definition types.cpp:116
Template for a Value of a basic type. This is used for unsigned and signed short, long and rationals.
Definition value.hpp:1235
ValueType< T > & operator=(const ValueType< T > &rhs)
Assignment operator.
Definition value.hpp:1540
std::auto_ptr< ValueType< T > > AutoPtr
Shortcut for a ValueType<T> auto pointer.
Definition value.hpp:1238
virtual long toLong(long n=0) const
Convert the n-th component of the value to a long. The behaviour of this method may be undefined if t...
Definition value.hpp:1636
ValueType(const T &val, TypeId typeId=getType< T >())
Constructor.
Definition value.hpp:1516
ValueType(const byte *buf, long len, ByteOrder byteOrder, TypeId typeId=getType< T >())
Constructor.
Definition value.hpp:1509
virtual long count() const
Return the number of components of the value.
Definition value.hpp:1598
virtual int setDataArea(const byte *buf, long len)
Set the data area. This method copies (clones) the buffer pointed to by buf.
Definition value.hpp:1751
std::vector< T >::iterator iterator
Iterator type defined for convenience.
Definition value.hpp:1305
virtual long size() const
Return the size of the value in bytes.
Definition value.hpp:1604
virtual long sizeDataArea() const
Return the size of the data area.
Definition value.hpp:1739
virtual ~ValueType()
Virtual destructor.
Definition value.hpp:1534
ValueType(TypeId typeId)
Constructor.
Definition value.hpp:1503
ValueType(const ValueType< T > &rhs)
Copy constructor.
Definition value.hpp:1523
virtual int read(const byte *buf, long len, ByteOrder byteOrder)
Read the value from a character buffer.
Definition value.hpp:1559
std::vector< T > ValueList
Container for values.
Definition value.hpp:1303
virtual DataBuf dataArea() const
Return a copy of the data area in a DataBuf. The caller owns this copy and DataBuf ensures that it wi...
Definition value.hpp:1745
ValueType()
Default Constructor.
Definition value.hpp:1497
virtual Rational toRational(long n=0) const
Convert the n-th component of the value to a Rational. The behaviour of this method may be undefined ...
Definition value.hpp:1702
virtual std::string toString(long n) const
Return the n-th component of the value as a string. The behaviour of this method may be undefined if ...
Definition value.hpp:1628
virtual std::ostream & write(std::ostream &os) const
Write the value to an output stream. You do not usually have to use this function; it is used for the...
Definition value.hpp:1616
std::vector< T >::const_iterator const_iterator
Const iterator type defined for convenience.
Definition value.hpp:1307
virtual float toFloat(long n=0) const
Convert the n-th component of the value to a float. The behaviour of this method may be undefined if ...
Definition value.hpp:1679
ValueList value_
Definition value.hpp:1316
virtual long copy(byte *buf, ByteOrder byteOrder) const
Write value to a data buffer.
Definition value.hpp:1587
virtual int read(const std::string &buf)
Set the data from a string of values of type T (e.g., "0 1 2 3" or "1/2 1/3 1/4" depending on what T ...
Definition value.hpp:1572
Common interface for all types of values used with metadata.
Definition value.hpp:51
TypeId typeId() const
Return the type identifier (Exif data format type).
Definition value.hpp:104
std::auto_ptr< Value > AutoPtr
Shortcut for a Value auto pointer.
Definition value.hpp:54
virtual std::ostream & write(std::ostream &os) const =0
Write the value to an output stream. You do not usually have to use this function; it is used for the...
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:110
virtual float toFloat(long n=0) const =0
Convert the n-th component of the value to a float. The behaviour of this method may be undefined if ...
virtual int read(const std::string &buf)=0
Set the value from a string buffer. The format of the string corresponds to that of the write() metho...
virtual long size() const =0
Return the size of the value in bytes.
virtual long copy(byte *buf, ByteOrder byteOrder) const =0
Write value to a data buffer.
virtual long toLong(long n=0) const =0
Convert the n-th component of the value to a long. The behaviour of this method may be undefined if t...
bool ok_
Indicates the status of the previous to<Type> conversion.
Definition value.hpp:236
bool ok() const
Check the ok status indicator. After a to<Type> conversion, this indicator shows whether the conversi...
Definition value.hpp:188
virtual Rational toRational(long n=0) const =0
Convert the n-th component of the value to a Rational. The behaviour of this method may be undefined ...
std::string toString() const
Return the value as a string. Implemented in terms of write(std::ostream& os) const of the concrete c...
Definition value.cpp:168
virtual int setDataArea(const byte *buf, long len)
Set the data area, if the value has one by copying (cloning) the buffer pointed to by buf.
Definition value.cpp:163
virtual long sizeDataArea() const
Return the size of the data area, 0 if there is none.
Definition value.cpp:181
Value & operator=(const Value &rhs)
Assignment operator. Protected so that it can only be used by subclasses but not directly.
Definition value.cpp:85
Value(TypeId typeId)
Constructor, taking a type id to initialize the base class with.
Definition value.cpp:76
virtual int read(const byte *buf, long len, ByteOrder byteOrder)=0
Read the value from a character buffer.
virtual long count() const =0
Return the number of components of the value.
virtual DataBuf dataArea() const
Return a copy of the data area if the value has one. The caller owns this copy and DataBuf ensures th...
Definition value.cpp:186
std::auto_ptr< XmpArrayValue > AutoPtr
Shortcut for a XmpArrayValue auto pointer.
Definition value.hpp:800
XmpArrayValue(TypeId typeId=xmpBag)
Constructor. typeId can be one of xmpBag, xmpSeq or xmpAlt.
Definition value.cpp:783
virtual int read(const std::string &buf)
Read a simple property value from buf and append it to the value.
Definition value.cpp:789
virtual long toLong(long n=0) const
Convert the n-th component of the value to a long. The behaviour of this method may be undefined if t...
Definition value.cpp:821
virtual std::string toString(long n) const
Return the n-th component of the value as a string. The behaviour of this method may be undefined if ...
Definition value.cpp:815
virtual float toFloat(long n=0) const
Convert the n-th component of the value to a float. The behaviour of this method may be undefined if ...
Definition value.cpp:826
virtual Rational toRational(long n=0) const
Convert the n-th component of the value to a Rational. The behaviour of this method may be undefined ...
Definition value.cpp:831
virtual long count() const
Return the number of components of the value.
Definition value.cpp:800
virtual std::ostream & write(std::ostream &os) const
Write all elements of the value to os, separated by commas.
Definition value.cpp:805
long size() const
Return the size of the value in bytes.
Definition value.cpp:730
virtual long toLong(long n=0) const
Convert the value to a long. The optional parameter n is not used and is ignored.
Definition value.cpp:763
XmpTextValue()
Constructor.
Definition value.cpp:679
virtual float toFloat(long n=0) const
Convert the value to a float. The optional parameter n is not used and is ignored.
Definition value.cpp:768
virtual std::ostream & write(std::ostream &os) const
Write the value to an output stream. You do not usually have to use this function; it is used for the...
Definition value.cpp:740
virtual long count() const
Return the number of components of the value.
Definition value.cpp:735
virtual int read(const std::string &buf)
Read a simple property value from buf to set the value.
Definition value.cpp:690
std::auto_ptr< XmpTextValue > AutoPtr
Shortcut for a XmpTextValue auto pointer.
Definition value.hpp:718
virtual Rational toRational(long n=0) const
Convert the value to a Rational. The optional parameter n is not used and is ignored.
Definition value.cpp:773
std::string value_
Stores the string values.
Definition value.hpp:784
Base class for all Exiv2 values used to store XMP property values.
Definition value.hpp:624
std::auto_ptr< XmpValue > AutoPtr
Shortcut for a XmpValue auto pointer.
Definition value.hpp:627
XmpValue & operator=(const XmpValue &rhs)
Assignment operator. Protected so that it can only be used by subclasses but not directly.
Definition value.cpp:614
virtual int read(const byte *buf, long len, ByteOrder byteOrder=invalidByteOrder)
Read the value from a character buffer.
Definition value.cpp:664
XmpStruct
XMP structure indicator.
Definition value.hpp:632
virtual int read(const std::string &buf)=0
Set the value from a string buffer. The format of the string corresponds to that of the write() metho...
XmpArrayType xmpArrayType() const
Return XMP array type, indicates if an XMP value is an array.
Definition value.cpp:632
XmpArrayType
XMP array types.
Definition value.hpp:630
Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of ...
Definition asfvideo.hpp:36
EXIV2API std::ostream & operator<<(std::ostream &os, const DataSet &dataSet)
Output operator for dataSet.
Definition datasets.cpp:709
EXIV2API double getDouble(const byte *buf, ByteOrder byteOrder)
Read an 8 byte double precision floating point value (IEEE 754 binary64) from the data buffer.
Definition types.cpp:356
TypeId getType< int32_t >()
Specialization for a signed long.
Definition value.hpp:1219
EXIV2API long f2Data(byte *buf, float f, ByteOrder byteOrder)
Convert a single precision floating point (IEEE 754 binary32) float to data, write the data to the bu...
Definition types.cpp:464
EXIV2API long d2Data(byte *buf, double d, ByteOrder byteOrder)
Convert a double precision floating point (IEEE 754 binary64) double to data, write the data to the b...
Definition types.cpp:478
ValueType< URational > URationalValue
Unsigned rational value type.
Definition value.hpp:1334
EXIV2API float getFloat(const byte *buf, ByteOrder byteOrder)
Read a 4 byte single precision floating point value (IEEE 754 binary32) from the data buffer.
Definition types.cpp:342
TypeId getType< int16_t >()
Specialization for a signed short.
Definition value.hpp:1217
EXIV2API Rational floatToRationalCast(float f)
Very simple conversion of a float to a Rational.
Definition types.cpp:689
EXIV2API long l2Data(byte *buf, int32_t l, ByteOrder byteOrder)
Convert a signed long to data, write the data to the buffer, return number of bytes written.
Definition types.cpp:440
EXIV2API int16_t getShort(const byte *buf, ByteOrder byteOrder)
Read a 2 byte signed short value from the data buffer.
Definition types.cpp:313
ValueType< uint16_t > UShortValue
Unsigned short value type.
Definition value.hpp:1330
TypeId getType< uint32_t >()
Specialization for an unsigned long.
Definition value.hpp:1213
EXIV2API uint32_t getULong(const byte *buf, ByteOrder byteOrder)
Read a 4 byte unsigned long value from the data buffer.
Definition types.cpp:278
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:403
ValueType< int32_t > LongValue
Signed long value type.
Definition value.hpp:1338
T getValue(const byte *buf, ByteOrder byteOrder)
Read a value of type T from the data buffer.
TypeId
Exiv2 value type identifiers.
Definition types.hpp:119
@ unsignedShort
Exif SHORT type, 16-bit (2-byte) unsigned integer.
Definition types.hpp:122
@ signedRational
Exif SRATIONAL type, two SLONGs: numerator and denumerator of a fraction.
Definition types.hpp:129
@ unsignedLong
Exif LONG type, 32-bit (4-byte) unsigned integer.
Definition types.hpp:123
@ signedShort
Exif SSHORT type, a 16-bit (2-byte) signed (twos-complement) integer.
Definition types.hpp:127
@ signedLong
Exif SLONG type, a 32-bit (4-byte) signed (twos-complement) integer.
Definition types.hpp:128
@ comment
Exiv2 type for the Exif user comment.
Definition types.hpp:139
@ tiffDouble
TIFF DOUBLE type, double precision (8-byte) IEEE format.
Definition types.hpp:131
@ undefined
Exif UNDEFINED type, an 8-bit byte that may contain anything.
Definition types.hpp:126
@ xmpBag
XMP bag type.
Definition types.hpp:143
@ tiffFloat
TIFF FLOAT type, single precision (4-byte) IEEE format.
Definition types.hpp:130
@ unsignedRational
Exif RATIONAL type, two LONGs: numerator and denumerator of a fraction.
Definition types.hpp:124
long toData(byte *buf, T t, ByteOrder byteOrder)
Convert a value of type T to data, write the data to the data buffer.
EXIV2API uint16_t getUShort(const byte *buf, ByteOrder byteOrder)
Read a 2 byte unsigned short value from the data buffer.
Definition types.cpp:273
ValueType< int16_t > ShortValue
Signed short value type.
Definition value.hpp:1336
ValueType< float > FloatValue
Float value type.
Definition value.hpp:1342
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
TypeId getType< uint16_t >()
Specialization for an unsigned short.
Definition value.hpp:1211
ValueType< uint32_t > ULongValue
Unsigned long value type.
Definition value.hpp:1332
ValueType< Rational > RationalValue
Signed rational value type.
Definition value.hpp:1340
EXIV2API Rational getRational(const byte *buf, ByteOrder byteOrder)
Read an 8 byte signed rational value from the data buffer.
Definition types.cpp:335
EXIV2API long r2Data(byte *buf, Rational l, ByteOrder byteOrder)
Convert a signed rational to data, write the data to the buffer, return number of bytes written.
Definition types.cpp:457
TypeId getType< URational >()
Specialization for an unsigned rational.
Definition value.hpp:1215
TypeId getType< float >()
Specialization for a float.
Definition value.hpp:1223
EXIV2API long ur2Data(byte *buf, URational l, ByteOrder byteOrder)
Convert an unsigned rational to data, write the data to the buffer, return number of bytes written.
Definition types.cpp:420
EXIV2API int32_t getLong(const byte *buf, ByteOrder byteOrder)
Read a 4 byte signed long value from the data buffer.
Definition types.cpp:323
TypeId getType< Rational >()
Specialization for a signed rational.
Definition value.hpp:1221
TypeId getType< double >()
Specialization for a double.
Definition value.hpp:1225
EXIV2API long s2Data(byte *buf, int16_t s, ByteOrder byteOrder)
Convert a signed short to data, write the data to the buffer, return number of bytes written.
Definition types.cpp:427
std::string toString(const T &arg)
Utility function to convert the argument of any type to a string.
Definition types.hpp:510
std::pair< uint32_t, uint32_t > URational
8 byte unsigned rational type.
Definition types.hpp:97
TypeId getType()
Template to determine the TypeId for a type T.
EXIV2API URational getURational(const byte *buf, ByteOrder byteOrder)
Read an 8 byte unsigned rational value from the data buffer.
Definition types.cpp:306
ValueType< double > DoubleValue
Double value type.
Definition value.hpp:1344
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:390
Simple Date helper structure.
Definition value.hpp:994
int year
Year.
Definition value.hpp:996
int month
Month.
Definition value.hpp:997
int day
Day.
Definition value.hpp:998
LangAltValueComparator
Definition value.hpp:861
bool operator()(const std::string &str1, const std::string &str2) const
LangAltValueComparator comparison case insensitive function.
Definition value.hpp:863
Simple Time helper structure.
Definition value.hpp:1098
int minute
Minute.
Definition value.hpp:1102
int second
Second.
Definition value.hpp:1103
int hour
Hour.
Definition value.hpp:1101
int tzHour
Hours ahead or behind UTC.
Definition value.hpp:1104
int tzMinute
Minutes ahead or behind UTC.
Definition value.hpp:1105