| Exiv2

Loading...
Searching...
No Matches
Public Types | List of all members
Exiv2::Value Class Referenceabstract

Common interface for all types of values used with metadata. More...

`#include <value.hpp>`

Inheritance diagram for Exiv2::Value:
[legend]

## Public Types
using | UniquePtr = std::unique_ptr<Value>
| Shortcut for a Value auto pointer.

## Public Member Functions
Creators
| Value (TypeId typeId)
| Constructor, taking a type id to initialize the base class with.
virtual | ~Value ()=default
| Virtual destructor.
Manipulators
virtual int | read (const byte *buf, size_t len, ByteOrder byteOrder)=0
| Read the value from a character buffer.
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() method, i.e., a string obtained through the write() method can be read by this function.
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.

## Accessors
bool | ok_ {true}
| Indicates the status of the previous to<Type> conversion.
TypeId | typeId () const
| Return the type identifier (Exif data format type).
UniquePtr | clone () const
| Return an auto-pointer to a copy of itself (deep copy). The caller owns this copy and the auto-pointer ensures that it will be deleted.
virtual size_t | copy (byte *buf, ByteOrder byteOrder) const =0
| Write value to a data buffer.
virtual size_t | count () const =0
| Return the number of components of the value.
virtual size_t | size () const =0
| Return the size of the value in bytes.
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 implementation of the output operator for Value, operator<<(std::ostream &os, const Value &value).
std::string | toString () const
| Return the value as a string. Implemented in terms of write(std::ostream& os) const of the concrete class.
virtual std::string | toString (size_t n) const
| Return the n-th component of the value as a string. The default implementation returns toString(). The behaviour of this method may be undefined if there is no n-th component.
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 if there is no n-th component.
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 there is no n-th component.
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 there is no n-th component.
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 if there is no n-th component.
virtual size_t | sizeDataArea () const
| Return the size of the data area, 0 if there is none.
virtual DataBuf | dataArea () const
| Return a copy of the data area if the value has one. The caller owns this copy and DataBuf ensures that it will be deleted.
bool | ok () const
| Check the ok status indicator. After a to<Type> conversion, this indicator shows whether the conversion was successful.
static UniquePtr | create (TypeId typeId)
| A (simple) factory to create a Value type.
| Value (const Value &)=default
Value & | operator= (const Value &)=default
| Assignment operator. Protected so that it can only be used by subclasses but not directly.

## Detailed Description

Common interface for all types of values used with metadata.

The interface provides a uniform way to access values independent of their actual C++ type for simple tasks like reading the values from a string or data buffer. For other tasks, like modifying values you may need to downcast it to a specific subclass to access its interface.

Examples
  xmpsample.cpp.

## Member Function Documentation

## ◆ copy()

virtual size_t Exiv2::Value::copy | ( | byte * | buf,
|  | ByteOrder | byteOrder ) const
| pure virtual

Write value to a data buffer.

The user must ensure that the buffer has enough memory. Otherwise the call results in undefined behaviour.

Parameters

  buf | Data buffer to write to.
  byteOrder | Applicable byte order (little or big endian).

Returns
  Number of bytes written.

Implemented in Exiv2::CommentValue, Exiv2::DataValue, Exiv2::DateValue, Exiv2::StringValueBase, Exiv2::TimeValue, Exiv2::ValueType< T >, Exiv2::ValueType< double >, Exiv2::ValueType< float >, Exiv2::ValueType< int16_t >, Exiv2::ValueType< int32_t >, Exiv2::ValueType< Rational >, Exiv2::ValueType< uint16_t >, Exiv2::ValueType< uint32_t >, Exiv2::ValueType< URational >, and Exiv2::XmpValue.

Referenced by Exiv2::Internal::printUcs2().

## ◆ count()

virtual size_t Exiv2::Value::count | ( |  | ) | const
| pure virtual

Return the number of components of the value.

Implemented in Exiv2::DataValue, Exiv2::DateValue, Exiv2::LangAltValue, Exiv2::StringValueBase, Exiv2::TimeValue, Exiv2::ValueType< T >, Exiv2::ValueType< double >, Exiv2::ValueType< float >, Exiv2::ValueType< int16_t >, Exiv2::ValueType< int32_t >, Exiv2::ValueType< Rational >, Exiv2::ValueType< uint16_t >, Exiv2::ValueType< uint32_t >, Exiv2::ValueType< URational >, Exiv2::XmpArrayValue, and Exiv2::XmpTextValue.

