From 8ddb42ada46f00d8393f6c2df7d6b79a4a5878f0 Mon Sep 17 00:00:00 2001 From: Andre Heinecke Date: Wed, 22 Mar 2017 16:38:35 +0100 Subject: 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. --- lang/cpp/src/data.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lang/cpp/src/data.h') 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 // for size_t, off_t #include // 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 toKeys(const Protocol proto = Protocol::OpenPGP) const; + class Private; Private *impl() { -- cgit v1.2.3