[gexiv2] Fix compatibility with exiv2 master



commit e21ad09ba375384778ca0f0a0c5890dd41e5bb30
Author: Jens Georg <mail jensge org>
Date:   Sun Dec 15 15:45:13 2019 +0100

    Fix compatibility with exiv2 master

 gexiv2/gexiv2-metadata.cpp  |  9 ++++++---
 gexiv2/gexiv2-stream-io.cpp | 10 ++++++++++
 gexiv2/gexiv2-stream-io.h   |  1 +
 3 files changed, 17 insertions(+), 3 deletions(-)
---
diff --git a/gexiv2/gexiv2-metadata.cpp b/gexiv2/gexiv2-metadata.cpp
index 73e1538..35ee46d 100644
--- a/gexiv2/gexiv2-metadata.cpp
+++ b/gexiv2/gexiv2-metadata.cpp
@@ -86,9 +86,8 @@ public:
     size_type write(BasicIo &src) { return 0; }
     int putb(Exiv2::byte data) { return EOF; }
 
-
-    Exiv2::DataBuf read(long rcount) {
-        Exiv2::DataBuf b{static_cast<GioIo::size_type>(rcount)};
+    Exiv2::DataBuf read(size_t rcount) {
+        Exiv2::DataBuf b{rcount};
 
         auto bytes_read = this->read(b.pData_, rcount);
         if (bytes_read > 0 && bytes_read != rcount) {
@@ -98,6 +97,10 @@ public:
         return b;
     }
 
+    Exiv2::DataBuf read(long rcount) {
+        return read(static_cast<GioIo::size_type> (rcount));
+    }
+
     size_type read(Exiv2::byte *buf, size_type rcount) {
         GError *error = NULL;
         gssize result = 0;
diff --git a/gexiv2/gexiv2-stream-io.cpp b/gexiv2/gexiv2-stream-io.cpp
index ecd8293..4fb1583 100644
--- a/gexiv2/gexiv2-stream-io.cpp
+++ b/gexiv2/gexiv2-stream-io.cpp
@@ -163,6 +163,16 @@ int StreamIo::close () {
     return 0;
 }
 
+Exiv2::DataBuf StreamIo::read (size_t read_count) {
+    Exiv2::DataBuf buffer (read_count);
+
+    long read_bytes = read (buffer.pData_, buffer.size_);
+
+    buffer.size_ = read_bytes;
+
+    return buffer;
+}
+
 Exiv2::DataBuf StreamIo::read (long read_count) {
     Exiv2::DataBuf buffer (read_count);
     
diff --git a/gexiv2/gexiv2-stream-io.h b/gexiv2/gexiv2-stream-io.h
index aa6c4f0..655675c 100644
--- a/gexiv2/gexiv2-stream-io.h
+++ b/gexiv2/gexiv2-stream-io.h
@@ -39,6 +39,7 @@ public:
        virtual size_type write (Exiv2::BasicIo& src);
        virtual int putb (Exiv2::byte data);
        virtual Exiv2::DataBuf read (long rcount);
+       Exiv2::DataBuf read (size_t rcount);
        virtual size_type read (Exiv2::byte* buf, size_type rcount);
        virtual int getb ();
        virtual void transfer (Exiv2::BasicIo& src);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]