Referenced by Exiv2::Internal::TiffDecoder::decodeCanonAFInfo(), Exiv2::Internal::Nikon1MakerNote::print0x0002(), Exiv2::Internal::Nikon3MakerNote::print0x0002(), Exiv2::Internal::print0x0007(), Exiv2::Internal::PanasonicMakerNote::print0x000f(), Exiv2::Internal::Nikon3MakerNote::print0x0084(), Exiv2::Internal::Nikon1MakerNote::print0x0088(), Exiv2::Internal::Nikon3MakerNote::print0x0089(), Exiv2::Internal::Nikon3MakerNote::print0x009a(), Exiv2::Internal::Nikon3MakerNote::print0x009e(), Exiv2::Internal::OlympusMakerNote::print0x0200(), Exiv2::Internal::OlympusMakerNote::print0x0201(), Exiv2::Internal::OlympusMakerNote::print0x0204(), Exiv2::Internal::OlympusMakerNote::print0x0305(), Exiv2::Internal::OlympusMakerNote::print0x0308(), Exiv2::Internal::OlympusMakerNote::print0x050f(), Exiv2::Internal::OlympusMakerNote::print0x0527(), Exiv2::Internal::OlympusMakerNote::print0x0529(), Exiv2::Internal::OlympusMakerNote::print0x1015(), Exiv2::Internal::OlympusMakerNote::print0x1209(), Exiv2::Internal::print0x829a(), Exiv2::Internal::print0x9101(), Exiv2::Internal::print0x9202(), Exiv2::Internal::SonyMakerNote::printAFAreaModeSetting(), Exiv2::Internal::SonyMakerNote::printAFMode(), Exiv2::Internal::SonyMakerNote::printAFPointSelected(), Exiv2::Internal::SonyMakerNote::printAFTracking(), Exiv2::Internal::Nikon3MakerNote::printAperture(), Exiv2::Internal::Nikon3MakerNote::printApertureLd4(), Exiv2::Internal::SonyMakerNote::printAutoHDRStd(), Exiv2::Internal::Nikon1MakerNote::printBarValue(), Exiv2::Internal::printBitmask(), Exiv2::Internal::PentaxMakerNote::printBracketing(), Exiv2::Internal::Nikon3MakerNote::printCameraExposureCompensation(), Exiv2::Internal::SonyMakerNote::printColorCompensationFilter(), Exiv2::Internal::SonyMakerNote::printColorTemperature(), Exiv2::Internal::printCombiTag(), Exiv2::Internal::CanonMakerNote::printCs0x0002(), Exiv2::Internal::OlympusMakerNote::printCs0x0301(), Exiv2::Internal::CanonMakerNote::printCsLens(), Exiv2::Internal::CanonMakerNote::printCsLensType(), Exiv2::Internal::printDegrees(), Exiv2::Internal::OlympusMakerNote::printEq0x0301(), Exiv2::Internal::Nikon3MakerNote::printExitPupilPosition(), Exiv2::Internal::SonyMakerNote::printExposureStandardAdjustment(), Exiv2::Internal::Nikon3MakerNote::printExternalFlashData1Fl6(), Exiv2::Internal::Nikon3MakerNote::printExternalFlashData1Fl7(), Exiv2::Internal::Nikon3MakerNote::printExternalFlashData2(), Exiv2::Internal::Nikon3MakerNote::printExternalFlashData2Fl6(), Exiv2::Internal::Nikon3MakerNote::printExternalFlashData3(), Exiv2::Internal::Nikon3MakerNote::printExternalFlashData4(), Exiv2::Internal::CanonMakerNote::printFiFileNumber(), Exiv2::Internal::CanonMakerNote::printFiFocusDistance(), Exiv2::Internal::Nikon3MakerNote::printFlashFocalLength(), Exiv2::Internal::Nikon3MakerNote::printFlashGroupAControlData(), Exiv2::Internal::Nikon3MakerNote::printFlashGroupADataFl6(), Exiv2::Internal::Nikon3MakerNote::printFlashGroupADataFl7(), Exiv2::Internal::Nikon3MakerNote::printFlashGroupBCControlData(), Exiv2::Internal::Nikon3MakerNote::printFlashGroupBDataFl6(), Exiv2::Internal::Nikon3MakerNote::printFlashGroupBDataFl7(), Exiv2::Internal::Nikon3MakerNote::printFlashGroupCDataFl6(), Exiv2::Internal::Nikon3MakerNote::printFlashGroupCDataFl7(), Exiv2::Internal::Nikon3MakerNote::printFlashMasterDataFl6(), Exiv2::Internal::Nikon3MakerNote::printFlashMasterDataFl7(), Exiv2::Internal::Nikon3MakerNote::printFlashZoomHeadPosition(), Exiv2::Internal::SonyMakerNote::printFlexibleSpotPosition(), Exiv2::Internal::Nikon3MakerNote::printFocal(), Exiv2::Internal::Nikon3MakerNote::printFocalLd4(), Exiv2::Internal::CanonMakerNote::printFocalLength(), Exiv2::Internal::Nikon3MakerNote::printFocusDistance(), Exiv2::Internal::Nikon3MakerNote::printFocusDistanceLd4(), Exiv2::Internal::SonyMakerNote::printFocusFrameSize(), Exiv2::Internal::SonyMakerNote::printFocusMode(), Exiv2::Internal::SonyMakerNote::printFocusMode2(), Exiv2::Internal::SonyMakerNote::printFocusMode3(), Exiv2::Internal::Nikon3MakerNote::printFStops(), Exiv2::Internal::SonyMakerNote::printHighISONoiseReduction2(), Exiv2::Internal::SonyMakerNote::printImageSize(), Exiv2::Internal::Nikon3MakerNote::printLensId4ZMount(), Exiv2::Internal::SonyMakerNote::printLensSpec(), Exiv2::Internal::printLensSpecification(), Exiv2::Internal::SonyMakerNote::printMultiBurstMode(), Exiv2::Internal::SonyMakerNote::printMultiBurstSize(), Exiv2::Internal::Nikon3MakerNote::printPictureControl(), Exiv2::Internal::SonyMakerNote::printPixelShiftInfo(), Exiv2::Internal::Nikon3MakerNote::printRepeatingFlashCount(), Exiv2::Internal::Nikon3MakerNote::printRepeatingFlashRate(), Exiv2::Internal::CanonMakerNote::printSi0x0001(), Exiv2::Internal::CanonMakerNote::printSi0x0002(), Exiv2::Internal::CanonMakerNote::printSi0x0003(), Exiv2::Internal::CanonMakerNote::printSi0x0009(), Exiv2::Internal::CanonMakerNote::printSi0x000e(), Exiv2::Internal::CanonMakerNote::printSi0x0013(), Exiv2::Internal::CanonMakerNote::printSi0x0015(), Exiv2::Internal::CanonMakerNote::printSi0x0016(), Exiv2::Internal::CanonMakerNote::printSi0x0017(), Exiv2::Internal::SonyMakerNote::printSony2FpAmbientTemperature(), Exiv2::Internal::SonyMakerNote::printSony2FpFocusMode(), Exiv2::Internal::SonyMakerNote::printSony2FpFocusPosition2(), Exiv2::Internal::SonyMakerNote::printSonyMisc1CameraTemperature(), Exiv2::Internal::SonyMakerNote::printSonyMisc2bFocusPosition2(), Exiv2::Internal::SonyMakerNote::printSonyMisc2bLensZoomPosition(), Exiv2::Internal::SonyMakerNote::printSonyMisc3cModelReleaseYear(), Exiv2::Internal::SonyMakerNote::printSonyMisc3cQuality2(), Exiv2::Internal::SonyMakerNote::printSonyMisc3cSequenceNumber(), Exiv2::Internal::SonyMakerNote::printSonyMisc3cShotNumberSincePowerUp(), Exiv2::Internal::SonyMakerNote::printSonyMisc3cSonyImageHeight(), Exiv2::Internal::printTagBitlistAllLE(), Exiv2::Internal::printTagString2(), Exiv2::Internal::printTagString4(), Exiv2::Internal::Nikon3MakerNote::printTimeZone(), Exiv2::Internal::SonyMakerNote::printWBShiftABGM(), Exiv2::Internal::SonyMakerNote::printWBShiftABGMPrecise(), Exiv2::Internal::SonyMakerNote::printWhiteBalanceFineTune(), Exiv2::Internal::TiffDataEntry::setStrips(), and Exiv2::Internal::TiffImageEntry::setStrips().

