Fixed IFD to update internal offsets on copy() => copy is not const anymore

v0.27.3
Andreas Huggel 22 years ago
parent 59643bd4e1
commit a1e3bf545f

@ -20,7 +20,7 @@
*/ */
/* /*
File: makernote.cpp File: makernote.cpp
Version: $Name: $ $Revision: 1.2 $ Version: $Name: $ $Revision: 1.3 $
Author(s): Andreas Huggel (ahu) <ahuggel@gmx.net> Author(s): Andreas Huggel (ahu) <ahuggel@gmx.net>
History: 18-Feb-04, ahu: created History: 18-Feb-04, ahu: created
Credits: Canon MakerNote implemented according to the specification Credits: Canon MakerNote implemented according to the specification
@ -29,7 +29,7 @@
*/ */
// ***************************************************************************** // *****************************************************************************
#include "rcsid.hpp" #include "rcsid.hpp"
EXIV2_RCSID("@(#) $Name: $ $Revision: 1.2 $ $RCSfile: makernote.cpp,v $") EXIV2_RCSID("@(#) $Name: $ $Revision: 1.3 $ $RCSfile: makernote.cpp,v $")
// ***************************************************************************** // *****************************************************************************
// included header files // included header files
@ -298,7 +298,7 @@ namespace Exif {
return rc; return rc;
} }
long IfdMakerNote::copy(char* buf, ByteOrder byteOrder, long offset) const long IfdMakerNote::copy(char* buf, ByteOrder byteOrder, long offset)
{ {
return ifd_.copy(buf, byteOrder, offset); return ifd_.copy(buf, byteOrder, offset);
} }

@ -21,7 +21,7 @@
/*! /*!
@file makernote.hpp @file makernote.hpp
@brief @brief
@version $Name: $ $Revision: 1.2 $ @version $Name: $ $Revision: 1.3 $
@author Andreas Huggel (ahu) @author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a> <a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@date 18-Feb-04, ahu: created @date 18-Feb-04, ahu: created
@ -98,9 +98,10 @@ namespace Exif {
/*! /*!
@brief Copy (write) the makerNote to the character buffer buf at @brief Copy (write) the makerNote to the character buffer buf at
position offset (from the start of the TIFF header), encoded position offset (from the start of the TIFF header), encoded
in byte order byteOrder. Return the number of bytes written. in byte order byteOrder. Update internal offsets if necessary.
Return the number of bytes written.
*/ */
virtual long copy(char* buf, ByteOrder byteOrder, long offset) const =0; virtual long copy(char* buf, ByteOrder byteOrder, long offset) =0;
//! @name Accessors //! @name Accessors
//@{ //@{
@ -260,7 +261,7 @@ namespace Exif {
virtual MakerNote* clone() const =0; virtual MakerNote* clone() const =0;
int read(const char* buf, long len, ByteOrder byteOrder, long offset); int read(const char* buf, long len, ByteOrder byteOrder, long offset);
long copy(char* buf, ByteOrder byteOrder, long offset) const; long copy(char* buf, ByteOrder byteOrder, long offset);
long size() const; long size() const;
Entries::const_iterator begin() const { return ifd_.begin(); } Entries::const_iterator begin() const { return ifd_.begin(); }
Entries::const_iterator end() const { return ifd_.end(); } Entries::const_iterator end() const { return ifd_.end(); }

Loading…
Cancel
Save