Stateless parser class for XMP packets. Images use this class to parse and serialize XMP packets. The parser uses the XMP toolkit to do the job. More...
#include <xmp.hpp>
Public Types | |
enum | XmpFormatFlags { omitPacketWrapper = 0x0010UL, readOnlyPacket = 0x0020UL, useCompactFormat = 0x0040UL, includeThumbnailPad = 0x0100UL, exactPacketLength = 0x0200UL, writeAliasComments = 0x0400UL, omitAllFormatting = 0x0800UL } |
Options to control the format of the serialized XMP packet. More... | |
Static Public Member Functions | |
static int | decode (XmpData &xmpData, const std::string &xmpPacket) |
Decode XMP metadata from an XMP packet xmpPacket into xmpData. The format of the XMP packet must follow the XMP specification. This method clears any previous contents of xmpData. | |
static int | encode (std::string &xmpPacket, const XmpData &xmpData, uint16_t formatFlags=useCompactFormat, uint32_t padding=0) |
Encode (serialize) XMP metadata from xmpData into a string xmpPacket. The XMP packet returned in the string follows the XMP specification. This method only modifies xmpPacket if the operations succeeds (return code 0). | |
static bool | initialize () |
Initialize the XMP Toolkit. | |
static void | terminate () |
Terminate the XMP Toolkit and unregister custom namespaces. | |
Friends | |
void | XmpProperties::registerNs (const std::string &, const std::string &) |
void | XmpProperties::unregisterNs (const std::string &) |
Stateless parser class for XMP packets. Images use this class to parse and serialize XMP packets. The parser uses the XMP toolkit to do the job.
Options to control the format of the serialized XMP packet.
int Exiv2::XmpParser::decode | ( | XmpData & | xmpData, | |
const std::string & | xmpPacket | |||
) | [static] |
Decode XMP metadata from an XMP packet xmpPacket into xmpData. The format of the XMP packet must follow the XMP specification. This method clears any previous contents of xmpData.
xmpData | Container for the decoded XMP properties | |
xmpPacket | The raw XMP packet to decode |
References Exiv2::XmpData::add(), Exiv2::XmpData::clear(), initialize(), Exiv2::XmpProperties::prefix(), Exiv2::XmpProperties::registerNs(), and Exiv2::string.
Referenced by Exiv2::Internal::TiffDecoder::decodeXmp(), Exiv2::XmpSidecar::readMetadata(), Exiv2::JpegBase::readMetadata(), and Exiv2::Jp2Image::readMetadata().
int Exiv2::XmpParser::encode | ( | std::string & | xmpPacket, | |
const XmpData & | xmpData, | |||
uint16_t | formatFlags = useCompactFormat , |
|||
uint32_t | padding = 0 | |||
) | [static] |
Encode (serialize) XMP metadata from xmpData into a string xmpPacket. The XMP packet returned in the string follows the XMP specification. This method only modifies xmpPacket if the operations succeeds (return code 0).
xmpPacket | Reference to a string to hold the encoded XMP packet. | |
xmpData | XMP properties to encode. | |
formatFlags | Flags that control the format of the XMP packet, see enum XmpFormatFlags. | |
padding | Padding length. |
References Exiv2::XmpData::begin(), Exiv2::XmpData::empty(), Exiv2::XmpData::end(), initialize(), Exiv2::XmpProperties::ns(), Exiv2::string, Exiv2::toString(), Exiv2::TypeInfo::typeName(), Exiv2::LangAltValue::value_, Exiv2::XmpValue::xmpArrayType(), Exiv2::xmpBag, Exiv2::xmpSeq, and Exiv2::XmpValue::xmpStruct().
Referenced by Exiv2::XmpSidecar::writeMetadata().
bool Exiv2::XmpParser::initialize | ( | ) | [static] |
void Exiv2::XmpParser::terminate | ( | ) | [static] |
Terminate the XMP Toolkit and unregister custom namespaces.
Call this method when the XmpParser is no longer needed to allow the XMP Toolkit to cleanly shutdown.
References Exiv2::XmpProperties::unregisterNs().