## ◆ create()

Value::UniquePtr Exiv2::Value::create | ( | TypeId | typeId | ) |
| static

A (simple) factory to create a Value type.

The following Value subclasses are created depending on typeId:

typeId | Value subclass
`invalidTypeId` | DataValue(invalidTypeId)
`unsignedByte` | DataValue(unsignedByte)
`asciiString` | AsciiValue
`string` | StringValue
`unsignedShort` | ValueType < uint16_t >
`unsignedLong` | ValueType < uint32_t >
`unsignedRational` | ValueType < URational >
`invalid6` | DataValue(invalid6)
`undefined` | DataValue
`signedShort` | ValueType < int16_t >
`signedLong` | ValueType < int32_t >
`signedRational` | ValueType < Rational >
`tiffFloat` | ValueType < float >
`tiffDouble` | ValueType < double >
`tiffIfd` | ValueType < uint32_t >
`date` | DateValue
`time` | TimeValue
`comment` | CommentValue
`xmpText` | XmpTextValue
`xmpBag` | XmpArrayValue
`xmpSeq` | XmpArrayValue
`xmpAlt` | XmpArrayValue
`langAlt` | LangAltValue
default | DataValue(typeId)

Parameters

  typeId | Type of the value.

Returns
  Auto-pointer to the newly created Value. The caller owns this copy and the auto-pointer ensures that it will be deleted.

Examples
  addmoddel.cpp, and xmpsample.cpp.

References Exiv2::asciiString, Exiv2::comment, Exiv2::date, Exiv2::invalidTypeId, Exiv2::langAlt, Exiv2::signedByte, Exiv2::signedLong, Exiv2::signedRational, Exiv2::signedShort, Exiv2::string, Exiv2::tiffDouble, Exiv2::tiffFloat, Exiv2::tiffIfd, Exiv2::time, typeId(), Exiv2::undefined, Exiv2::unsignedByte, Exiv2::unsignedLong, Exiv2::unsignedRational, Exiv2::unsignedShort, Exiv2::xmpAlt, Exiv2::xmpBag, Exiv2::xmpSeq, and Exiv2::xmpText.

Referenced by Exiv2::Internal::TiffDecoder::decodeCanonAFInfo(), Exiv2::Internal::CiffComponent::doPrint(), Exiv2::Internal::TiffReader::readTiffEntry(), Exiv2::Exifdatum::setValue(), Exiv2::Iptcdatum::setValue(), Exiv2::Xmpdatum::setValue(), and Exiv2::Internal::TiffReader::visitBinaryElement().

## ◆ dataArea()

DataBuf Exiv2::Value::dataArea | ( |  | ) | const
| virtual

Return a copy of the data area if the value has one. The caller owns this copy and DataBuf ensures that it will be deleted.

Values may have a data area, which can contain additional information besides the actual value. This method is used to access such a data area.

Returns
  A DataBuf containing a copy of the data area or an empty DataBuf if the value does not have a data area assigned.

Reimplemented in Exiv2::ValueType< T >, Exiv2::ValueType< double >, Exiv2::ValueType< float >, Exiv2::ValueType< int16_t >, Exiv2::ValueType< int32_t >, Exiv2::ValueType< Rational >, Exiv2::ValueType< uint16_t >, Exiv2::ValueType< uint32_t >, and Exiv2::ValueType< URational >.

Referenced by Exiv2::Internal::TiffDataEntry::doWriteData(), Exiv2::Internal::TiffImageEntry::doWriteImage(), and toRational().

## ◆ read() [1/2]

virtual int Exiv2::Value::read | ( | const byte * | buf,
|  | size_t | len,
|  | ByteOrder | byteOrder )
| pure virtual

Read the value from a character buffer.

Parameters

  buf | Pointer to the data buffer to read from
  len | Number of bytes in the data buffer
  byteOrder | Applicable byte order (little or big endian).

Returns
  0 if successful.

