aboutsummaryrefslogtreecommitdiffstats
path: root/lang/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'lang/cpp/src')
-rw-r--r--lang/cpp/src/data.cpp5
-rw-r--r--lang/cpp/src/data.h3
2 files changed, 8 insertions, 0 deletions
diff --git a/lang/cpp/src/data.cpp b/lang/cpp/src/data.cpp
index 52b8da24..2782aa79 100644
--- a/lang/cpp/src/data.cpp
+++ b/lang/cpp/src/data.cpp
@@ -232,6 +232,11 @@ off_t GpgME::Data::seek(off_t offset, int whence)
return gpgme_data_seek(d->data, offset, whence);
}
+GpgME::Error GpgME::Data::rewind()
+{
+ return Error(gpgme_data_rewind(d->data));
+}
+
std::vector<GpgME::Key> GpgME::Data::toKeys(Protocol proto) const
{
std::vector<GpgME::Key> ret;
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<Key> toKeys(const Protocol proto = Protocol::OpenPGP) const;