Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Examples

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 (const MakerNote::MnTagInfo *pMnTagInfo=0, bool alloc=true)
 Constructor. Takes an optional makernote info tag array and allows to choose whether or not memory management is required for the Entries.
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.
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'.
Entries::iterator begin ()
 The first makernote entry.
Entries::iterator end ()
 End of the makernote entries.
Accessors
Entries::const_iterator begin () const
 The first makernote entry.
Entries::const_iterator end () const
 End of the makernote entries.
Entries::const_iterator findIdx (int idx) const
 Find an entry by idx, return a const iterator to the record.
long size () const
 Return the size of the makernote in bytes.
AutoPtr clone (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.
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.
virtual std::string ifdItem () const =0
 Return the name of the makernote item.
virtual std::ostream & printTag (std::ostream &os, uint16_t tag, const Value &value) const =0
 Interpret and print the value of a makernote tag.

Protected Attributes

bool absOffset_
 True: Adjustment of the IFD offsets is to be added to the offset from the start of the TIFF header, 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, and Exiv2::SigmaMakerNote.

IfdMakerNote::AutoPtr Exiv2::IfdMakerNote::clone 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 clone. 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, and Exiv2::SigmaMakerNote.

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.

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


The documentation for this class was generated from the following files:
Generated on Sun Dec 12 17:54:08 2004 for Exiv2 by  doxygen 1.3.9.1