Implemented in Exiv2::AsciiValue, Exiv2::CommentValue, Exiv2::DataValue, Exiv2::DateValue, Exiv2::LangAltValue, Exiv2::StringValueBase, Exiv2::TimeValue, Exiv2::ValueType< T >, Exiv2::ValueType< double >, Exiv2::ValueType< float >, Exiv2::ValueType< int16_t >, Exiv2::ValueType< int32_t >, Exiv2::ValueType< Rational >, Exiv2::ValueType< uint16_t >, Exiv2::ValueType< uint32_t >, Exiv2::ValueType< URational >, Exiv2::XmpArrayValue, Exiv2::XmpTextValue, and Exiv2::XmpValue.

## ◆ read() [2/2]

virtual int Exiv2::Value::read | ( | const std::string & | buf | ) |
| pure virtual

Set the value from a string buffer. The format of the string corresponds to that of the write() method, i.e., a string obtained through the write() method can be read by this function.

Parameters

  buf | The string to read from.

Returns
  0 if successful.

Implemented in Exiv2::AsciiValue, Exiv2::CommentValue, Exiv2::DataValue, Exiv2::DateValue, Exiv2::LangAltValue, Exiv2::StringValueBase, Exiv2::TimeValue, Exiv2::ValueType< T >, Exiv2::ValueType< double >, Exiv2::ValueType< float >, Exiv2::ValueType< int16_t >, Exiv2::ValueType< int32_t >, Exiv2::ValueType< Rational >, Exiv2::ValueType< uint16_t >, Exiv2::ValueType< uint32_t >, Exiv2::ValueType< URational >, Exiv2::XmpArrayValue, Exiv2::XmpTextValue, and Exiv2::XmpValue.

References setDataArea().

## ◆ setDataArea()

int Exiv2::Value::setDataArea | ( | const byte * | buf,
|  | size_t | len )
| virtual

Set the data area, if the value has one by copying (cloning) the buffer pointed to by buf.

Values may have a data area, which can contain additional information besides the actual value. This method is used to set such a data area.

Parameters

  buf | Pointer to the source data area
  len | Size of the data area

Returns
  Return -1 if the value has no data area, else 0.

Reimplemented in Exiv2::ValueType< T >, Exiv2::ValueType< double >, Exiv2::ValueType< float >, Exiv2::ValueType< int16_t >, Exiv2::ValueType< int32_t >, Exiv2::ValueType< Rational >, Exiv2::ValueType< uint16_t >, Exiv2::ValueType< uint32_t >, and Exiv2::ValueType< URational >.

Referenced by read().

## ◆ size()

virtual size_t Exiv2::Value::size | ( |  | ) | const
| pure virtual

Return the size of the value in bytes.

Implemented in Exiv2::DataValue, Exiv2::DateValue, Exiv2::StringValueBase, Exiv2::TimeValue, Exiv2::ValueType< T >, Exiv2::ValueType< double >, Exiv2::ValueType< float >, Exiv2::ValueType< int16_t >, Exiv2::ValueType< int32_t >, Exiv2::ValueType< Rational >, Exiv2::ValueType< uint16_t >, Exiv2::ValueType< uint32_t >, Exiv2::ValueType< URational >, Exiv2::XmpTextValue, and Exiv2::XmpValue.

Referenced by Exiv2::Internal::TiffBinaryElement::doSize(), Exiv2::Internal::print0x0000(), Exiv2::Internal::CasioMakerNote::print0x0015(), Exiv2::Internal::Nikon3MakerNote::print0x0088(), Exiv2::Internal::Nikon3MakerNote::print0x008b(), Exiv2::Internal::OlympusMakerNote::print0x0209(), Exiv2::Internal::Casio2MakerNote::print0x2001(), Exiv2::Internal::printExifVersion(), Exiv2::Internal::CanonMakerNote::printLe0x0000(), Exiv2::Internal::PanasonicMakerNote::printPanasonicText(), Exiv2::Internal::PentaxMakerNote::printShutterCount(), Exiv2::Internal::printUcs2(), Exiv2::Internal::printXmpDate(), and Exiv2::Internal::printXmpVersion().

## ◆ sizeDataArea()

size_t Exiv2::Value::sizeDataArea | ( |  | ) | const
| virtual

Return the size of the data area, 0 if there is none.

Reimplemented in Exiv2::ValueType< T >, Exiv2::ValueType< double >, Exiv2::ValueType< float >, Exiv2::ValueType< int16_t >, Exiv2::ValueType< int32_t >, Exiv2::ValueType< Rational >, Exiv2::ValueType< uint16_t >, Exiv2::ValueType< uint32_t >, and Exiv2::ValueType< URational >.

Referenced by Exiv2::Internal::TiffDataEntry::doSizeData(), Exiv2::Internal::TiffImageEntry::doSizeImage(), Exiv2::Internal::TiffImageEntry::doWriteImage(), Exiv2::Internal::TiffEncoder::encodeDataEntry(), and toRational().

## ◆ toFloat()

virtual float Exiv2::Value::toFloat | ( | size_t | n = 0 | ) | const
| pure virtual

Convert the n-th component of the value to a float. The behaviour of this method may be undefined if there is no n-th component.

Returns
  The converted value.

Implemented in Exiv2::DataValue, Exiv2::DateValue, Exiv2::LangAltValue, Exiv2::StringValueBase, Exiv2::TimeValue, Exiv2::ValueType< T >, Exiv2::ValueType< T >, Exiv2::ValueType< T >, Exiv2::ValueType< double >, Exiv2::ValueType< double >, Exiv2::ValueType< double >, Exiv2::ValueType< float >, Exiv2::ValueType< float >, Exiv2::ValueType< float >, Exiv2::ValueType< int16_t >, Exiv2::ValueType< int16_t >, Exiv2::ValueType< int16_t >, Exiv2::ValueType< int32_t >, Exiv2::ValueType< int32_t >, Exiv2::ValueType< int32_t >, Exiv2::ValueType< Rational >, Exiv2::ValueType< Rational >, Exiv2::ValueType< Rational >, Exiv2::ValueType< uint16_t >, Exiv2::ValueType< uint16_t >, Exiv2::ValueType< uint16_t >, Exiv2::ValueType< uint32_t >, Exiv2::ValueType< uint32_t >, Exiv2::ValueType< uint32_t >, Exiv2::ValueType< URational >, Exiv2::ValueType< URational >, Exiv2::ValueType< URational >, Exiv2::XmpArrayValue, and Exiv2::XmpTextValue.

