Exiv2
|
Base class for all Exiv2 values used to store XMP property values. More...
#include <value.hpp>
Public Types | |
enum | XmpArrayType { xaNone, xaAlt, xaBag, xaSeq } |
XMP array types. | |
enum | XmpStruct { xsNone, xsStruct } |
XMP structure indicator. | |
typedef std::auto_ptr< XmpValue > | AutoPtr |
Shortcut for a XmpValue auto pointer. | |
Public Member Functions | |
Creators | |
XmpValue (TypeId typeId) | |
Accessors | |
XmpArrayType | xmpArrayType () const |
Return XMP array type, indicates if an XMP value is an array. | |
XmpStruct | xmpStruct () const |
Return XMP struct, indicates if an XMP value is a structure. | |
virtual long | size () const |
Return the size of the value in bytes. | |
virtual long | copy (byte *buf, ByteOrder byteOrder=invalidByteOrder) const |
Write value to a character data buffer. | |
Manipulators | |
void | setXmpArrayType (XmpArrayType xmpArrayType) |
Set the XMP array type to indicate that an XMP value is an array. | |
void | setXmpStruct (XmpStruct xmpStruct=xsStruct) |
Set the XMP struct type to indicate that an XMP value is a structure. | |
virtual int | read (const byte *buf, long len, ByteOrder byteOrder=invalidByteOrder) |
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. | |
Static Public Member Functions | |
static XmpArrayType | xmpArrayType (TypeId typeId) |
Return XMP array type for an array Value TypeId, xaNone if typeId is not an XMP array value type. | |
Protected Member Functions | |
XmpValue & | operator= (const XmpValue &rhs) |
Assignment operator. Protected so that it can only be used by subclasses but not directly. |
Base class for all Exiv2 values used to store XMP property values.
Write value to a character data buffer.
The user must ensure that the buffer has enough memory. Otherwise the call results in undefined behaviour.
buf | Data buffer to write to. |
byteOrder | Byte order. Not used. |
Implements Exiv2::Value.
References Exiv2::string, and Exiv2::Value::write().
virtual int Exiv2::XmpValue::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.
buf | The string to read from. |
Implements Exiv2::Value.
Implemented in Exiv2::XmpTextValue, Exiv2::XmpArrayValue, and Exiv2::LangAltValue.
int Exiv2::XmpValue::read | ( | const byte * | buf, |
long | len, | ||
ByteOrder | byteOrder = invalidByteOrder |
||
) | [virtual] |
Read the value from a character buffer.
Uses read(const std::string& buf)
buf | Pointer to the data buffer to read from |
len | Number of bytes in the data buffer |
byteOrder | Byte order. Not needed. |
Implements Exiv2::Value.
References Exiv2::string.