Exiv2::XmpTextValue Class Reference

Value type suitable for simple XMP properties and XMP nodes of complex types which are not parsed into specific values. More...

#include <value.hpp>

Inheritance diagram for Exiv2::XmpTextValue:

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

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::auto_ptr< XmpTextValueAutoPtr
 Shortcut for a XmpTextValue auto pointer.

Public Member Functions

Creators
 XmpTextValue ()
 Constructor.
 XmpTextValue (const std::string &buf)
 Constructor, reads the value from a string.
Manipulators
virtual int read (const std::string &buf)
 Read a simple property value from buf to set the value.
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
Accessors
AutoPtr 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.
long size () const
 Return the size of the value in bytes.
virtual long count () const
 Return the number of components of the value.
virtual long toLong (long n=0) const
 Convert the value to a long. The optional parameter n is not used and is ignored.
virtual float toFloat (long n=0) const
 Convert the value to a float. The optional parameter n is not used and is ignored.
virtual Rational toRational (long n=0) const
 Convert the value to a Rational. The optional parameter n is not used and is ignored.
virtual std::ostream & write (std::ostream &os) const
 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).

Public Attributes

std::string value_
 Stores the string values.

Detailed Description

Value type suitable for simple XMP properties and XMP nodes of complex types which are not parsed into specific values.

Uses a std::string to store the value.

Examples:

xmpsample.cpp.


Member Function Documentation

virtual int Exiv2::XmpValue::read const byte buf,
long  len,
ByteOrder  byteOrder = invalidByteOrder
 

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.

virtual int Exiv2::XmpTextValue::read const std::string &  buf  )  [virtual]
 

Read a simple property value from buf to set the value.

Sets the value to the contents of buf. A optional keyword, type is supported to set the XMP value type. This is useful for complex value types for which Exiv2 does not have direct support.

The format of buf is:
[type=["]Alt|Bag|Seq|Struct["] ]text

Returns:
0 if successful.

Implements Exiv2::XmpValue.

virtual float Exiv2::XmpTextValue::toFloat long  n = 0  )  const [virtual]
 

Convert the value to a float. The optional parameter n is not used and is ignored.

Returns:
The converted value.

Implements Exiv2::Value.

virtual long Exiv2::XmpTextValue::toLong long  n = 0  )  const [virtual]
 

Convert the value to a long. The optional parameter n is not used and is ignored.

Returns:
The converted value.

Implements Exiv2::Value.

virtual Rational Exiv2::XmpTextValue::toRational long  n = 0  )  const [virtual]
 

Convert the value to a Rational. The optional parameter n is not used and is ignored.

Returns:
The converted value.

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