Examples
  xmpsample.cpp.

Referenced by Exiv2::Internal::print0x0006(), Exiv2::Internal::print0x0007(), Exiv2::Internal::Nikon3MakerNote::print0x008b(), Exiv2::Internal::Nikon3MakerNote::print0x009a(), Exiv2::Internal::OlympusMakerNote::print0x0204(), Exiv2::Internal::print0x9202(), Exiv2::Internal::CanonMakerNote::printCsLens(), Exiv2::Internal::printFloat(), Exiv2::Internal::CanonMakerNote::printFocalLength(), Exiv2::Internal::printLensSpecification(), and Exiv2::Internal::Nikon3MakerNote::printTimeZone().

## ◆ toInt64()

virtual int64_t Exiv2::Value::toInt64 | ( | size_t | n = 0 | ) | const
| pure virtual

Convert the n-th component of the value to an int64_t. The behaviour of this method may be undefined if there is no n-th component.

Returns
  The converted value.

Implemented in Exiv2::DataValue, Exiv2::DateValue, Exiv2::LangAltValue, Exiv2::StringValueBase, Exiv2::TimeValue, Exiv2::ValueType< T >, Exiv2::ValueType< T >, Exiv2::ValueType< T >, Exiv2::ValueType< T >, Exiv2::ValueType< T >, Exiv2::ValueType< double >, Exiv2::ValueType< double >, Exiv2::ValueType< double >, Exiv2::ValueType< double >, Exiv2::ValueType< double >, Exiv2::ValueType< float >, Exiv2::ValueType< float >, Exiv2::ValueType< float >, Exiv2::ValueType< float >, Exiv2::ValueType< float >, Exiv2::ValueType< int16_t >, Exiv2::ValueType< int16_t >, Exiv2::ValueType< int16_t >, Exiv2::ValueType< int16_t >, Exiv2::ValueType< int16_t >, Exiv2::ValueType< int32_t >, Exiv2::ValueType< int32_t >, Exiv2::ValueType< int32_t >, Exiv2::ValueType< int32_t >, Exiv2::ValueType< int32_t >, Exiv2::ValueType< Rational >, Exiv2::ValueType< Rational >, Exiv2::ValueType< Rational >, Exiv2::ValueType< Rational >, Exiv2::ValueType< Rational >, Exiv2::ValueType< uint16_t >, Exiv2::ValueType< uint16_t >, Exiv2::ValueType< uint16_t >, Exiv2::ValueType< uint16_t >, Exiv2::ValueType< uint16_t >, Exiv2::ValueType< uint32_t >, Exiv2::ValueType< uint32_t >, Exiv2::ValueType< uint32_t >, Exiv2::ValueType< uint32_t >, Exiv2::ValueType< uint32_t >, Exiv2::ValueType< URational >, Exiv2::ValueType< URational >, Exiv2::ValueType< URational >, Exiv2::ValueType< URational >, Exiv2::ValueType< URational >, Exiv2::XmpArrayValue, and Exiv2::XmpTextValue.

Examples
  xmpsample.cpp.

