[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a
Maximiliano Curia
maxy at moszumanska.debian.org
Thu Jul 13 17:36:02 UTC 2017
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=e97918b
The following commit has been merged in the master branch:
commit e97918b15f7c6358300618ad299cce202c63a7db
Author: Andreas Huggel <ahuggel at gmx.net>
Date: Thu Feb 12 15:54:01 2004 +0000
Added operator=, clarified documentation
---
src/value.cpp | 27 +++++++++++++++++++++++++--
src/value.hpp | 36 +++++++++++++++++++++++++++++++++---
2 files changed, 58 insertions(+), 5 deletions(-)
diff --git a/src/value.cpp b/src/value.cpp
index c2434f0..d35ee84 100644
--- a/src/value.cpp
+++ b/src/value.cpp
@@ -20,14 +20,14 @@
*/
/*
File: value.cpp
- Version: $Name: $ $Revision: 1.1 $
+ Version: $Name: $ $Revision: 1.2 $
Author(s): Andreas Huggel (ahu) <ahuggel at gmx.net>
History: 26-Jan-04, ahu: created
11-Feb-04, ahu: isolated as a component
*/
// *****************************************************************************
#include "rcsid.hpp"
-EXIV2_RCSID("@(#) $Name: $ $Revision: 1.1 $ $RCSfile: value.cpp,v $")
+EXIV2_RCSID("@(#) $Name: $ $Revision: 1.2 $ $RCSfile: value.cpp,v $")
// *****************************************************************************
// included header files
@@ -42,6 +42,13 @@ EXIV2_RCSID("@(#) $Name: $ $Revision: 1.1 $ $RCSfile: value.cpp,v $")
// class member definitions
namespace Exif {
+ Value& Value::operator=(const Value& rhs)
+ {
+ if (this == &rhs) return *this;
+ type_ = rhs.type_;
+ return *this;
+ }
+
Value* Value::create(TypeId typeId)
{
Value* value = 0;
@@ -93,6 +100,14 @@ namespace Exif {
return os.str();
}
+ DataValue& DataValue::operator=(const DataValue& rhs)
+ {
+ if (this == &rhs) return *this;
+ Value::operator=(rhs);
+ value_ = rhs.value_;
+ return *this;
+ }
+
void DataValue::read(const char* buf, long len, ByteOrder byteOrder)
{
// byteOrder not needed
@@ -134,6 +149,14 @@ namespace Exif {
return os;
}
+ AsciiValue& AsciiValue::operator=(const AsciiValue& rhs)
+ {
+ if (this == &rhs) return *this;
+ Value::operator=(rhs);
+ value_ = rhs.value_;
+ return *this;
+ }
+
void AsciiValue::read(const char* buf, long len, ByteOrder byteOrder)
{
// byteOrder not needed
diff --git a/src/value.hpp b/src/value.hpp
index 8f37571..18711f7 100644
--- a/src/value.hpp
+++ b/src/value.hpp
@@ -21,7 +21,7 @@
/*!
@file value.hpp
@brief Value interface and concrete subclasses
- @version $Name: $ $Revision: 1.1 $
+ @version $Name: $ $Revision: 1.2 $
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel at gmx.net">ahuggel at gmx.net</a>
@date 09-Jan-04, ahu: created
@@ -113,7 +113,10 @@ namespace Exif {
@return The converted value.
*/
virtual long toLong(long n =0) const =0;
- //! Return the value as a string
+ /*!
+ @brief Return the value as a string. Implemented in terms of
+ write(std::ostream& os) const of the concrete class.
+ */
std::string toString() const;
//! Return the type identifier (Exif data format type).
@@ -145,8 +148,15 @@ namespace Exif {
*/
static Value* create(TypeId typeId);
+ protected:
+ /*!
+ @brief Assignment operator. Protected so that it can only be used
+ by subclasses but not directly.
+ */
+ Value& operator=(const Value& rhs);
+
private:
- const uint16 type_; //!< Type of the data
+ uint16 type_; //!< Type of the data
}; // class Value
@@ -161,6 +171,8 @@ namespace Exif {
public:
//! Default constructor.
DataValue(TypeId typeId =undefined) : Value(typeId) {}
+ //! Assignment operator.
+ DataValue& operator=(const DataValue& rhs);
/*!
@brief Read the value from a character buffer. The byte order is
required by the interface but not used by this method.
@@ -200,6 +212,8 @@ namespace Exif {
public:
//! Default constructor.
AsciiValue() : Value(asciiString) {}
+ //! Assignment operator.
+ AsciiValue& operator=(const AsciiValue& rhs);
/*!
@brief Read the value from a character buffer. The byte order is
required by the interface but not used by this method.
@@ -230,6 +244,11 @@ namespace Exif {
virtual long count() const { return size(); }
virtual long size() const;
virtual Value* clone() const;
+ /*!
+ @brief Write the value to an output stream. One trailing '\0'
+ character of the ASCII value is stripped if present and not
+ written to the output stream.
+ */
virtual std::ostream& write(std::ostream& os) const;
virtual long toLong(long n =0) const { return value_[n]; }
@@ -247,6 +266,8 @@ namespace Exif {
public:
//! Default constructor.
ValueType() : Value(getType<T>()) {}
+ //! Assignment operator.
+ ValueType<T>& operator=(const ValueType<T>& rhs);
virtual void read(const char* buf, long len, ByteOrder byteOrder);
/*!
@brief Set the data from a string of values of type T (e.g.,
@@ -413,6 +434,15 @@ namespace Exif {
}
template<typename T>
+ ValueType<T>& ValueType<T>::operator=(const ValueType<T>& rhs)
+ {
+ if (this == &rhs) return *this;
+ Value::operator=(rhs);
+ value_ = rhs.value_;
+ return *this;
+ }
+
+ template<typename T>
void ValueType<T>::read(const char* buf, long len, ByteOrder byteOrder)
{
value_.clear();
--
exiv2 packaging
More information about the pkg-kde-commits
mailing list