Exiv2
|
Value type suitable for simple XMP properties and XMP nodes of complex types which are not parsed into specific values. More...
#include <value.hpp>
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. |
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.
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
Implements Exiv2::XmpValue.
References Exiv2::XmpValue::setXmpArrayType(), Exiv2::XmpValue::setXmpStruct(), Exiv2::string, and value_.
Referenced by XmpTextValue().
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.
Implements Exiv2::Value.
References Exiv2::Value::ok_, Exiv2::parseFloat(), and value_.
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.
Implements Exiv2::Value.
References Exiv2::Value::ok_, Exiv2::parseLong(), and value_.
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.
Implements Exiv2::Value.
References Exiv2::Value::ok_, Exiv2::parseRational(), and value_.