Referenced by Exiv2::Internal::TiffDecoder::decodeCanonAFInfo(), Exiv2::Internal::print0x0000(), Exiv2::Internal::Nikon1MakerNote::print0x0002(), Exiv2::Internal::Nikon3MakerNote::print0x0002(), Exiv2::Internal::CasioMakerNote::print0x0006(), Exiv2::Internal::print0x0007(), Exiv2::Internal::PanasonicMakerNote::print0x000f(), Exiv2::Internal::CasioMakerNote::print0x0015(), Exiv2::Internal::PanasonicMakerNote::print0x0023(), Exiv2::Internal::PanasonicMakerNote::print0x0029(), Exiv2::Internal::PanasonicMakerNote::print0x0036(), Exiv2::Internal::PanasonicMakerNote::print0x003c(), Exiv2::Internal::Nikon3MakerNote::print0x0084(), Exiv2::Internal::Nikon3MakerNote::print0x0089(), Exiv2::Internal::Nikon3MakerNote::print0x008b(), Exiv2::Internal::Nikon3MakerNote::print0x009e(), Exiv2::Internal::OlympusMakerNote::print0x0200(), Exiv2::Internal::OlympusMakerNote::print0x0201(), Exiv2::Internal::OlympusMakerNote::print0x0209(), Exiv2::Internal::OlympusMakerNote::print0x0308(), Exiv2::Internal::OlympusMakerNote::print0x050f(), Exiv2::Internal::OlympusMakerNote::print0x0527(), Exiv2::Internal::OlympusMakerNote::print0x0529(), Exiv2::Internal::OlympusMakerNote::print0x1015(), Exiv2::Internal::OlympusMakerNote::print0x1209(), Exiv2::Internal::Casio2MakerNote::print0x2001(), Exiv2::Internal::Casio2MakerNote::print0x2022(), Exiv2::Internal::print0x8827(), Exiv2::Internal::print0x9101(), Exiv2::Internal::print0xa405(), Exiv2::Internal::PanasonicMakerNote::printAccelerometer(), Exiv2::Internal::Nikon3MakerNote::printAfPointsInFocus(), Exiv2::Internal::Nikon3MakerNote::printAperture(), Exiv2::Internal::Nikon3MakerNote::printApertureLd4(), Exiv2::Internal::Nikon1MakerNote::printBarValue(), Exiv2::Internal::printBitmask(), Exiv2::Internal::printCombiTag(), Exiv2::Internal::PentaxMakerNote::printCompensation(), Exiv2::Internal::CanonMakerNote::printCs0x0002(), Exiv2::Internal::OlympusMakerNote::printCs0x0301(), Exiv2::Internal::CanonMakerNote::printCsLens(), Exiv2::Internal::PentaxMakerNote::printDate(), Exiv2::Internal::OlympusMakerNote::printEq0x0301(), Exiv2::Internal::printExifVersion(), Exiv2::Internal::Nikon3MakerNote::printExitPupilPosition(), Exiv2::Internal::PentaxMakerNote::printExposure(), Exiv2::Internal::CanonMakerNote::printFiFocusDistance(), Exiv2::Internal::PentaxMakerNote::printFlashCompensation(), Exiv2::Internal::Nikon3MakerNote::printFlashFocalLength(), Exiv2::Internal::Nikon3MakerNote::printFocal(), Exiv2::Internal::Nikon3MakerNote::printFocalLd4(), Exiv2::Internal::PentaxMakerNote::printFocalLength(), Exiv2::Internal::Nikon3MakerNote::printFocusDistance(), Exiv2::Internal::Nikon3MakerNote::printFocusDistanceLd4(), Exiv2::Internal::Nikon3MakerNote::printFStops(), Exiv2::Internal::PentaxMakerNote::printFValue(), Exiv2::Internal::Nikon3MakerNote::printIiIso(), Exiv2::Internal::CanonMakerNote::printLe0x0000(), Exiv2::Internal::Nikon3MakerNote::printLensId(), Exiv2::Internal::Nikon3MakerNote::printLensId4ZMount(), Exiv2::Internal::MinoltaMakerNote::printMinoltaBrightnessStd(), Exiv2::Internal::MinoltaMakerNote::printMinoltaDateStd(), Exiv2::Internal::MinoltaMakerNote::printMinoltaExposureCompensation5D(), Exiv2::Internal::MinoltaMakerNote::printMinoltaExposureCompensationStd(), Exiv2::Internal::MinoltaMakerNote::printMinoltaExposureManualBias5D(), Exiv2::Internal::MinoltaMakerNote::printMinoltaExposureSpeedStd(), Exiv2::Internal::MinoltaMakerNote::printMinoltaExposureTimeStd(), Exiv2::Internal::MinoltaMakerNote::printMinoltaFlashExposureCompStd(), Exiv2::Internal::MinoltaMakerNote::printMinoltaFNumberStd(), Exiv2::Internal::MinoltaMakerNote::printMinoltaFocalLengthStd(), Exiv2::Internal::MinoltaMakerNote::printMinoltaTimeStd(), Exiv2::Internal::MinoltaMakerNote::printMinoltaWhiteBalanceStd(), Exiv2::Internal::PanasonicMakerNote::printPanasonicText(), Exiv2::Internal::Nikon3MakerNote::printPictureControl(), Exiv2::Internal::PanasonicMakerNote::printPitchAngle(), Exiv2::Internal::PanasonicMakerNote::printPressure(), Exiv2::Internal::Nikon3MakerNote::printRepeatingFlashCount(), Exiv2::Internal::Nikon3MakerNote::printRepeatingFlashRate(), Exiv2::Internal::PanasonicMakerNote::printRollAngle(), Exiv2::Internal::CanonMakerNote::printSi0x0001(), Exiv2::Internal::CanonMakerNote::printSi0x0002(), Exiv2::Internal::CanonMakerNote::printSi0x0003(), Exiv2::Internal::CanonMakerNote::printSi0x0009(), Exiv2::Internal::CanonMakerNote::printSi0x000c(), Exiv2::Internal::CanonMakerNote::printSi0x000d(), Exiv2::Internal::CanonMakerNote::printSi0x0013(), Exiv2::Internal::CanonMakerNote::printSi0x0015(), Exiv2::Internal::CanonMakerNote::printSi0x0016(), Exiv2::Internal::CanonMakerNote::printSi0x0017(), Exiv2::Internal::CanonMakerNote::printSi0x0018(), Exiv2::Internal::SonyMakerNote::printSony2FpFocusMode(), Exiv2::Internal::SonyMakerNote::printSony2FpFocusPosition2(), Exiv2::Internal::SonyMakerNote::printSonyMisc2bLensZoomPosition(), Exiv2::Internal::SonyMakerNote::printSonyMisc3cModelReleaseYear(), Exiv2::Internal::SonyMakerNote::printSonyMisc3cQuality2(), Exiv2::Internal::SonyMakerNote::printSonyMisc3cSequenceNumber(), Exiv2::Internal::SonyMakerNote::printSonyMisc3cShotNumberSincePowerUp(), Exiv2::Internal::SonyMakerNote::printSonyMisc3cSonyImageHeight(), Exiv2::Internal::printTag(), Exiv2::Internal::printTagNoError(), Exiv2::Internal::PentaxMakerNote::printTemperature(), Exiv2::Internal::PentaxMakerNote::printTime(), Exiv2::Internal::Nikon3MakerNote::printTimeZone(), Exiv2::Internal::SonyMakerNote::printWBShiftABGM(), and Exiv2::Internal::SonyMakerNote::printWBShiftABGMPrecise().

## ◆ toRational()

virtual Rational Exiv2::Value::toRational | ( | size_t | n = 0 | ) | const
| pure virtual

Convert the n-th component of the value to a Rational. The behaviour of this method may be undefined if there is no n-th component.

