[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:15 UTC 2017


Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=445fc06

The following commit has been merged in the master branch:
commit 445fc06343f6e57e732f4e0f104d19e4f518b188
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Sat Apr 3 03:45:01 2004 +0000

    Added DataBuf
---
 src/types.hpp | 31 ++++++++++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/src/types.hpp b/src/types.hpp
index 30b1f23..39cf47b 100644
--- a/src/types.hpp
+++ b/src/types.hpp
@@ -21,7 +21,7 @@
 /*!
   @file    types.hpp
   @brief   Type definitions for Exiv2 and related functionality
-  @version $Name:  $ $Revision: 1.7 $
+  @version $Name:  $ $Revision: 1.8 $
   @author  Andreas Huggel (ahu)
            <a href="mailto:ahuggel at gmx.net">ahuggel at gmx.net</a>
   @date    09-Jan-04, ahu: created
@@ -104,6 +104,35 @@ namespace Exif {
         static const TypeInfoTable typeInfoTable_[];
     };
 
+    /*!
+      @brief Utility class containing a character array. All it does is to take
+             care of memory allocation and deletion. Its primary use is meant to
+             be as a stack variable in functions that need a temporary data
+             buffer. Todo: this should be some sort of smart pointer,
+             essentially an std:auto_ptr for a character array. But it isn't.
+     */
+    class DataBuf {
+        // Not implemented
+        //! Copy constructor
+        DataBuf(const DataBuf&);
+        //! Assignment operator
+        DataBuf& operator=(const DataBuf&);
+    public:
+        //! Default constructor
+        DataBuf() : size_(0), pData_(0) {}
+        //! Constructor with an initial buffer size 
+        DataBuf(long size) : size_(size), pData_(new char[size]) {}
+        //! Destructor, deletes the allocated buffer
+        ~DataBuf() { delete[] pData_; }
+        //! Allocate a data buffer of the given size
+        void alloc(long size)
+            { delete pData_; size_ = size; pData_ = new char[size]; }
+        //! The current size of the buffer
+        long size_; 
+        //! Pointer to the buffer, 0 if none has been allocated
+        char* pData_;
+    }; // class DataBuf
+
 // *****************************************************************************
 // free functions
 

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list