From 618aa7f08db41911f25632d9fba23bca80908ebe Mon Sep 17 00:00:00 2001 From: Andre Heinecke Date: Tue, 29 May 2018 09:16:22 +0200 Subject: cpp: Add gpgme_data_rewind to cpp API * lang/cpp/src/data.h, lang/cpp/src/data.cpp (Data::rewind): New. * lang/qt/tests/t-various.cpp (testDataRewind): Test it. -- The advantage of this convieniance function in GPGME is that it avoids the messiness that are declarations with off_t. GnuPG-Bug-Id: T3996 --- lang/cpp/src/data.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lang/cpp/src/data.h') diff --git a/lang/cpp/src/data.h b/lang/cpp/src/data.h index 446f6fa3..df8607e7 100644 --- a/lang/cpp/src/data.h +++ b/lang/cpp/src/data.h @@ -110,6 +110,9 @@ public: ssize_t write(const void *buffer, size_t length); off_t seek(off_t offset, int whence); + /* Convenience function to do a seek (0, SEEK_SET). */ + Error rewind(); + /** Try to parse the data to a key object using the * Protocol proto. Returns an empty list on error.*/ std::vector toKeys(const Protocol proto = Protocol::OpenPGP) const; -- cgit v1.2.3