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;
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;
222 static UniquePtr create(
TypeId typeId);
236 virtual Value* clone_()
const = 0;
243 return value.
write(os);
247class EXIV2API DataValue :
public Value {
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;
331 int read(
const std::string& buf)
override;
332 int read(
const byte* buf,
size_t len,
ByteOrder byteOrder = invalidByteOrder)
override;
353 size_t copy(
byte* buf,
ByteOrder byteOrder = invalidByteOrder)
const override;
354 size_t count()
const override;
355 size_t size()
const override;
356 int64_t toInt64(
size_t n = 0)
const override;
357 uint32_t toUint32(
size_t n = 0)
const override;
358 float toFloat(
size_t n = 0)
const override;
359 Rational toRational(
size_t n = 0)
const override;
360 std::ostream& write(std::ostream& os)
const override;
433 int read(
const std::string& buf)
override;
446 std::ostream& write(std::ostream& os)
const override;
466 enum CharsetId { ascii, jis, unicode, undefined, invalidCharsetId, lastCharsetId };
516 int read(
const byte* buf,
size_t len,
ByteOrder byteOrder)
override;
524 size_t copy(
byte* buf,
ByteOrder byteOrder)
const override;
529 std::ostream& write(std::ostream& os)
const override;
544 std::string
comment(
const char* encoding =
nullptr)
const;
554 const char* detectCharset(std::string& c)
const;
556 CharsetId charsetId()
const;
587 XmpArrayType xmpArrayType()
const;
589 XmpStruct xmpStruct()
const;
590 size_t size()
const override;
604 size_t copy(
byte* buf,
ByteOrder byteOrder = invalidByteOrder)
const override;
610 void setXmpArrayType(XmpArrayType xmpArrayType);
612 void setXmpStruct(XmpStruct xmpStruct = xsStruct);
615 int read(
const byte* buf,
size_t len,
ByteOrder byteOrder = invalidByteOrder)
override;
616 int read(
const std::string& buf)
override = 0;
628 XmpStruct xmpStruct_{xsNone};
670 int read(
const std::string& buf)
override;
676 size_t size()
const override;
677 size_t count()
const override;
684 int64_t
toInt64(
size_t n = 0)
const override;
691 uint32_t
toUint32(
size_t n = 0)
const override;
698 float toFloat(
size_t n = 0)
const override;
706 std::ostream&
write(std::ostream& os)
const override;
752 int read(
const std::string& buf)
override;
758 size_t count()
const override;
764 std::string
toString(
size_t n)
const override;
765 int64_t
toInt64(
size_t n = 0)
const override;
766 uint32_t
toUint32(
size_t n = 0)
const override;
767 float toFloat(
size_t n = 0)
const override;
775 std::ostream&
write(std::ostream& os)
const override;
782 std::vector<std::string> value_;
795 bool operator()(
const std::string& str1,
const std::string& str2)
const {
796 int result = str1.size() < str2.size() ? 1 : str1.size() > str2.size() ? -1 : 0;
798 for (
auto c1 = str1.begin(), c2 = str2.begin(); result == 0 && c1 != str1.end(); ++c1, ++c2) {
799 result = tolower(*c1) < tolower(*c2) ? 1 : tolower(*c1) > tolower(*c2) ? -1 : 0;
845 int read(
const std::string& buf)
override;
851 size_t count()
const override;
859 std::string
toString(
size_t n)
const override;
865 std::string
toString(
const std::string& qualifier)
const;
866 int64_t
toInt64(
size_t n = 0)
const override;
867 uint32_t
toUint32(
size_t n = 0)
const override;
868 float toFloat(
size_t n = 0)
const override;
876 std::ostream&
write(std::ostream& os)
const override;
885 using ValueType = std::map<std::string, std::string, LangAltValueComparator>;
911 DateValue(int32_t year, int32_t month, int32_t day);
926 int read(
const byte* buf,
size_t len,
ByteOrder byteOrder = invalidByteOrder)
override;
935 int read(
const std::string& buf)
override;
958 size_t copy(
byte* buf,
ByteOrder byteOrder = invalidByteOrder)
const override;
961 virtual const Date& getDate()
const;
962 size_t count()
const override;
963 size_t size()
const override;
964 std::ostream& write(std::ostream& os)
const override;
966 int64_t toInt64(
size_t n = 0)
const override;
968 uint32_t toUint32(
size_t n = 0)
const override;
970 float toFloat(
size_t n = 0)
const override;
972 Rational toRational(
size_t n = 0)
const override;
1002 TimeValue(int32_t hour, int32_t minute, int32_t second = 0, int32_t tzHour = 0, int32_t tzMinute = 0);
1019 int read(
const byte* buf,
size_t len,
ByteOrder byteOrder = invalidByteOrder)
override;
1028 int read(
const std::string& buf)
override;
1051 size_t copy(
byte* buf,
ByteOrder byteOrder = invalidByteOrder)
const override;
1053 virtual const Time& getTime()
const;
1054 size_t count()
const override;
1055 size_t size()
const override;
1056 std::ostream& write(std::ostream& os)
const override;
1058 int64_t toInt64(
size_t n = 0)
const override;
1060 uint32_t toUint32(
size_t n = 0)
const override;
1062 float toFloat(
size_t n = 0)
const override;
1064 Rational toRational(
size_t n = 0)
const override;
1080template <
typename T>
1131template <
typename T>
1164 int read(
const std::string& buf)
override;
1180 std::ostream&
write(std::ostream& os)
const override;
1219 template <
typename I>
1220 inline I float_to_integer_helper(
size_t n)
const {
1221 const auto v =
value_.at(n);
1222 if (
static_cast<decltype(v)
>(std::numeric_limits<I>::min()) <= v &&
1223 v <=
static_cast<decltype(v)
>(std::numeric_limits<I>::max())) {
1224 return static_cast<I
>(std::lround(v));
1230 template <
typename I>
1231 inline I rational_to_integer_helper(
size_t n)
const {
1232 auto a =
value_.at(n).first;
1233 auto b =
value_.at(n).second;
1241#ifdef __cpp_if_constexpr
1242 if constexpr (std::is_signed_v<I> == std::is_signed_v<
decltype(a)>) {
1244 if (std::is_signed<I>::value == std::is_signed<
decltype(a)>::value) {
1247 const auto imin = std::numeric_limits<I>::min();
1248 const auto imax = std::numeric_limits<I>::max();
1249 if (imax < b || a < imin || imax < a) {
1252#ifdef __cpp_if_constexpr
1253 }
else if constexpr (std::is_signed_v<I>) {
1255 }
else if (std::is_signed<I>::value) {
1258#if __cplusplus >= 201402L || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201402L))
1259 const auto imax =
static_cast<std::make_unsigned_t<I>
>(std::numeric_limits<I>::max());
1261 const auto imax =
static_cast<typename std::make_unsigned<I>::type
>(std::numeric_limits<I>::max());
1263 if (imax < b || imax < a) {
1268 const auto imax = std::numeric_limits<I>::max();
1273#if __cplusplus >= 201402L || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201402L))
1274 const auto a_u =
static_cast<std::make_unsigned_t<decltype(a)
>>(a);
1275 const auto b_u =
static_cast<std::make_unsigned_t<decltype(b)
>>(b);
1277 const auto a_u =
static_cast<typename std::make_unsigned<decltype(a)
>::type>(a);
1278 const auto b_u =
static_cast<typename std::make_unsigned<decltype(b)
>::type>(b);
1280 if (imax < b_u || imax < a_u) {
1285 return static_cast<I
>(a) /
static_cast<I
>(b);
1293 byte* pDataArea_{
nullptr};
1295 size_t sizeDataArea_{0};
1329template <
typename T>
1354 return getLong(buf, byteOrder);
1384template <
typename T>
1392 return us2Data(buf, t, byteOrder);
1400 return ul2Data(buf, t, byteOrder);
1408 return ur2Data(buf, t, byteOrder);
1416 return s2Data(buf, t, byteOrder);
1424 return l2Data(buf, t, byteOrder);
1432 return r2Data(buf, t, byteOrder);
1440 return f2Data(buf, t, byteOrder);
1448 return d2Data(buf, t, byteOrder);
1451template <
typename T>
1455template <
typename T>
1457 read(buf, len, byteOrder);
1460template <
typename T>
1465template <
typename T>
1471 if (rhs.sizeDataArea_ > 0) {
1472 pDataArea_ = new byte[rhs.sizeDataArea_];
1473 std::memcpy(pDataArea_, rhs.pDataArea_, rhs.sizeDataArea_);
1474 sizeDataArea_ = rhs.sizeDataArea_;
1478template <
typename T>
1480 delete[] pDataArea_;
1483template <
typename T>
1490 byte* tmp =
nullptr;
1491 if (rhs.sizeDataArea_ > 0) {
1492 tmp =
new byte[rhs.sizeDataArea_];
1493 std::memcpy(tmp, rhs.pDataArea_, rhs.sizeDataArea_);
1495 delete[] pDataArea_;
1497 sizeDataArea_ = rhs.sizeDataArea_;
1502template <
typename T>
1506 if (ts > 0 && len % ts != 0)
1507 len = (len / ts) * ts;
1508 for (
size_t i = 0; i < len; i += ts) {
1514template <
typename T>
1516 std::istringstream is(buf);
1519 while (!(is.eof())) {
1529template <
typename T>
1532 for (
auto i =
value_.begin(); i !=
value_.end(); ++i) {
1533 offset +=
toData(buf + offset, *i, byteOrder);
1538template <
typename T>
1543template <
typename T>
1548template <
typename T>
1553template <
typename T>
1558 os << std::setprecision(15) << *i;
1565template <
typename T>
1568 return Exiv2::toString<T>(
value_.at(n));
1572template <
typename T>
1575 return static_cast<int64_t
>(
value_.at(n));
1577template <
typename T>
1580 return static_cast<uint32_t
>(
value_.at(n));
1583#define LARGE_INT 1000000
1587 return float_to_integer_helper<int64_t>(n);
1592 return float_to_integer_helper<uint32_t>(n);
1597 return float_to_integer_helper<int64_t>(n);
1601 return float_to_integer_helper<uint32_t>(n);
1606 return rational_to_integer_helper<int64_t>(n);
1610 return rational_to_integer_helper<uint32_t>(n);
1615 return rational_to_integer_helper<int64_t>(n);
1619 return rational_to_integer_helper<uint32_t>(n);
1622template <
typename T>
1625 return static_cast<float>(
value_.at(n));
1633 return static_cast<float>(
value_.at(n).first) /
value_.at(n).second;
1641 return static_cast<float>(
value_.at(n).first) /
value_.at(n).second;
1644template <
typename T>
1647 return {
value_.at(n), 1};
1676template <
typename T>
1678 return sizeDataArea_;
1681template <
typename T>
1683 return {pDataArea_, sizeDataArea_};
1686template <
typename T>
1688 byte* tmp =
nullptr;
1690 tmp =
new byte[len];
1691 std::memcpy(tmp, buf, len);
1693 delete[] pDataArea_;
1695 sizeDataArea_ = len;
Value for an Ascii string type.
Definition value.hpp:412
AsciiValue()
Default constructor.
Definition value.cpp:237
std::unique_ptr< AsciiValue > UniquePtr
Shortcut for a AsciiValue auto pointer.
Definition value.hpp:415
int read(const std::string &buf) override
Set the value to that of the string buf. Overrides base class to append a terminating '\0' character ...
Definition value.cpp:243
Value for an undefined data type.
Definition value.hpp:247
ValueType value_
Stores the data value.
Definition value.hpp:305
std::vector< byte > ValueType
Type used to store the data.
Definition value.hpp:303
std::unique_ptr< DataValue > UniquePtr
Shortcut for a DataValue auto pointer.
Definition value.hpp:250
int read(const byte *buf, size_t len, ByteOrder byteOrder=invalidByteOrder) override
Read the value from a character buffer.
Definition value.cpp:102
Value for simple ISO 8601 dates
Definition value.hpp:901
std::unique_ptr< DateValue > UniquePtr
Shortcut for a DateValue auto pointer.
Definition value.hpp:904
DateValue()
Default constructor.
Definition value.cpp:746
int read(const byte *buf, size_t len, ByteOrder byteOrder=invalidByteOrder) override
Definition value.cpp:754
void setDate(const Date &src)
Set the date.
Definition value.cpp:813
std::string toString(size_t n) const override
Return the text value associated with the default language qualifier x-default. The parameter n is no...
Definition value.cpp:709
std::map< std::string, std::string, LangAltValueComparator > ValueType
Type used to store language alternative arrays.
Definition value.hpp:885
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.cpp:732
size_t count() const override
Return the number of components of the value.
Definition value.cpp:684
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.cpp:727
std::unique_ptr< LangAltValue > UniquePtr
Shortcut for a LangAltValue auto pointer.
Definition value.hpp:815
LangAltValue()
Constructor.
Definition value.cpp:630
int read(const std::string &buf) override
Read a simple property value from buf and append it to the value.
Definition value.cpp:637
ValueType value_
Map to store the language alternative values. The language qualifier is used as the key for the map e...
Definition value.hpp:891
std::ostream & write(std::ostream &os) const override
Write all elements of the value to os, separated by commas.
Definition value.cpp:688
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.cpp:722
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.cpp:737
StringValueBase * clone_() const override=0
Internal virtual copy constructor.
std::unique_ptr< StringValueBase > UniquePtr
Shortcut for a StringValueBase auto pointer.
Definition value.hpp:320
std::string value_
Stores the string value.
Definition value.hpp:369
StringValueBase(TypeId typeId, const std::string &buf)
Constructor for subclasses.
Definition value.cpp:172
int read(const std::string &buf) override
Read the value from buf. This default implementation uses buf as it is.
Definition value.cpp:176
Value for string type.
Definition value.hpp:380
std::unique_ptr< StringValue > UniquePtr
Shortcut for a StringValue auto pointer.
Definition value.hpp:383
StringValue()
Default constructor.
Definition value.cpp:227
Value for simple ISO 8601 times.
Definition value.hpp:992
int read(const byte *buf, size_t len, ByteOrder byteOrder=invalidByteOrder) override
Definition value.cpp:895
std::unique_ptr< TimeValue > UniquePtr
Shortcut for a TimeValue auto pointer.
Definition value.hpp:995
void setTime(const Time &src)
Set the time.
Definition value.cpp:985
TimeValue()
Default constructor.
Definition value.cpp:887
static size_t typeSize(TypeId typeId)
Return the size in bytes of one element of this type.
Definition types.cpp:87
Template for a Value of a basic type. This is used for unsigned and signed short, long and rationals.
Definition value.hpp:1132
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:1623
std::string toString(size_t n) const override
Return the n-th component of the value as a string. The behaviour of this method may be undefined if ...
Definition value.hpp:1566
ValueType< T > & operator=(const ValueType< T > &rhs)
Assignment operator.
Definition value.hpp:1484
typename std::vector< T >::const_iterator const_iterator
Const iterator type defined for convenience.
Definition value.hpp:1206
ValueType(const T &val, TypeId typeId=getType< T >())
Constructor.
Definition value.hpp:1461
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:1645
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:1682
std::vector< T > ValueList
Container for values.
Definition value.hpp:1202
size_t count() const override
Return the number of components of the value.
Definition value.hpp:1539
ValueType(const ValueType< T > &rhs)
Copy constructor.
Definition value.hpp:1466
ValueType(const byte *buf, size_t len, ByteOrder byteOrder, TypeId typeId=getType< T >())
Constructor.
Definition value.hpp:1456
ValueType()
Default Constructor.
Definition value.hpp:1452
~ValueType() override
Virtual destructor.
Definition value.hpp:1479
size_t size() const override
Return the size of the value in bytes.
Definition value.hpp:1544
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:1578
int read(const std::string &buf) override
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:1515
std::unique_ptr< ValueType< T > > UniquePtr
Shortcut for a ValueType<T> auto pointer.
Definition value.hpp:1137
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:1687
size_t copy(byte *buf, ByteOrder byteOrder) const override
Write value to a data buffer.
Definition value.hpp:1530
size_t sizeDataArea() const override
Return the size of the data area.
Definition value.hpp:1677
typename std::vector< T >::iterator iterator
Iterator type defined for convenience.
Definition value.hpp:1204
ValueList value_
Definition value.hpp:1215
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:1554
int read(const byte *buf, size_t len, ByteOrder byteOrder) override
Read the value from a character buffer.
Definition value.hpp:1503
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:1573
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_
Indicates the status of the previous to<Type> conversion.
Definition value.hpp:232
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.
virtual int setDataArea(const byte *buf, size_t len)
Set the data area, if the value has one by copying (cloning) the buffer pointed to by buf.
Definition value.cpp:68
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
virtual size_t sizeDataArea() const
Return the size of the data area, 0 if there is none.
Definition value.cpp:83
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:87
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
XmpArrayValue(TypeId typeId=xmpBag)
Constructor. typeId can be one of xmpBag, xmpSeq or xmpAlt.
Definition value.cpp:578
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.cpp:614
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.cpp:618
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.cpp:622
std::unique_ptr< XmpArrayValue > UniquePtr
Shortcut for a XmpArrayValue auto pointer.
Definition value.hpp:731
std::string toString(size_t n) const override
Return the n-th component of the value as a string. The behaviour of this method may be undefined if ...
Definition value.cpp:605
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.cpp:610
std::ostream & write(std::ostream &os) const override
Write all elements of the value to os, separated by commas.
Definition value.cpp:596
int read(const std::string &buf) override
Read a simple property value from buf and append it to the value.
Definition value.cpp:582
size_t count() const override
Return the number of components of the value.
Definition value.cpp:592
size_t count() const override
Return the number of components of the value.
Definition value.cpp:522
std::unique_ptr< XmpTextValue > UniquePtr
Shortcut for a XmpTextValue auto pointer.
Definition value.hpp:642
XmpTextValue()
Constructor.
Definition value.cpp:472
int read(const std::string &buf) override
Read a simple property value from buf to set the value.
Definition value.cpp:479
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.cpp:526
size_t size() const override
Return the size of the value in bytes.
Definition value.cpp:516
int64_t toInt64(size_t n=0) const override
Convert the value to an int64_t. The optional parameter n is not used and is ignored.
Definition value.cpp:558
float toFloat(size_t n=0) const override
Convert the value to a float. The optional parameter n is not used and is ignored.
Definition value.cpp:566
Rational toRational(size_t n=0) const override
Convert the value to a Rational. The optional parameter n is not used and is ignored.
Definition value.cpp:570
std::string value_
Stores the string values.
Definition value.hpp:715
uint32_t toUint32(size_t n=0) const override
Convert the value to an uint32_t. The optional parameter n is not used and is ignored.
Definition value.cpp:562
Base class for all Exiv2 values used to store XMP property values.
Definition value.hpp:572
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:582
std::unique_ptr< XmpValue > UniquePtr
Shortcut for a XmpValue auto pointer.
Definition value.hpp:577
XmpArrayType xmpArrayType() const
Return XMP array type, indicates if an XMP value is an array.
Definition value.cpp:426
XmpArrayType
XMP array types.
Definition value.hpp:580
int read(const byte *buf, size_t len, ByteOrder byteOrder=invalidByteOrder) override
Definition value.cpp:461
Class CrwImage to access Canon CRW images. References: The Canon RAW (CRW) File Format by Phil Harv...
Definition asfvideo.hpp:15
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:312
TypeId getType< int32_t >()
Specialization for a signed long.
Definition value.hpp:1105
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:346
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:300
TypeId getType< int16_t >()
Specialization for a signed short.
Definition value.hpp:1100
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:426
ValueType< int16_t > ShortValue
Signed short value type.
Definition value.hpp:1305
EXIV2API Rational floatToRationalCast(float f)
Very simple conversion of a float to a Rational.
Definition types.cpp:611
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:414
EXIV2API int16_t getShort(const byte *buf, ByteOrder byteOrder)
Read a 2 byte signed short value from the data buffer.
Definition types.cpp:280
ValueType< URational > URationalValue
Unsigned rational value type.
Definition value.hpp:1303
TypeId getType< uint32_t >()
Specialization for an unsigned long.
Definition value.hpp:1090
EXIV2API uint32_t getULong(const byte *buf, ByteOrder byteOrder)
Read a 4 byte unsigned long value from the data buffer.
Definition types.cpp:254
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: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
@ xmpBag
XMP bag type.
Definition types.hpp:94
@ 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
std::pair< int32_t, int32_t > Rational
8 byte signed rational type.
Definition types.hpp:31
EXIV2API uint16_t getUShort(const byte *buf, ByteOrder byteOrder)
Read a 2 byte unsigned short value from the data buffer.
Definition types.cpp:250
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:376
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:382
ValueType< float > FloatValue
Float value type.
Definition value.hpp:1311
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:1085
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:393
EXIV2API Rational getRational(const byte *buf, ByteOrder byteOrder)
Read an 8 byte signed rational value from the data buffer.
Definition types.cpp:294
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:408
ValueType< double > DoubleValue
Double value type.
Definition value.hpp:1313
TypeId getType< URational >()
Specialization for an unsigned rational.
Definition value.hpp:1095
TypeId getType< float >()
Specialization for a float.
Definition value.hpp:1115
ValueType< uint16_t > UShortValue
Unsigned short value type.
Definition value.hpp:1299
EXIV2API int32_t getLong(const byte *buf, ByteOrder byteOrder)
Read a 4 byte signed long value from the data buffer.
Definition types.cpp:287
TypeId getType< Rational >()
Specialization for a signed rational.
Definition value.hpp:1110
TypeId getType< double >()
Specialization for a double.
Definition value.hpp:1120
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:274
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:335
ValueType< Rational > RationalValue
Signed rational value type.
Definition value.hpp:1309
std::pair< uint32_t, uint32_t > URational
8 byte unsigned rational type.
Definition types.hpp:29
ValueType< uint32_t > ULongValue
Unsigned long value type.
Definition value.hpp:1301
ValueType< int32_t > LongValue
Signed long value type.
Definition value.hpp:1307
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:915
int32_t month
Month.
Definition value.hpp:917
int32_t day
Day.
Definition value.hpp:918
int32_t year
Year.
Definition value.hpp:916
LangAltValueComparator
Definition value.hpp:793
bool operator()(const std::string &str1, const std::string &str2) const
LangAltValueComparator comparison case insensitive function.
Definition value.hpp:795
Simple Time helper structure.
Definition value.hpp:1006
int32_t hour
Hour.
Definition value.hpp:1007
int32_t tzMinute
Minutes ahead or behind UTC.
Definition value.hpp:1011
int32_t minute
Minute.
Definition value.hpp:1008
int32_t second
Second.
Definition value.hpp:1009
int32_t tzHour
Hours ahead or behind UTC.
Definition value.hpp:1010