Returns
  The converted value.

Implemented in Exiv2::DataValue, Exiv2::DateValue, Exiv2::LangAltValue, Exiv2::StringValueBase, Exiv2::TimeValue, Exiv2::ValueType< T >, Exiv2::ValueType< T >, Exiv2::ValueType< T >, Exiv2::ValueType< T >, Exiv2::ValueType< T >, Exiv2::ValueType< double >, Exiv2::ValueType< double >, Exiv2::ValueType< double >, Exiv2::ValueType< double >, Exiv2::ValueType< double >, Exiv2::ValueType< float >, Exiv2::ValueType< float >, Exiv2::ValueType< float >, Exiv2::ValueType< float >, Exiv2::ValueType< float >, Exiv2::ValueType< int16_t >, Exiv2::ValueType< int16_t >, Exiv2::ValueType< int16_t >, Exiv2::ValueType< int16_t >, Exiv2::ValueType< int16_t >, Exiv2::ValueType< int32_t >, Exiv2::ValueType< int32_t >, Exiv2::ValueType< int32_t >, Exiv2::ValueType< int32_t >, Exiv2::ValueType< int32_t >, Exiv2::ValueType< Rational >, Exiv2::ValueType< Rational >, Exiv2::ValueType< Rational >, Exiv2::ValueType< Rational >, Exiv2::ValueType< Rational >, Exiv2::ValueType< uint16_t >, Exiv2::ValueType< uint16_t >, Exiv2::ValueType< uint16_t >, Exiv2::ValueType< uint16_t >, Exiv2::ValueType< uint16_t >, Exiv2::ValueType< uint32_t >, Exiv2::ValueType< uint32_t >, Exiv2::ValueType< uint32_t >, Exiv2::ValueType< uint32_t >, Exiv2::ValueType< uint32_t >, Exiv2::ValueType< URational >, Exiv2::ValueType< URational >, Exiv2::ValueType< URational >, Exiv2::ValueType< URational >, Exiv2::ValueType< URational >, Exiv2::XmpArrayValue, and Exiv2::XmpTextValue.

Examples
  xmpsample.cpp.

References dataArea(), and sizeDataArea().

Referenced by Exiv2::Internal::print0x0006(), Exiv2::Internal::print0x0007(), Exiv2::Internal::Nikon2MakerNote::print0x000a(), Exiv2::Internal::Nikon3MakerNote::print0x0084(), Exiv2::Internal::Nikon1MakerNote::print0x0085(), Exiv2::Internal::Nikon3MakerNote::print0x0085(), Exiv2::Internal::Nikon1MakerNote::print0x0086(), Exiv2::Internal::Nikon3MakerNote::print0x0086(), Exiv2::Internal::OlympusMakerNote::print0x0204(), Exiv2::Internal::OlympusMakerNote::print0x0305(), Exiv2::Internal::print0x829a(), Exiv2::Internal::print0x829d(), Exiv2::Internal::print0x9201(), Exiv2::Internal::print0x9202(), Exiv2::Internal::print0x9204(), Exiv2::Internal::print0x9206(), Exiv2::Internal::print0x920a(), Exiv2::Internal::print0xa404(), Exiv2::Internal::printDegrees(), Exiv2::Internal::SonyMakerNote::printExposureStandardAdjustment(), Exiv2::Internal::printFloat(), Exiv2::Internal::printInt64(), and Exiv2::Internal::printLensSpecification().

## ◆ toString()

std::string Exiv2::Value::toString | ( | size_t | n | ) | const
| virtual

Return the n-th component of the value as a string. The default implementation returns toString(). The behaviour of this method may be undefined if there is no n-th component.

Reimplemented in Exiv2::DataValue, Exiv2::LangAltValue, Exiv2::ValueType< T >, Exiv2::ValueType< double >, Exiv2::ValueType< float >, Exiv2::ValueType< int16_t >, Exiv2::ValueType< int32_t >, Exiv2::ValueType< Rational >, Exiv2::ValueType< uint16_t >, Exiv2::ValueType< uint32_t >, Exiv2::ValueType< URational >, and Exiv2::XmpArrayValue.

References toString().

## ◆ toUint32()

virtual uint32_t Exiv2::Value::toUint32 | ( | size_t | n = 0 | ) | const
| pure virtual

Convert the n-th component of the value to a float. The behaviour of this method may be undefined if there is no n-th component.

Returns
  The converted value.

Implemented in Exiv2::DataValue, Exiv2::DateValue, Exiv2::LangAltValue, Exiv2::StringValueBase, Exiv2::TimeValue, Exiv2::ValueType< T >, Exiv2::ValueType< T >, Exiv2::ValueType< T >, Exiv2::ValueType< T >, Exiv2::ValueType< T >, Exiv2::ValueType< double >, Exiv2::ValueType< double >, Exiv2::ValueType< double >, Exiv2::ValueType< double >, Exiv2::ValueType< double >, Exiv2::ValueType< float >, Exiv2::ValueType< float >, Exiv2::ValueType< float >, Exiv2::ValueType< float >, Exiv2::ValueType< float >, Exiv2::ValueType< int16_t >, Exiv2::ValueType< int16_t >, Exiv2::ValueType< int16_t >, Exiv2::ValueType< int16_t >, Exiv2::ValueType< int16_t >, Exiv2::ValueType< int32_t >, Exiv2::ValueType< int32_t >, Exiv2::ValueType< int32_t >, Exiv2::ValueType< int32_t >, Exiv2::ValueType< int32_t >, Exiv2::ValueType< Rational >, Exiv2::ValueType< Rational >, Exiv2::ValueType< Rational >, Exiv2::ValueType< Rational >, Exiv2::ValueType< Rational >, Exiv2::ValueType< uint16_t >, Exiv2::ValueType< uint16_t >, Exiv2::ValueType< uint16_t >, Exiv2::ValueType< uint16_t >, Exiv2::ValueType< uint16_t >, Exiv2::ValueType< uint32_t >, Exiv2::ValueType< uint32_t >, Exiv2::ValueType< uint32_t >, Exiv2::ValueType< uint32_t >, Exiv2::ValueType< uint32_t >, Exiv2::ValueType< URational >, Exiv2::ValueType< URational >, Exiv2::ValueType< URational >, Exiv2::ValueType< URational >, Exiv2::ValueType< URational >, Exiv2::XmpArrayValue, and Exiv2::XmpTextValue.

