aboutsummaryrefslogtreecommitdiffstats
path: root/lang/cpp/src/data.h
diff options
context:
space:
mode:
authorAndre Heinecke <[email protected]>2017-03-22 15:38:35 +0000
committerAndre Heinecke <[email protected]>2017-03-22 15:43:33 +0000
commit8ddb42ada46f00d8393f6c2df7d6b79a4a5878f0 (patch)
tree0c440c121b54f53330e42da51dc561e85227b851 /lang/cpp/src/data.h
parentqt: Initialize library first in tests (diff)
downloadgpgme-8ddb42ada46f00d8393f6c2df7d6b79a4a5878f0.tar.gz
gpgme-8ddb42ada46f00d8393f6c2df7d6b79a4a5878f0.zip
cpp: Wrap keylist_from_data
* lang/cpp/data.h, lang/cpp/data.cpp (GpgME::Data::toKeys): New. -- Doing this in data instead of Context is a bit more idiomatic. But this could also be added to Context.
Diffstat (limited to '')
-rw-r--r--lang/cpp/src/data.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/lang/cpp/src/data.h b/lang/cpp/src/data.h
index 50bdf627..cc7906fb 100644
--- a/lang/cpp/src/data.h
+++ b/lang/cpp/src/data.h
@@ -24,6 +24,7 @@
#define __GPGMEPP_DATA_H__
#include "global.h"
+#include "key.h"
#include <sys/types.h> // for size_t, off_t
#include <cstdio> // FILE
@@ -109,6 +110,10 @@ public:
ssize_t write(const void *buffer, size_t length);
off_t seek(off_t offset, int whence);
+ /** 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;
+
class Private;
Private *impl()
{