7#include "exiv2lib_export.h"
66 virtual int read(
const std::string& buf) = 0;
79 virtual int setDataArea(
const byte* buf,
size_t len);
110 virtual size_t size()
const = 0;
117 virtual std::ostream&
write(std::ostream& os)
const = 0;
122 std::string toString()
const;
129 virtual std::string toString(
size_t n)
const;
137 virtual int64_t
toInt64(
size_t n = 0)
const = 0;
153 virtual float toFloat(
size_t n = 0)
const = 0;
163 virtual size_t sizeDataArea()
const;
176 virtual DataBuf dataArea()
const;
222 static UniquePtr create(
TypeId typeId);
232 mutable bool ok_{
true};
236 virtual Value* clone_()
const = 0;
243 return value.
write(os);
258 int read(
const byte* buf,
size_t len,
ByteOrder byteOrder = invalidByteOrder)
override;
260 int read(
const std::string& buf)
override;
281 size_t copy(
byte* buf,
ByteOrder byteOrder = invalidByteOrder)
const override;
282 size_t count()
const override;
283 size_t size()
const override;
284 std::ostream& write(std::ostream& os)
const override;
290 std::string toString(
size_t n)
const override;
291 int64_t toInt64(
size_t n = 0)
const override;
292 uint32_t toUint32(
size_t n = 0)
const override;
293 float toFloat(
size_t n = 0)
const override;
294 Rational toRational(
size_t n = 0)
const override;
330 int read(
const std::string& buf)
override;
331 int read(
const byte* buf,
size_t len,
ByteOrder byteOrder = invalidByteOrder)
override;
352 size_t copy(
byte* buf,
ByteOrder byteOrder = invalidByteOrder)
const override;
353 size_t count()
const override;
354 size_t size()
const override;
355 int64_t toInt64(
size_t n = 0)
const override;
356 uint32_t toUint32(
size_t n = 0)
const override;
357 float toFloat(
size_t n = 0)
const override;
358 Rational toRational(
size_t n = 0)
const override;
359 std::ostream& write(std::ostream& os)
const override;
426 using StringValueBase::read;
432 int read(
const std::string& buf)
override;
445 std::ostream& write(std::ostream& os)
const override;
477 static const char* name(
CharsetId charsetId);
479 static const char* code(
CharsetId charsetId);
481 static CharsetId charsetIdByName(
const std::string& name);
483 static CharsetId charsetIdByCode(
const std::string& code);
514 int read(
const std::string& comment)
override;
515 int read(
const byte* buf,
size_t len,
ByteOrder byteOrder)
override;
523 size_t copy(
byte* buf,
ByteOrder byteOrder)
const override;
528 std::ostream& write(std::ostream& os)
const override;
543 std::string
comment(
const char* encoding =
nullptr)
const;
553 const char* detectCharset(std::string& c)
const;
555 CharsetId charsetId()
const;
586 XmpArrayType xmpArrayType()
const;
588 XmpStruct xmpStruct()
const;
589 size_t size()
const override;
603 size_t copy(
byte* buf,
ByteOrder byteOrder = invalidByteOrder)
const override;
609 void setXmpArrayType(XmpArrayType xmpArrayType);
611 void setXmpStruct(XmpStruct xmpStruct = xsStruct);
614 int read(
const byte* buf,
size_t len,
ByteOrder byteOrder = invalidByteOrder)
override;
615 int read(
const std::string& buf)
override = 0;
627 XmpStruct xmpStruct_{xsNone};
653 using XmpValue::read;
669 int read(
const std::string& buf)
override;
675 size_t size()
const override;
676 size_t count()
const override;
683 int64_t toInt64(
size_t n = 0)
const override;
690 uint32_t toUint32(
size_t n = 0)
const override;
697 float toFloat(
size_t n = 0)
const override;
704 Rational toRational(
size_t n = 0)
const override;
705 std::ostream& write(std::ostream& os)
const override;
740 using XmpValue::read;
751 int read(
const std::string& buf)
override;
757 size_t count()
const override;
763 std::string toString(
size_t n)
const override;
764 int64_t toInt64(
size_t n = 0)
const override;
765 uint32_t toUint32(
size_t n = 0)
const override;
766 float toFloat(
size_t n = 0)
const override;
767 Rational toRational(
size_t n = 0)
const override;
774 std::ostream& write(std::ostream& os)
const override;
781 std::vector<std::string> value_;
794 bool operator()(
const std::string& str1,
const std::string& str2)
const {
795 int result = str1.size() < str2.size() ? 1 : str1.size() > str2.size() ? -1 : 0;
797 for (
auto c1 = str1.begin(), c2 = str2.begin(); result == 0 && c1 != str1.end(); ++c1, ++c2) {
798 result = tolower(*c1) < tolower(*c2) ? 1 : tolower(*c1) > tolower(*c2) ? -1 : 0;
826 using XmpValue::read;
844 int read(
const std::string& buf)
override;
850 size_t count()
const override;
858 std::string toString(
size_t n)
const override;
864 std::string toString(
const std::string& qualifier)
const;
865 int64_t toInt64(
size_t n = 0)
const override;
866 uint32_t toUint32(
size_t n = 0)
const override;
867 float toFloat(
size_t n = 0)
const override;
868 Rational toRational(
size_t n = 0)
const override;
875 std::ostream& write(std::ostream& os)
const override;
884 using ValueType = std::map<std::string, std::string, LangAltValueComparator>;
910 DateValue(int32_t year, int32_t month, int32_t day);
925 int read(
const byte* buf,
size_t len,
ByteOrder byteOrder = invalidByteOrder)
override;
934 int read(
const std::string& buf)
override;
936 void setDate(
const Date& src);
957 size_t copy(
byte* buf,
ByteOrder byteOrder = invalidByteOrder)
const override;
960 virtual const Date& getDate()
const;
961 size_t count()
const override;
962 size_t size()
const override;
963 std::ostream& write(std::ostream& os)
const override;
965 int64_t toInt64(
size_t n = 0)
const override;
967 uint32_t toUint32(
size_t n = 0)
const override;
969 float toFloat(
size_t n = 0)
const override;
971 Rational toRational(
size_t n = 0)
const override;
1001 TimeValue(int32_t hour, int32_t minute, int32_t second = 0, int32_t tzHour = 0, int32_t tzMinute = 0);
1018 int read(
const byte* buf,
size_t len,
ByteOrder byteOrder = invalidByteOrder)
override;
1027 int read(
const std::string& buf)
override;
1029 void setTime(
const Time& src);
1050 size_t copy(
byte* buf,
ByteOrder byteOrder = invalidByteOrder)
const override;
1052 virtual const Time& getTime()
const;
1053 size_t count()
const override;
1054 size_t size()
const override;
1055 std::ostream& write(std::ostream& os)
const override;
1057 int64_t toInt64(
size_t n = 0)
const override;
1059 uint32_t toUint32(
size_t n = 0)
const override;
1061 float toFloat(
size_t n = 0)
const override;
1063 Rational toRational(
size_t n = 0)
const override;
1079template <
typename T>
1130template <
typename T>
1156 int read(
const byte* buf,
size_t len,
ByteOrder byteOrder)
override;
1163 int read(
const std::string& buf)
override;
1168 int setDataArea(
const byte* buf,
size_t len)
override;
1177 size_t count()
const override;
1178 size_t size()
const override;
1179 std::ostream&
write(std::ostream& os)
const override;
1186 std::string
toString(
size_t n)
const override;
1187 int64_t
toInt64(
size_t n = 0)
const override;
1188 uint32_t
toUint32(
size_t n = 0)
const override;
1189 float toFloat(
size_t n = 0)
const override;
1218 template <
typename I>
1219 inline I float_to_integer_helper(
size_t n)
const {
1220 const auto v =
value_.at(n);
1221 if (
static_cast<decltype(v)
>(std::numeric_limits<I>::min()) <= v &&
1222 v <=
static_cast<decltype(v)
>(std::numeric_limits<I>::max())) {
1223 return static_cast<I
>(std::lround(v));
1229 template <
typename I>
1230 inline I rational_to_integer_helper(
size_t n)
const {
1231 auto a =
value_.at(n).first;
1232 auto b =
value_.at(n).second;
1240#ifdef __cpp_if_constexpr
1241 if constexpr (std::is_signed_v<I> == std::is_signed_v<
decltype(a)>) {
1243 if (std::is_signed<I>::value == std::is_signed<
decltype(a)>::value) {
1246 const auto imin = std::numeric_limits<I>::min();
1247 const auto imax = std::numeric_limits<I>::max();
1248 if (imax < b || a < imin || imax < a) {
1251#ifdef __cpp_if_constexpr
1252 }
else if constexpr (std::is_signed_v<I>) {
1254 }
else if (std::is_signed<I>::value) {
1257#if __cplusplus >= 201402L || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201402L))
1258 const auto imax =
static_cast<std::make_unsigned_t<I>
>(std::numeric_limits<I>::max());
1260 const auto imax =
static_cast<typename std::make_unsigned<I>::type
>(std::numeric_limits<I>::max());
1262 if (imax < b || imax < a) {
1267 const auto imax = std::numeric_limits<I>::max();
1272#if __cplusplus >= 201402L || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201402L))
1273 const auto a_u =
static_cast<std::make_unsigned_t<decltype(a)
>>(a);
1274 const auto b_u =
static_cast<std::make_unsigned_t<decltype(b)
>>(b);
1276 const auto a_u =
static_cast<typename std::make_unsigned<decltype(a)
>::type>(a);
1277 const auto b_u =
static_cast<typename std::make_unsigned<decltype(b)
>::type>(b);
1279 if (imax < b_u || imax < a_u) {
1284 return static_cast<I
>(a) /
static_cast<I
>(b);
1288 ValueType<T>* clone_()
const override;
1292 byte* pDataArea_{
nullptr};
1294 size_t sizeDataArea_{0};
1328template <
typename T>
1353 return getLong(buf, byteOrder);
1383template <
typename T>
1391 return us2Data(buf, t, byteOrder);
1399 return ul2Data(buf, t, byteOrder);
1407 return ur2Data(buf, t, byteOrder);
1415 return s2Data(buf, t, byteOrder);
1423 return l2Data(buf, t, byteOrder);
1431 return r2Data(buf, t, byteOrder);
1439 return f2Data(buf, t, byteOrder);
1447 return d2Data(buf, t, byteOrder);
1450template <
typename T>
1454template <
typename T>
1456 read(buf, len, byteOrder);
1459template <
typename T>
1464template <
typename T>
1466 Value(rhs.typeId()),
1470 if (rhs.sizeDataArea_ > 0) {
1471 pDataArea_ =
new byte[rhs.sizeDataArea_];
1472 std::memcpy(pDataArea_, rhs.pDataArea_, rhs.sizeDataArea_);
1473 sizeDataArea_ = rhs.sizeDataArea_;
1477template <
typename T>
1479 delete[] pDataArea_;
1482template <
typename T>
1489 byte* tmp =
nullptr;
1490 if (rhs.sizeDataArea_ > 0) {
1491 tmp =
new byte[rhs.sizeDataArea_];
1492 std::memcpy(tmp, rhs.pDataArea_, rhs.sizeDataArea_);
1494 delete[] pDataArea_;
1496 sizeDataArea_ = rhs.sizeDataArea_;
1501template <
typename T>
1505 if (ts > 0 && len % ts != 0)
1506 len = (len / ts) * ts;
1507 for (
size_t i = 0; i < len; i += ts) {
1508 value_.push_back(getValue<T>(buf + i, byteOrder));
1513template <
typename T>
1515 std::istringstream is(buf);
1518 while (!(is.eof())) {
1528template <
typename T>
1531 for (
auto i = value_.begin(); i != value_.end(); ++i) {
1532 offset +=
toData(buf + offset, *i, byteOrder);
1537template <
typename T>
1539 return value_.size();
1542template <
typename T>
1547template <
typename T>
1552template <
typename T>
1554 auto end = value_.end();
1555 auto i = value_.begin();
1557 os << std::setprecision(15) << *i;
1564template <
typename T>
1567 return Exiv2::toString<T>(value_.at(n));
1571template <
typename T>
1574 return static_cast<int64_t
>(value_.at(n));
1576template <
typename T>
1579 return static_cast<uint32_t
>(value_.at(n));
1582#define LARGE_INT 1000000
1586 return float_to_integer_helper<int64_t>(n);
1591 return float_to_integer_helper<uint32_t>(n);
1596 return float_to_integer_helper<int64_t>(n);
1600 return float_to_integer_helper<uint32_t>(n);
1605 return rational_to_integer_helper<int64_t>(n);
1609 return rational_to_integer_helper<uint32_t>(n);
1614 return rational_to_integer_helper<int64_t>(n);
1618 return rational_to_integer_helper<uint32_t>(n);
1621template <
typename T>
1624 return static_cast<float>(value_.at(n));
1629 ok_ = (value_.at(n).second != 0);
1632 return static_cast<float>(value_.at(n).first) / value_.at(n).second;
1637 ok_ = (value_.at(n).second != 0);
1640 return static_cast<float>(value_.at(n).first) / value_.at(n).second;
1643template <
typename T>
1646 return {value_.at(n), 1};
1652 return {value_.at(n).first, value_.at(n).second};
1658 return {value_.at(n).first, value_.at(n).second};
1675template <
typename T>
1677 return sizeDataArea_;
1680template <
typename T>
1682 return {pDataArea_, sizeDataArea_};
1685template <
typename T>
1687 byte* tmp =
nullptr;
1689 tmp =
new byte[len];
1690 std::memcpy(tmp, buf, len);
1692 delete[] pDataArea_;
1694 sizeDataArea_ = len;
Value for an Ascii string type.
Definition value.hpp:411
std::unique_ptr< AsciiValue > UniquePtr
Shortcut for a AsciiValue auto pointer.
Definition value.hpp:414
Value for an undefined data type.
Definition value.hpp:247
std::unique_ptr< DataValue > UniquePtr
Shortcut for a DataValue auto pointer.
Definition value.hpp:250
Value for simple ISO 8601 dates
Definition value.hpp:900
std::unique_ptr< DateValue > UniquePtr
Shortcut for a DateValue auto pointer.
Definition value.hpp:903
Value type for XMP language alternative properties.
Definition value.hpp:811
std::map< std::string, std::string, LangAltValueComparator > ValueType
Type used to store language alternative arrays.
Definition value.hpp:884
std::unique_ptr< LangAltValue > UniquePtr
Shortcut for a LangAltValue auto pointer.
Definition value.hpp:814
ValueType value_
Map to store the language alternative values. The language qualifier is used as the key for the map e...
Definition value.hpp:890
Abstract base class for a string based Value type.
Definition value.hpp:314
StringValueBase * clone_() const override=0
Internal virtual copy constructor.
std::unique_ptr< StringValueBase > UniquePtr
Shortcut for a StringValueBase auto pointer.
Definition value.hpp:319
std::string value_
Stores the string value.
Definition value.hpp:368
Value for string type.
Definition value.hpp:379
std::unique_ptr< StringValue > UniquePtr
Shortcut for a StringValue auto pointer.
Definition value.hpp:382
Value for simple ISO 8601 times.
Definition value.hpp:991
std::unique_ptr< TimeValue > UniquePtr
Shortcut for a TimeValue auto pointer.
Definition value.hpp:994
static size_t typeSize(TypeId typeId)
Return the size in bytes of one element of this type.
Definition types.cpp:83
Template for a Value of a basic type. This is used for unsigned and signed short, long and rationals.
Definition value.hpp:1131
float toFloat(size_t n=0) const override
Convert the n-th component of the value to a float. The behaviour of this method may be undefined if ...
Definition value.hpp:1622
ValueType< T > & operator=(const ValueType< T > &rhs)
Assignment operator.
Definition value.hpp:1483
typename std::vector< T >::const_iterator const_iterator
Const iterator type defined for convenience.
Definition value.hpp:1205
std::unique_ptr< ValueType< T > > UniquePtr
Shortcut for a ValueType<T> auto pointer.
Definition value.hpp:1136
Rational toRational(size_t n=0) const override
Convert the n-th component of the value to a Rational. The behaviour of this method may be undefined ...
Definition value.hpp:1644
DataBuf dataArea() const override
Return a copy of the data area in a DataBuf. The caller owns this copy and DataBuf ensures that it wi...
Definition value.hpp:1681
std::vector< T > ValueList
Container for values.
Definition value.hpp:1201
size_t count() const override
Return the number of components of the value.
Definition value.hpp:1538
ValueType()
Default Constructor.
Definition value.hpp:1451
~ValueType() override
Virtual destructor.
Definition value.hpp:1478
size_t size() const override
Return the size of the value in bytes.
Definition value.hpp:1543
uint32_t toUint32(size_t n=0) const override
Convert the n-th component of the value to a float. The behaviour of this method may be undefined if ...
Definition value.hpp:1577
int setDataArea(const byte *buf, size_t len) override
Set the data area. This method copies (clones) the buffer pointed to by buf.
Definition value.hpp:1686
size_t copy(byte *buf, ByteOrder byteOrder) const override
Write value to a data buffer.
Definition value.hpp:1529
size_t sizeDataArea() const override
Return the size of the data area.
Definition value.hpp:1676
typename std::vector< T >::iterator iterator
Iterator type defined for convenience.
Definition value.hpp:1203
ValueList value_
The container for all values. In your application, if you know what subclass of Value you're dealing ...
Definition value.hpp:1214
std::ostream & write(std::ostream &os) const override
Write the value to an output stream. You do not usually have to use this function; it is used for the...
Definition value.hpp:1553
int read(const byte *buf, size_t len, ByteOrder byteOrder) override
Read the value from a character buffer.
Definition value.hpp:1502
int64_t toInt64(size_t n=0) const override
Convert the n-th component of the value to an int64_t. The behaviour of this method may be undefined ...
Definition value.hpp:1572
Common interface for all types of values used with metadata.
Definition value.hpp:33
TypeId typeId() const
Return the type identifier (Exif data format type).
Definition value.hpp:85
virtual ~Value()=default
Virtual destructor.
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...
virtual size_t count() const =0
Return the number of components of the value.
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 int read(const byte *buf, size_t len, ByteOrder byteOrder)=0
Read the value from a character buffer.
bool ok() const
Check the ok status indicator. After a to<Type> conversion, this indicator shows whether the conversi...
Definition value.hpp:181
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:72
virtual float toFloat(size_t 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 Rational toRational(size_t n=0) const =0
Convert the n-th component of the value to a Rational. The behaviour of this method may be undefined ...
virtual uint32_t toUint32(size_t 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 size_t size() const =0
Return the size of the value in bytes.
virtual size_t copy(byte *buf, ByteOrder byteOrder) const =0
Write value to a data buffer.
Value(TypeId typeId)
Constructor, taking a type id to initialize the base class with.
Definition value.cpp:17
virtual int64_t toInt64(size_t n=0) const =0
Convert the n-th component of the value to an int64_t. The behaviour of this method may be undefined ...
Value & operator=(const Value &)=default
Assignment operator. Protected so that it can only be used by subclasses but not directly.
std::unique_ptr< Value > UniquePtr
Shortcut for a Value auto pointer.
Definition value.hpp:36
UniquePtr 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:93
Value type for simple arrays. Each item in the array is a simple value, without qualifiers....
Definition value.hpp:727
std::unique_ptr< XmpArrayValue > UniquePtr
Shortcut for a XmpArrayValue auto pointer.
Definition value.hpp:730
Value type suitable for simple XMP properties and XMP nodes of complex types which are not parsed int...
Definition value.hpp:638
std::unique_ptr< XmpTextValue > UniquePtr
Shortcut for a XmpTextValue auto pointer.
Definition value.hpp:641
std::string value_
Stores the string values.
Definition value.hpp:714
Base class for all Exiv2 values used to store XMP property values.
Definition value.hpp:571
int read(const std::string &buf) override=0
Set the value from a string buffer. The format of the string corresponds to that of the write() metho...
XmpStruct
XMP structure indicator.
Definition value.hpp:581
std::unique_ptr< XmpValue > UniquePtr
Shortcut for a XmpValue auto pointer.
Definition value.hpp:576
XmpArrayType
XMP array types.
Definition value.hpp:579
Class CrwImage to access Canon CRW images. References: The Canon RAW (CRW) File Format by Phil Harv...
Definition asfvideo.hpp:15
std::pair< int32_t, int32_t > Rational
8 byte signed rational type.
Definition types.hpp:31
EXIV2API std::ostream & operator<<(std::ostream &os, const DataSet &dataSet)
Output operator for dataSet.
Definition datasets.cpp:590
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:308
TypeId getType< int32_t >()
Specialization for a signed long.
Definition value.hpp:1104
EXIV2API size_t 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:342
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:296
TypeId getType< int16_t >()
Specialization for a signed short.
Definition value.hpp:1099
size_t toData(byte *buf, T t, ByteOrder byteOrder)
Convert a value of type T to data, write the data to the data buffer.
EXIV2API size_t 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:422
EXIV2API Rational floatToRationalCast(float f)
Very simple conversion of a float to a Rational.
Definition types.cpp:607
EXIV2API size_t 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:410
EXIV2API int16_t getShort(const byte *buf, ByteOrder byteOrder)
Read a 2 byte signed short value from the data buffer.
Definition types.cpp:276
TypeId getType< uint32_t >()
Specialization for an unsigned long.
Definition value.hpp:1089
EXIV2API uint32_t getULong(const byte *buf, ByteOrder byteOrder)
Read a 4 byte unsigned long value from the data buffer.
Definition types.cpp:250
T getValue(const byte *buf, ByteOrder byteOrder)
Read a value of type T from the data buffer.
std::pair< uint32_t, uint32_t > URational
8 byte unsigned rational type.
Definition types.hpp:29
TypeId
Exiv2 value type identifiers.
Definition types.hpp:70
@ unsignedShort
Exif SHORT type, 16-bit (2-byte) unsigned integer.
Definition types.hpp:73
@ signedRational
Exif SRATIONAL type, two SLONGs: numerator and denominator of a fraction.
Definition types.hpp:80
@ unsignedLong
Exif LONG type, 32-bit (4-byte) unsigned integer.
Definition types.hpp:74
@ signedShort
Exif SSHORT type, a 16-bit (2-byte) signed (twos-complement) integer.
Definition types.hpp:78
@ signedLong
Exif SLONG type, a 32-bit (4-byte) signed (twos-complement) integer.
Definition types.hpp:79
@ comment
Exiv2 type for the Exif user comment.
Definition types.hpp:90
@ tiffDouble
TIFF DOUBLE type, double precision (8-byte) IEEE format.
Definition types.hpp:82
@ undefined
Exif UNDEFINED type, an 8-bit byte that may contain anything.
Definition types.hpp:77
@ tiffFloat
TIFF FLOAT type, single precision (4-byte) IEEE format.
Definition types.hpp:81
@ unsignedRational
Exif RATIONAL type, two LONGs: numerator and denominator of a fraction.
Definition types.hpp:75
EXIV2API uint16_t getUShort(const byte *buf, ByteOrder byteOrder)
Read a 2 byte unsigned short value from the data buffer.
Definition types.cpp:246
EXIV2API size_t 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:372
EXIV2API size_t 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:378
ByteOrder
Type to express the byte order (little or big endian)
Definition types.hpp:34
TypeId getType< uint16_t >()
Specialization for an unsigned short.
Definition value.hpp:1084
EXIV2API size_t 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:389
EXIV2API Rational getRational(const byte *buf, ByteOrder byteOrder)
Read an 8 byte signed rational value from the data buffer.
Definition types.cpp:290
EXIV2API size_t 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:404
TypeId getType< URational >()
Specialization for an unsigned rational.
Definition value.hpp:1094
TypeId getType< float >()
Specialization for a float.
Definition value.hpp:1114
EXIV2API int32_t getLong(const byte *buf, ByteOrder byteOrder)
Read a 4 byte signed long value from the data buffer.
Definition types.cpp:283
TypeId getType< Rational >()
Specialization for a signed rational.
Definition value.hpp:1109
TypeId getType< double >()
Specialization for a double.
Definition value.hpp:1119
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:270
EXIV2API size_t 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:331
Utility class containing a character array. All it does is to take care of memory allocation and dele...
Definition types.hpp:124
Simple Date helper structure.
Definition value.hpp:914
int32_t month
Month.
Definition value.hpp:916
int32_t day
Day.
Definition value.hpp:917
int32_t year
Year.
Definition value.hpp:915
LangAltValueComparator
Definition value.hpp:792
bool operator()(const std::string &str1, const std::string &str2) const
LangAltValueComparator comparison case insensitive function.
Definition value.hpp:794
Simple Time helper structure.
Definition value.hpp:1005
int32_t hour
Hour.
Definition value.hpp:1006
int32_t tzMinute
Minutes ahead or behind UTC.
Definition value.hpp:1010
int32_t minute
Minute.
Definition value.hpp:1007
int32_t second
Second.
Definition value.hpp:1008
int32_t tzHour
Hours ahead or behind UTC.
Definition value.hpp:1009