Exiv2: Exiv2::ExvImage Class Reference

# Exiv2::ExvImage Class Reference

Helper class to access Exiv2 files. More...

`#include <jpgimage.hpp>`

Inheritance diagram for Exiv2::ExvImage:
[legend]
Collaboration diagram for Exiv2::ExvImage:
[legend]

List of all members.

## Public Member Functions
Creators
| ExvImage (BasicIo::AutoPtr io, bool create)
| Constructor that can either open an existing EXV image or create a new image from scratch. If a new image is to be created, any existing data is overwritten. Since the constructor can not return a result, callers should check the good() method after object construction to determine success or failure.
Accessors
std::string | mimeType () const
| Return the MIME type of the image.
## Protected Member Functions
Accessors
bool | isThisType (BasicIo &iIo, bool advance) const
| Determine if the content of the BasicIo instance is of the type supported by this class.
Manipulators
int | writeHeader (BasicIo &oIo) const
| Writes the image header (aka signature) to the BasicIo instance.
## Friends
bool | isExvType (BasicIo &iIo, bool advance)
| Check if the file iIo is an EXV file.

## Detailed Description

Helper class to access Exiv2 files.

## Constructor & Destructor Documentation

Exiv2::ExvImage::ExvImage | ( | BasicIo::AutoPtr | io,
|  | bool | create |
| ) |  |  |

Constructor that can either open an existing EXV image or create a new image from scratch. If a new image is to be created, any existing data is overwritten. Since the constructor can not return a result, callers should check the good() method after object construction to determine success or failure.

Parameters:

  | io | An auto-pointer that owns a BasicIo instance used for reading and writing image metadata. Important: The constructor takes ownership of the passed in BasicIo instance through the auto-pointer. Callers should not continue to use the BasicIo instance after it is passed to this method. Use the Image::io() method to get a temporary reference.
  | create | Specifies if an existing image should be read (false) or if a new file should be created (true).

## Member Function Documentation

std::string Exiv2::ExvImage::mimeType | ( |  | ) | const`[inline, virtual]`

Return the MIME type of the image.

Note:
  For each supported image format, the library knows only one MIME type. This may not be the most specific MIME type for that format. In particular, several RAW formats are variants of the TIFF format with the same magic as TIFF itself. Class TiffImage handles most of them and thus they all have MIME type "image/tiff", although a more specific MIME type may exist (e.g., "image/x-nikon-nef").

Implements Exiv2::Image.

bool Exiv2::ExvImage::isThisType | ( | BasicIo & | iIo,
|  | bool | advance |
| ) |  |  | const`[protected, virtual]`

Determine if the content of the BasicIo instance is of the type supported by this class.

The advance flag determines if the read position in the stream is moved (see below). This applies only if the type matches and the function returns true. If the type does not match, the stream position is not changed. However, if reading from the stream fails, the stream position is undefined. Consult the stream state to obtain more information in this case.

Parameters:

  | iIo | BasicIo instance to read from.
  | advance | Flag indicating whether the position of the io should be advanced by the number of characters read to analyse the data (true) or left at its original position (false). This applies only if the type matches.

Returns:
  true if the data matches the type of this class;
  false if the data does not match

Implements Exiv2::JpegBase.

int Exiv2::ExvImage::writeHeader | ( | BasicIo & | oIo | ) | const`[protected, virtual]`

Writes the image header (aka signature) to the BasicIo instance.

Parameters:

  | oIo | BasicIo instance that the header is written to.

Returns:
  0 if successful;
  4 if the output file can not be written to

Implements Exiv2::JpegBase.

The documentation for this class was generated from the following file:

- jpgimage.hpp