refinery
RAW file processor
Public Member Functions

refinery::InMemoryExifData Class Reference

An in-memory, fake Exif data container. More...

#include <refinery/exif.h>

Inheritance diagram for refinery::InMemoryExifData:
Inheritance graph
[legend]
Collaboration diagram for refinery::InMemoryExifData:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 InMemoryExifData ()
 constructor.
 ~InMemoryExifData ()
 destructor.
virtual bool hasKey (const char *key) const
 True iff the Exif data contains the given key.
virtual std::string getString (const char *key) const
 Returns the specified Exif value as a string.
virtual void getBytes (const char *key, std::vector< byte > &outBytes) const
 Copies the specified Exif value into a byte-array.
virtual int getInt (const char *key) const
 Returns the specified Exif value as an int.
virtual float getFloat (const char *key) const
 Returns the specified Exif value as a float.
virtual void setString (const char *key, const std::string &s)
 Sets a string Exif datum.

Detailed Description

An in-memory, fake Exif data container.

This only returns Exif data that has been set in it programmatically. It's useful for testing or as a base class for other Exif parsers.

 InMemoryExifData exifData;
 exifData.setString("Exif.Image.Model", "NIKON D5000");
 std::string model(exifData.getString("Exif.Image.Model"));
 std::cout << "Camera: " << model << std::endl;

Definition at line 97 of file exif.h.


Constructor & Destructor Documentation

refinery::InMemoryExifData::InMemoryExifData ( )

constructor.

refinery::InMemoryExifData::~InMemoryExifData ( )

destructor.


Member Function Documentation

virtual void refinery::InMemoryExifData::getBytes ( const char *  key,
std::vector< byte > &  outBytes 
) const [virtual]

Copies the specified Exif value into a byte-array.

Existing data will be erased.

This throws an error if the Exif data doesn't exist. Use hasKey() to verify that it does before calling this method.

Parameters:
[in]keyExif key, for instance "Exif.Nikon3.LinearizationTable".
[out]outBytesByte-array to fill.

Implements refinery::ExifData.

virtual float refinery::InMemoryExifData::getFloat ( const char *  key) const [virtual]

Returns the specified Exif value as a float.

This throws an error if the Exif data doesn't exist. Use hasKey() to verify that it does before calling this method.

Parameters:
[in]keyExif key, for instance "Exif.Image.XResolution".
Returns:
A float representation of the Exif value.

Implements refinery::ExifData.

virtual int refinery::InMemoryExifData::getInt ( const char *  key) const [virtual]

Returns the specified Exif value as an int.

This throws an error if the Exif data doesn't exist. Use hasKey() to verify that it does before calling this method.

Parameters:
[in]keyExif key, for instance "Exif.Image.Orientation".
Returns:
An int representation of the Exif value.

Implements refinery::ExifData.

virtual std::string refinery::InMemoryExifData::getString ( const char *  key) const [virtual]

Returns the specified Exif value as a string.

This throws an error if the Exif data doesn't exist. Use hasKey() to verify that it does before calling this method.

Parameters:
[in]keyExif key, for instance "Exif.Image.Model".
Returns:
A string representation of the Exif value.

Implements refinery::ExifData.

virtual bool refinery::InMemoryExifData::hasKey ( const char *  key) const [virtual]

True iff the Exif data contains the given key.

Parameters:
[in]keyExif key, for instance "Exif.Image.Orientation".
Returns:
True iff the Exif data contains the key.

Implements refinery::ExifData.

virtual void refinery::InMemoryExifData::setString ( const char *  key,
const std::string &  s 
) [virtual]

Sets a string Exif datum.

Parameters:
[in]keyExif key, for instance "Exif.Image.Model".
[in]sString, for instance "NIKON D5000".

The documentation for this class was generated from the following file:
 All Classes Functions Variables Typedefs Enumerations Enumerator