Referenced by Exiv2::Internal::TiffDataEntry::doWrite(), Exiv2::Internal::Nikon3MakerNote::print0x0083(), Exiv2::Internal::Nikon1MakerNote::print0x0088(), Exiv2::Internal::Nikon3MakerNote::print0x0088(), Exiv2::Internal::SonyMakerNote::printAFAreaModeSetting(), Exiv2::Internal::SonyMakerNote::printAFMode(), Exiv2::Internal::SonyMakerNote::printAFPointSelected(), Exiv2::Internal::SonyMakerNote::printAFTracking(), Exiv2::Internal::SonyMakerNote::printAutoHDRStd(), Exiv2::Internal::PentaxMakerNote::printBracketing(), Exiv2::Internal::Nikon3MakerNote::printCameraExposureCompensation(), Exiv2::Internal::SonyMakerNote::printColorCompensationFilter(), Exiv2::Internal::SonyMakerNote::printColorTemperature(), Exiv2::Internal::printCombiTag(), Exiv2::Internal::Nikon3MakerNote::printExternalFlashData1Fl6(), Exiv2::Internal::Nikon3MakerNote::printExternalFlashData1Fl7(), Exiv2::Internal::Nikon3MakerNote::printExternalFlashData2(), Exiv2::Internal::Nikon3MakerNote::printExternalFlashData2Fl6(), Exiv2::Internal::Nikon3MakerNote::printExternalFlashData3(), Exiv2::Internal::Nikon3MakerNote::printExternalFlashData4(), Exiv2::Internal::CanonMakerNote::printFiFileNumber(), Exiv2::Internal::Nikon3MakerNote::printFlashGroupAControlData(), Exiv2::Internal::Nikon3MakerNote::printFlashGroupADataFl6(), Exiv2::Internal::Nikon3MakerNote::printFlashGroupADataFl7(), Exiv2::Internal::Nikon3MakerNote::printFlashGroupBCControlData(), Exiv2::Internal::Nikon3MakerNote::printFlashGroupBDataFl6(), Exiv2::Internal::Nikon3MakerNote::printFlashGroupBDataFl7(), Exiv2::Internal::Nikon3MakerNote::printFlashGroupCDataFl6(), Exiv2::Internal::Nikon3MakerNote::printFlashGroupCDataFl7(), Exiv2::Internal::Nikon3MakerNote::printFlashMasterDataFl6(), Exiv2::Internal::Nikon3MakerNote::printFlashMasterDataFl7(), Exiv2::Internal::Nikon3MakerNote::printFlashZoomHeadPosition(), Exiv2::Internal::SonyMakerNote::printFlexibleSpotPosition(), Exiv2::Internal::SonyMakerNote::printFocalPlaneAFPointsUsed(), Exiv2::Internal::SonyMakerNote::printFocusFrameSize(), Exiv2::Internal::SonyMakerNote::printFocusMode(), Exiv2::Internal::SonyMakerNote::printFocusMode2(), Exiv2::Internal::SonyMakerNote::printFocusMode3(), Exiv2::Internal::SonyMakerNote::printHighISONoiseReduction2(), Exiv2::Internal::SonyMakerNote::printLensSpec(), Exiv2::Internal::printMinoltaSonyLensID(), Exiv2::Internal::SonyMakerNote::printMultiBurstSize(), Exiv2::Internal::SonyMakerNote::printPixelShiftInfo(), Exiv2::Internal::PentaxMakerNote::printShutterCount(), Exiv2::Internal::CanonMakerNote::printSi0x000e(), Exiv2::Internal::printTagBitlistAllLE(), Exiv2::Internal::printTagBitmask(), Exiv2::Internal::SonyMakerNote::printWhiteBalanceFineTune(), Exiv2::Internal::TiffDataEntry::setStrips(), and Exiv2::Internal::TiffImageEntry::setStrips().

## ◆ write()

virtual std::ostream & Exiv2::Value::write | ( | std::ostream & | os | ) | const
| pure virtual

Write the value to an output stream. You do not usually have to use this function; it is used for the implementation of the output operator for Value, operator<<(std::ostream &os, const Value &value).

Implemented in Exiv2::AsciiValue, Exiv2::CommentValue, Exiv2::DataValue, Exiv2::DateValue, Exiv2::LangAltValue, Exiv2::StringValueBase, Exiv2::TimeValue, Exiv2::ValueType< T >, Exiv2::ValueType< double >, Exiv2::ValueType< float >, Exiv2::ValueType< int16_t >, Exiv2::ValueType< int32_t >, Exiv2::ValueType< Rational >, Exiv2::ValueType< uint16_t >, Exiv2::ValueType< uint32_t >, Exiv2::ValueType< URational >, Exiv2::XmpArrayValue, and Exiv2::XmpTextValue.

References toString().

Referenced by Exiv2::XmpValue::copy(), Exiv2::operator<<(), Exiv2::XmpValue::size(), and toString().

The documentation for this class was generated from the following files:

- value.hpp
- value.cpp