# types.hpp File Reference

Type definitions for Exiv2 and related functionality. More...

`#include "exv_conf.h"`
`#include <string>`
`#include <iosfwd>`
`#include <utility>`
`#include <sstream>`
`#include <cstdio>`
`#include <stdint.h>`

Include dependency graph for types.hpp:

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

## Namespaces

namespace | Exiv2

## Classes

struct | Exiv2::TypeInfoTable
| Information pertaining to the defined types. More...
class | Exiv2::TypeInfo
| Type information lookup functions. Implemented as a static class. More...
struct | Exiv2::DataBufRef
| Auxiliary type to enable copies and assignments, similar to std::auto_ptr_ref. See http://www.josuttis.com/libbook/auto_ptr.html for a discussion. More...
class | Exiv2::DataBuf
| Utility class containing a character array. All it does is to take care of memory allocation and deletion. Its primary use is meant to be as a stack variable in functions that need a temporary data buffer. Todo: this should be some sort of smart pointer, essentially an std::auto_ptr for a character array. But it isn't... More...

## Typedefs

typedef uint8_t | Exiv2::byte
| 1 byte unsigned integer type.
typedef std::pair< uint32_t, uint32_t > | Exiv2::URational
| 8 byte unsigned rational type.
typedef std::pair< int32_t, int32_t > | Exiv2::Rational
| 8 byte signed rational type.

## Enumerations

enum | Exiv2::ByteOrder { invalidByteOrder, littleEndian, bigEndian }
| Type to express the byte order (little or big endian).
enum | Exiv2::TypeId { invalidTypeId, unsignedByte, asciiString, unsignedShort, unsignedLong, unsignedRational, invalid6, undefined, signedShort, signedLong, signedRational, string, date, time, comment, lastTypeId }
| Type identifiers for IFD format types.
enum | Exiv2::IfdId { ifdIdNotSet, ifd0Id, exifIfdId, gpsIfdId, iopIfdId, ifd1Id, canonIfdId, canonCs1IfdId, canonCs2IfdId, canonCfIfdId, fujiIfdId, nikon1IfdId, nikon2IfdId, nikon3IfdId, olympusIfdId, panasonicIfdId, sigmaIfdId, sonyIfdId, lastIfdId }
| Type to specify the IFD to which a metadata belongs.

## Functions

uint16_t | Exiv2::getUShort (const byte *buf, ByteOrder byteOrder)
| Read a 2 byte unsigned short value from the data buffer.
uint32_t | Exiv2::getULong (const byte *buf, ByteOrder byteOrder)
| Read a 4 byte unsigned long value from the data buffer.
URational | Exiv2::getURational (const byte *buf, ByteOrder byteOrder)
| Read an 8 byte unsigned rational value from the data buffer.
int16_t | Exiv2::getShort (const byte *buf, ByteOrder byteOrder)
| Read a 2 byte signed short value from the data buffer.
int32_t | Exiv2::getLong (const byte *buf, ByteOrder byteOrder)
| Read a 4 byte signed long value from the data buffer.
Rational | Exiv2::getRational (const byte *buf, ByteOrder byteOrder)
| Read an 8 byte signed rational value from the data buffer.
std::ostream & | Exiv2::operator<< (std::ostream &os, const Rational &r)
| Output operator for our fake rational.
std::istream & | Exiv2::operator>> (std::istream &is, Rational &r)
| Input operator for our fake rational.
std::ostream & | Exiv2::operator<< (std::ostream &os, const URational &r)
| Output operator for our fake unsigned rational.
std::istream & | Exiv2::operator>> (std::istream &is, URational &r)
| Input operator for our fake unsigned rational.
long | Exiv2::us2Data (byte *buf, uint16_t s, ByteOrder byteOrder)
| Convert an unsigned short to data, write the data to the buffer, return number of bytes written.
long | Exiv2::ul2Data (byte *buf, uint32_t l, ByteOrder byteOrder)
| Convert an unsigned long to data, write the data to the buffer, return number of bytes written.
long | Exiv2::ur2Data (byte *buf, URational l, ByteOrder byteOrder)
| Convert an unsigned rational to data, write the data to the buffer, return number of bytes written.
long | Exiv2::s2Data (byte *buf, int16_t s, ByteOrder byteOrder)
| Convert a signed short to data, write the data to the buffer, return number of bytes written.
long | Exiv2::l2Data (byte *buf, int32_t l, ByteOrder byteOrder)
| Convert a signed long to data, write the data to the buffer, return number of bytes written.
long | Exiv2::r2Data (byte *buf, Rational l, ByteOrder byteOrder)
| Convert a signed rational to data, write the data to the buffer, return number of bytes written.
void | Exiv2::hexdump (std::ostream &os, const byte *buf, long len, long offset)
| Print len bytes from buf in hex and ASCII format to the given stream, prefixed with the position in the buffer adjusted by offset.
int | Exiv2::gcd (int a, int b)
| Return the greatest common denominator of integers a and b. Both parameters must be greater than 0.
long | Exiv2::lgcd (long a, long b)
| Return the greatest common denominator of long values a and b. Both parameters must be greater than 0.
bool | Exiv2::isHex (const std::string &str, size_t size, const std::string &prefix)
| Return true if str is a hex number starting with prefix followed by size hex digits, false otherwise. If size is 0, any number of digits is allowed and all are checked.
template<typename T>
std::string | Exiv2::toString (const T &arg)
| Utility function to convert the argument of any type to a string.

## Detailed Description

Type definitions for Exiv2 and related functionality.

Version:
  Rev
    581

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