Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Examples

value.hpp File Reference

Value interface and concrete subclasses. More...

#include "types.hpp"
#include <string>
#include <vector>
#include <iostream>
#include <sstream>
#include <memory>

Include dependency graph for value.hpp:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Namespaces

namespace  Exiv2

Classes

class  Exiv2::Value
 Common interface for all types of values used with metadata. More...
class  Exiv2::DataValue
 Value for an undefined data type. More...
class  Exiv2::StringValueBase
 Abstract base class for a string based Value type. More...
class  Exiv2::StringValue
 Value for string type. More...
class  Exiv2::AsciiValue
 Value for an Ascii string type. More...
class  Exiv2::DateValue
 Value for simple ISO 8601 dates More...
struct  Exiv2::DateValue::Date
 Simple Date helper structure. More...
class  Exiv2::TimeValue
 Value for simple ISO 8601 times. More...
struct  Exiv2::TimeValue::Time
 Simple Time helper structure. More...
class  Exiv2::ValueType< T >
 Template for a Value of a basic type. This is used for unsigned and signed short, long and rationals. More...

Typedefs

typedef ValueType< uint16_t > UShortValue
 Unsigned short value type.
typedef ValueType< uint32_t > ULongValue
 Unsigned long value type.
typedef ValueType< URationalURationalValue
 Unsigned rational value type.
typedef ValueType< int16_t > ShortValue
 Signed short value type.
typedef ValueType< int32_t > LongValue
 Signed long value type.
typedef ValueType< RationalRationalValue
 Signed rational value type.

Functions

std::ostream & operator<< (std::ostream &os, const Value &value)
 Output operator for Value types.
template<typename T>
TypeId getType ()
 Template to determine the TypeId for a type T.
template<>
TypeId getType< uint16_t > ()
 Specialization for an unsigned short.
template<>
TypeId getType< uint32_t > ()
 Specialization for an unsigned long.
template<>
TypeId getType< URational > ()
 Specialization for an unsigned rational.
template<>
TypeId getType< int16_t > ()
 Specialization for a signed short.
template<>
TypeId getType< int32_t > ()
 Specialization for a signed long.
template<>
TypeId getType< Rational > ()
 Specialization for a signed rational.
template<typename T>
getValue (const byte *buf, ByteOrder byteOrder)
 Read a value of type T from the data buffer.
template<typename T>
long toData (byte *buf, T t, ByteOrder byteOrder)
 Convert a value of type T to data, write the data to the data buffer.
template<>
long toData (byte *buf, uint16_t t, ByteOrder byteOrder)
 Specialization to write an unsigned short to the data buffer. Return the number of bytes written.
template<>
long toData (byte *buf, uint32_t t, ByteOrder byteOrder)
 Specialization to write an unsigned long to the data buffer. Return the number of bytes written.
template<>
long toData (byte *buf, URational t, ByteOrder byteOrder)
 Specialization to write an unsigned rational to the data buffer. Return the number of bytes written.
template<>
long toData (byte *buf, int16_t t, ByteOrder byteOrder)
 Specialization to write a signed short to the data buffer. Return the number of bytes written.
template<>
long toData (byte *buf, int32_t t, ByteOrder byteOrder)
 Specialization to write a signed long to the data buffer. Return the number of bytes written.
template<>
long toData (byte *buf, Rational t, ByteOrder byteOrder)
 Specialization to write a signed rational to the data buffer. Return the number of bytes written.

Detailed Description

Value interface and concrete subclasses.

Version:
Rev
402
Author:
Andreas Huggel (ahu) ahuggel@gmx.net
Date:
09-Jan-04, ahu: created 11-Feb-04, ahu: isolated as a component 31-Jul-04, brad: added Time, Data and String values

Function Documentation

template<typename T>
Rational Exiv2::getValue const byte buf,
ByteOrder  byteOrder
[inline]
 

Read a value of type T from the data buffer.

We need this template function for the ValueType template classes. There are only specializations of this function available; no default implementation is provided.

Parameters:
buf Pointer to the data buffer to read from.
byteOrder Applicable byte order (little or big endian).
Returns:
A value of type T.

template<typename T>
long toData byte buf,
t,
ByteOrder  byteOrder
 

Convert a value of type T to data, write the data to the data buffer.

We need this template function for the ValueType template classes. There are only specializations of this function available; no default implementation is provided.

Parameters:
buf Pointer to the data buffer to write to.
t Value to be converted.
byteOrder Applicable byte order (little or big endian).
Returns:
The number of bytes written to the buffer.


Generated on Sun Dec 12 17:54:01 2004 for Exiv2 by  doxygen 1.3.9.1