Exiv2: Exiv2::IfdMakerNote Class Reference

- Main Page
- Namespaces
- Classes
- Files
- Examples

- Search for |

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# Exiv2::IfdMakerNote Class Reference

Interface for MakerNotes in IFD format. See MakerNote. More...

`#include <makernote.hpp>`

Inheritance diagram for Exiv2::IfdMakerNote:

[legend]
Collaboration diagram for Exiv2::IfdMakerNote:

[legend]

List of all members.

## Public Types
typedef std::auto_ptr < IfdMakerNote > | AutoPtr
| Shortcut for an IfdMakerNote auto pointer.
## Public Member Functions
Creators
| IfdMakerNote (IfdId ifdId, bool alloc=true, bool hasNext=true)
| Constructor. Requires an Ifd id and allows to choose whether or not memory management is needed for the Entries and whether the IFD has a next pointer.
| IfdMakerNote (const IfdMakerNote &rhs)
| Copy constructor.
virtual | ~IfdMakerNote ()
| Virtual destructor.
Manipulators
virtual int | read (const byte *buf, long len, long start, ByteOrder byteOrder, long shift)
| Read the makernote, including the makernote header, from the Exif data buffer.
virtual int | readHeader (const byte *buf, long len, ByteOrder byteOrder)
| Read the makernote header from the makernote databuffer. This method must set the offset to the start of the IFD (start_), if needed (assuming that the required information is in the header). Return 0 if successful.
virtual long | copy (byte *buf, ByteOrder byteOrder, long offset)
| Copy (write) the makerNote to the character buffer buf at position offset (from the start of the TIFF header), encoded in byte order byteOrder. Update internal offsets if necessary. Return the number of bytes written.
virtual void | add (const Entry &entry)
| Add the entry to the makernote. No duplicate-check is performed, i.e., it is possible to add multiple entries with the same tag. The memory allocation mode of the entry to be added must be the same as that of the makernote and the IFD id of the entry must be set to 'makerIfd'.
virtual Entries::iterator | begin ()
| The first makernote entry.
virtual Entries::iterator | end ()
| End of the makernote entries.
virtual void | updateBase (byte *pNewBase)
| Update the base pointer of the MakerNote and all its entries to pNewBase.
Accessors
virtual Entries::const_iterator | begin () const
| The first makernote entry.
virtual Entries::const_iterator | end () const
| End of the makernote entries.
virtual Entries::const_iterator | findIdx (int idx) const
| Find an entry by idx, return a const iterator to the record.
virtual long | size () const
| Return the size of the makernote in bytes.
AutoPtr | create (bool alloc=true) const
| Return an auto-pointer to an newly created, empty instance of the same type as this. The makernote entries are not copied. The caller owns the new object and the auto-pointer ensures that it will be deleted.
AutoPtr | clone () const
| Return an auto-pointer to a clone of this object. The caller owns the new object and the auto-pointer ensures that it will be deleted.
virtual int | checkHeader () const
| Check the makernote header. This will typically check if a required prefix string is present in the header. Return 0 if successful.
virtual long | copyHeader (byte *buf) const
| Write the makernote header to a character buffer, return the number of characters written.
virtual long | headerSize () const
| Return the size of the makernote header in bytes.
## Protected Attributes
bool | absShift_
| True: IFD offsets are relative to the start of the TIFF header (i.e., the start of the Exif data section) + shift_ False: IFD offsets are relative to the start of the makernote + shift_.
long | shift_
| Adjustment for IFD offsets, see absShift_.
long | start_
| Start of the makernote IFD relative to the start of the makernote.
DataBuf | header_
| Data buffer for the makernote header.
Ifd | ifd_
| The makernote IFD.

## Detailed Description

Interface for MakerNotes in IFD format. See MakerNote.

## Member Function Documentation

virtual int Exiv2::IfdMakerNote::read | ( | const byte * | buf,
|  | long | len,
|  | long | start,
|  | ByteOrder | byteOrder,
|  | long | shift |
| ) |  |  | `[virtual]`

Read the makernote, including the makernote header, from the Exif data buffer.

Parameters:

  | buf | Pointer to the Exif data buffer that contains the MakerNote to decode. The buffer should contain all Exif data starting from the TIFF header.
  | len | Number of bytes in the Exif data buffer
  | start | MakerNote starts at buf + start.
  | byteOrder | Applicable byte order (little or big endian).
  | shift | IFD offsets are relative to buf + shift.

