Exiv2: Exiv2::XmpTextValue Class Reference

# 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:
[legend]
Collaboration diagram for Exiv2::XmpTextValue:
[legend]

List of all members.

## Public Types
typedef std::auto_ptr < XmpTextValue > | AutoPtr
| 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.
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::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.

Examples:
  xmpsample.cpp.

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 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 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:

- value.hpp