Exiv2::XmpValue Class Reference

Base class for all Exiv2 values used to store XMP property values. More...

#include <value.hpp>

Inheritance diagram for Exiv2::XmpValue:

Inheritance graph
[legend]
Collaboration diagram for Exiv2::XmpValue:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::auto_ptr< XmpValueAutoPtr
 Shortcut for a XmpValue auto pointer.
enum  XmpArrayType { xaNone, xaAlt, xaBag, xaSeq }
 XMP array types.
enum  XmpStruct { xsNone, xsStruct }
 XMP structure indicator.

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

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

XmpValueoperator= (const XmpValue &rhs)
 Assignment operator. Protected so that it can only be used by subclasses but not directly.

Detailed Description

Base class for all Exiv2 values used to store XMP property values.


Member Function Documentation

virtual long Exiv2::XmpValue::copy byte buf,
ByteOrder  byteOrder = invalidByteOrder
const [virtual]
 

Write value to a character data buffer.

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

Note:
The byte order is required by the interface but not used by this method, so just use the default.
Parameters:
buf Data buffer to write to.
byteOrder Byte order. Not used.
Returns:
Number of characters written.

Implements Exiv2::Value.

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.

Parameters:
buf The string to read from.
Returns:
0 if successful.

Implements Exiv2::Value.

Implemented in Exiv2::XmpTextValue, Exiv2::XmpArrayValue, and Exiv2::LangAltValue.

virtual 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)

Note:
The byte order is required by the interface but not used by this method, so just use the default.
Parameters:
buf Pointer to the data buffer to read from
len Number of bytes in the data buffer
byteOrder Byte order. Not needed.
Returns:
0 if successful.

Implements Exiv2::Value.


The documentation for this class was generated from the following file:
Generated on Thu Dec 31 03:58:12 2009 for Exiv2 by  doxygen 1.3.9.1