Exiv2::IfdMakerNote Class Reference

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

#include <makernote.hpp>

Inheritance diagram for Exiv2::IfdMakerNote:

Inheritance graph
[legend]
Collaboration diagram for Exiv2::IfdMakerNote:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::auto_ptr< IfdMakerNoteAutoPtr
 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, ByteOrder byteOrder, long offset)
 Read the makernote, including the makernote header, from character buffer buf of length len at position offset (from the start of the TIFF header) and encoded in byte order byteOrder. Return 0 if successful.
virtual int readHeader (const byte *buf, long len, ByteOrder byteOrder)
 Read the makernote header from the makernote databuffer. This method must set the offset adjustment (adjOffset_), 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 absOffset_
 True: Adjustment of the IFD offsets is to be added to the offset from the start of the TIFF header (i.e., the start of the Exif data section), False: Adjustment of the IFD offsets is a suitable absolute value. Ignore the offset from the start of the TIFF header.
long adjOffset_
 Adjustment of the IFD offsets relative to the start of the TIFF header or to the start of the makernote, depending on the setting of absOffset_.
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

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::SigmaMakerNote, and Exiv2::SonyMakerNote.

IfdMakerNote::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::Nikon1MakerNote, Exiv2::Nikon2MakerNote, Exiv2::Nikon3MakerNote, Exiv2::OlympusMakerNote, Exiv2::PanasonicMakerNote, Exiv2::SigmaMakerNote, and Exiv2::SonyMakerNote.

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.

IfdMakerNote::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::Nikon1MakerNote, Exiv2::Nikon2MakerNote, Exiv2::Nikon3MakerNote, Exiv2::OlympusMakerNote, Exiv2::PanasonicMakerNote, Exiv2::SigmaMakerNote, and Exiv2::SonyMakerNote.

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.

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 adjustment (adjOffset_), 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::SigmaMakerNote, and Exiv2::SonyMakerNote.

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.


The documentation for this class was generated from the following files:
Generated on Sun Feb 26 04:28:38 2006 for Exiv2 by  doxygen 1.4.6