Exiv2
Classes | Namespaces | Defines | Typedefs | Enumerations | Functions

types.hpp File Reference

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

#include "exv_conf.h"
#include "version.hpp"
#include <string>
#include <vector>
#include <iosfwd>
#include <utility>
#include <algorithm>
#include <sstream>
#include <stdint.h>
Include dependency graph for types.hpp:
This graph shows which files directly or indirectly include this file:

Classes

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. More...

Namespaces

namespace  Exiv2
 

Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of the objects of this namespace.


Defines

#define EXV_CALL_MEMBER_FN(object, ptrToMember)   ((object).*(ptrToMember))
 Macro to make calls to member functions through a pointer more readable. See the C++ FAQ LITE, item [33.5] How can I avoid syntax errors when calling a member function using a pointer-to-member-function?.
#define EXV_MIN(a, b)   ((a) < (b) ? (a) : (b))
 Simple common min macro.
#define EXV_MAX(a, b)   ((a) > (b) ? (a) : (b))
 Simple common max macro.
#define EXV_COUNTOF(a)   (sizeof(Exiv2::sizer(a)))
 Macro to determine the size of an array.

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.
typedef std::vector< byte > Exiv2::Blob
 Container for binary data.

Enumerations

enum  Exiv2::ByteOrder { invalidByteOrder, littleEndian, bigEndian }
 

Type to express the byte order (little or big endian)


enum  Exiv2::WriteMethod { wmIntrusive, wmNonIntrusive }
 

Type to indicate write method used by TIFF parsers.


enum  Exiv2::MetadataId {
  mdNone = 0, mdExif = 1, mdIptc = 2, mdComment = 4,
  mdXmp = 8
}
 

An identifier for each type of metadata.


enum  Exiv2::AccessMode { amNone = 0, amRead = 1, amWrite = 2, amReadWrite = 3 }
 

An identifier for each mode of metadata support.


enum  Exiv2::TypeId {
  Exiv2::unsignedByte = 1, Exiv2::asciiString = 2, Exiv2::unsignedShort = 3, Exiv2::unsignedLong = 4,
  Exiv2::unsignedRational = 5, Exiv2::signedByte = 6, Exiv2::undefined = 7, Exiv2::signedShort = 8,
  Exiv2::signedLong = 9, Exiv2::signedRational = 10, Exiv2::tiffFloat = 11, Exiv2::tiffDouble = 12,
  Exiv2::tiffIfd = 13, Exiv2::string = 0x10000, Exiv2::date = 0x10001, Exiv2::time = 0x10002,
  Exiv2::comment = 0x10003, Exiv2::directory = 0x10004, Exiv2::xmpText = 0x10005, Exiv2::xmpAlt = 0x10006,
  Exiv2::xmpBag = 0x10007, Exiv2::xmpSeq = 0x10008, Exiv2::langAlt = 0x10009, Exiv2::invalidTypeId = 0x1fffe,
  Exiv2::lastTypeId = 0x1ffff
}
 

Exiv2 value type identifiers.

More...
enum  Exiv2::IfdId {
  ifdIdNotSet, ifd0Id, exifIfdId, gpsIfdId,
  iopIfdId, ifd1Id, ifd2Id, ifd3Id,
  subImage1Id, subImage2Id, subImage3Id, subImage4Id,
  subImage5Id, subImage6Id, subImage7Id, subImage8Id,
  subImage9Id, mnIfdId, canonIfdId, canonCsIfdId,
  canonSiIfdId, canonCfIfdId, canonPiIfdId, canonPaIfdId,
  canonFiIfdId, fujiIfdId, minoltaIfdId, minoltaCs5DIfdId,
  minoltaCs7DIfdId, minoltaCsOldIfdId, minoltaCsNewIfdId, nikon1IfdId,
  nikon2IfdId, nikon3IfdId, nikonPvIfdId, nikonVrIfdId,
  nikonPcIfdId, nikonWtIfdId, nikonIiIfdId, nikonAfIfdId,
  nikonAf2IfdId, nikonFiIfdId, nikonMeIfdId, nikonFl1IfdId,
  nikonFl2IfdId, nikonFl3IfdId, nikonSi1IfdId, nikonSi2IfdId,
  nikonSi3IfdId, nikonSi4IfdId, nikonSi5IfdId, nikonSi6IfdId,
  nikonLd1IfdId, nikonLd2IfdId, nikonLd3IfdId, nikonCb1IfdId,
  nikonCb2IfdId, nikonCb2aIfdId, nikonCb2bIfdId, nikonCb3IfdId,
  nikonCb4IfdId, olympusIfdId, olympus2IfdId, olympusCsIfdId,
  olympusEqIfdId, olympusRdIfdId, olympusRd2IfdId, olympusIpIfdId,
  olympusFiIfdId, olympusFe1IfdId, olympusFe2IfdId, olympusFe3IfdId,
  olympusFe4IfdId, olympusFe5IfdId, olympusFe6IfdId, olympusFe7IfdId,
  olympusFe8IfdId, olympusFe9IfdId, olympusRiIfdId, panasonicIfdId,
  panaRawIfdId, pentaxIfdId, sigmaIfdId, sony1IfdId,
  sony2IfdId, sonyMltIfdId, sony1CsIfdId, sony1Cs2IfdId,
  sony2CsIfdId, sony2Cs2IfdId, sony1MltCs7DIfdId, sony1MltCsOldIfdId,
  sony1MltCsNewIfdId, sony1MltCsA100IfdId, 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=0)
 Print len bytes from buf in hex and ASCII format to the given stream, prefixed with the position in the buffer adjusted by offset.
bool Exiv2::isHex (const std::string &str, size_t size=0, 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.
int Exiv2::exifTime (const char *buf, struct tm *tm)
 Converts a string in the form "%Y:%m:%d %H:%M:%S", e.g., "2007:05:24 12:31:55" to broken down time format, returns 0 if successful, else 1.
const char * Exiv2::exvGettext (const char *str)
 Translate a string using the gettext framework. This wrapper hides all the implementation details from the interface.
long Exiv2::parseLong (const std::string &s, bool &ok)
 Return a long set to the value represented by s.
float Exiv2::parseFloat (const std::string &s, bool &ok)
 Return a float set to the value represented by s.
Rational Exiv2::parseRational (const std::string &s, bool &ok)
 Return a Rational set to the value represented by s.
Rational Exiv2::floatToRationalCast (float f)
 Very simple conversion of a float to a Rational.
template<typename T , typename K , int N>
const T * Exiv2::find (T(&src)[N], const K &key)
 Find an element that matches key in the array src.
template<typename T , int N>
char(& Exiv2::sizer (T(&)[N]))[N]
 Template used in the COUNTOF macro to determine the size of an array.
template<typename T >
std::string Exiv2::toString (const T &arg)
 Utility function to convert the argument of any type to a string.
template<typename T >
Exiv2::stringTo (const std::string &s, bool &ok)
 Utility function to convert a string to a value of type T.
template<>
bool Exiv2::stringTo< bool > (const std::string &s, bool &ok)
 Specialization of stringTo(const std::string& s, bool& ok) for bool.
template<typename IntType >
IntType Exiv2::gcd (IntType n, IntType m)
 Return the greatest common denominator of n and m. (Implementation from Boost rational.hpp)

Detailed Description

Type definitions for Exiv2 and related functionality.

Version:
Rev:
2239
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
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines