#include <value.hpp>
Inheritance diagram for Exiv2::Value:

Public Member Functions | |
Creators | |
| Value (TypeId typeId) | |
| Constructor, taking a type id to initialize the base class with. | |
| Value (const Value &rhs) | |
| Copy constructor. | |
| virtual | ~Value () |
| Virtual destructor. | |
Manipulators | |
| virtual void | read (const byte *buf, long len, ByteOrder byteOrder)=0 |
| Read the value from a character buffer. | |
| virtual void | 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. | |
Accessors | |
| TypeId | typeId () const |
| Return the type identifier (Exif data format type). | |
| std::string | toString () const |
| Return the value as a string. Implemented in terms of write(std::ostream& os) const of the concrete class. | |
| virtual long | copy (byte *buf, ByteOrder byteOrder) const =0 |
| Write value to a data buffer. | |
| virtual long | count () const =0 |
| Return the number of components of the value. | |
| virtual long | size () const =0 |
| Return the size of the value in bytes. | |
| virtual Value * | clone () const =0 |
| Return a pointer to a copy of itself (deep copy). The caller owns this copy and is responsible to delete it! | |
| virtual std::ostream & | write (std::ostream &os) const =0 |
| 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). | |
| virtual long | toLong (long n=0) const =0 |
| Convert the n-th component of the value to a long. The behaviour of this method may be undefined if there is no n-th component. | |
| virtual float | toFloat (long n=0) const =0 |
| Convert the n-th component of the value to a float. The behaviour of this method may be undefined if there is no n-th component. | |
| virtual Rational | toRational (long n=0) const =0 |
| Convert the n-th component of the value to a Rational. The behaviour of this method may be undefined if there is no n-th component. | |
Static Public Member Functions | |
| Value * | create (TypeId typeId) |
| A (simple) factory to create a Value type. | |
Protected Member Functions | |
| Value & | operator= (const Value &rhs) |
| Assignment operator. Protected so that it can only be used by subclasses but not directly. | |
The interface provides a uniform way to access values independent from their actual C++ type for simple tasks like reading the values from a string or data buffer. For other tasks, like modifying values you may need to downcast it to the actual subclass of Value so that you can access the subclass specific interface.
|
||||||||||||
|
Write value to a data buffer. The user must ensure that the buffer has enough memory. Otherwise the call results in undefined behaviour.
Implemented in Exiv2::DataValue, Exiv2::StringValueBase, Exiv2::DateValue, Exiv2::TimeValue, and Exiv2::ValueType< T >.
|
|
|
A (simple) factory to create a Value type.
The following Value subclasses are created depending on typeId:
|
|
|
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.
Implemented in Exiv2::DataValue, Exiv2::StringValueBase, Exiv2::AsciiValue, Exiv2::DateValue, Exiv2::TimeValue, and Exiv2::ValueType< T >.
|
|
||||||||||||||||
|
Read the value from a character buffer.
Implemented in Exiv2::DataValue, Exiv2::StringValueBase, Exiv2::AsciiValue, Exiv2::DateValue, Exiv2::TimeValue, and Exiv2::ValueType< T >.
|
|
|
Convert the n-th component of the value to a float. The behaviour of this method may be undefined if there is no n-th component.
Implemented in Exiv2::DataValue, Exiv2::StringValueBase, Exiv2::DateValue, Exiv2::TimeValue, and Exiv2::ValueType< T >.
|
|
|
Convert the n-th component of the value to a long. The behaviour of this method may be undefined if there is no n-th component.
Implemented in Exiv2::DataValue, Exiv2::StringValueBase, Exiv2::DateValue, Exiv2::TimeValue, and Exiv2::ValueType< T >.
|
|
|
Convert the n-th component of the value to a Rational. The behaviour of this method may be undefined if there is no n-th component.
Implemented in Exiv2::DataValue, Exiv2::StringValueBase, Exiv2::DateValue, Exiv2::TimeValue, and Exiv2::ValueType< T >.
|
1.3.8