Returns:
  0 if successful.

Implements Exiv2::MakerNote.

Reimplemented in Exiv2::CanonMakerNote, and Exiv2::MinoltaMakerNote.

virtual int Exiv2::IfdMakerNote::readHeader | ( | const byte * | buf,
|  | long | len,
|  | ByteOrder | byteOrder |
| ) |  |  | `[virtual]`

Read the makernote header from the makernote databuffer. This method must set the offset to the start of the IFD (start_), if needed (assuming that the required information is in the header). Return 0 if successful.

Note:
  The default implementation does nothing, assuming there is no header

Reimplemented in Exiv2::FujiMakerNote, Exiv2::Nikon2MakerNote, Exiv2::Nikon3MakerNote, Exiv2::OlympusMakerNote, Exiv2::PanasonicMakerNote, Exiv2::PentaxMakerNote, Exiv2::SigmaMakerNote, and Exiv2::SonyMakerNote.

virtual void Exiv2::IfdMakerNote::updateBase | ( | byte * | pNewBase | ) | `[virtual]`

Update the base pointer of the MakerNote and all its entries to pNewBase.

Allows to re-locate the underlying data buffer to a new location pNewBase. This method only has an effect in non-alloc mode.

Implements Exiv2::MakerNote.

Reimplemented in Exiv2::CanonMakerNote, and Exiv2::MinoltaMakerNote.

AutoPtr Exiv2::IfdMakerNote::create | ( | bool | alloc = `true` | ) | const

Return an auto-pointer to an newly created, empty instance of the same type as this. The makernote entries are not copied. The caller owns the new object and the auto-pointer ensures that it will be deleted.

Parameters:

  | alloc | Memory management model for the newly created object. Indicates if memory required to store data should be allocated and deallocated (true) or not (false). If false, only pointers to the buffer provided to read() will be kept. See Ifd for more background on this concept.

Reimplemented from Exiv2::MakerNote.

Reimplemented in Exiv2::CanonMakerNote, Exiv2::FujiMakerNote, Exiv2::MinoltaMakerNote, Exiv2::Nikon1MakerNote, Exiv2::Nikon2MakerNote, Exiv2::Nikon3MakerNote, Exiv2::OlympusMakerNote, Exiv2::PanasonicMakerNote, Exiv2::PentaxMakerNote, Exiv2::SigmaMakerNote, and Exiv2::SonyMakerNote.

AutoPtr Exiv2::IfdMakerNote::clone | ( |  | ) | const

Return an auto-pointer to a clone of this object. The caller owns the new object and the auto-pointer ensures that it will be deleted.

Note:
  In non-alloc mode the clone potentially contains pointers to the same data buffer as the original. Use updateBase(byte* pNewBase) to adjust them.

Reimplemented from Exiv2::MakerNote.

Reimplemented in Exiv2::CanonMakerNote, Exiv2::FujiMakerNote, Exiv2::MinoltaMakerNote, Exiv2::Nikon1MakerNote, Exiv2::Nikon2MakerNote, Exiv2::Nikon3MakerNote, Exiv2::OlympusMakerNote, Exiv2::PanasonicMakerNote, Exiv2::PentaxMakerNote, Exiv2::SigmaMakerNote, and Exiv2::SonyMakerNote.

virtual int Exiv2::IfdMakerNote::checkHeader | ( |  | ) | const`[virtual]`

Check the makernote header. This will typically check if a required prefix string is present in the header. Return 0 if successful.

Note:
  The default implementation does nothing, assuming there is no header

Reimplemented in Exiv2::FujiMakerNote, Exiv2::Nikon2MakerNote, Exiv2::Nikon3MakerNote, Exiv2::OlympusMakerNote, Exiv2::PanasonicMakerNote, Exiv2::PentaxMakerNote, Exiv2::SigmaMakerNote, and Exiv2::SonyMakerNote.

virtual long Exiv2::IfdMakerNote::copyHeader | ( | byte * | buf | ) | const`[virtual]`

Write the makernote header to a character buffer, return the number of characters written.

Note:
  The default implementation copies the header_ buffer.

virtual long Exiv2::IfdMakerNote::headerSize | ( |  | ) | const`[virtual]`

Return the size of the makernote header in bytes.

Note:
  The default implementation returns the size of the header_ buffer.

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

- makernote.hpp