From b8a7b77ade11d3c5bc44a1b4acd965b42243c7ff Mon Sep 17 00:00:00 2001 From: Andreas Huggel Date: Tue, 8 Mar 2005 13:59:22 +0000 Subject: [PATCH] Removed void AsciiValue::read(const byte*, long, ByteOrder); instead use that of the baseclass, which does not add a trailing null. Adding a null can cause a metacopy operation to write from metadata instead of simply copying the metadata. --- src/value.cpp | 7 ------- src/value.hpp | 14 -------------- 2 files changed, 21 deletions(-) diff --git a/src/value.cpp b/src/value.cpp index ac889dad..8c7e89d5 100644 --- a/src/value.cpp +++ b/src/value.cpp @@ -224,13 +224,6 @@ namespace Exiv2 { return *this; } - void AsciiValue::read(const byte* buf, long len, ByteOrder byteOrder) - { - // byteOrder not needed - value_ = std::string(reinterpret_cast(buf), len); - if (value_[value_.size()-1] != '\0') value_ += '\0'; - } - void AsciiValue::read(const std::string& buf) { value_ = buf; diff --git a/src/value.hpp b/src/value.hpp index a2b83a34..8ddc92b6 100644 --- a/src/value.hpp +++ b/src/value.hpp @@ -467,20 +467,6 @@ namespace Exiv2 { //@{ //! Assignment operator AsciiValue& operator=(const AsciiValue& rhs); - /*! - @brief Read the value from a character buffer. Appends a terminating - '\\0' character if buf doesn't end with 0. - - @note The byte order is required by the interface but not used by this - method, so just use the default. - - @param buf Pointer to the data buffer to read from - @param len Number of bytes in the data buffer - @param byteOrder Byte order. Not needed. - */ - virtual void read(const byte* buf, - long len, - ByteOrder byteOrder =invalidByteOrder); /*! @brief Set the value to that of the string buf. Overrides base class to append a terminating '\\0' character if buf doesn't end