diff options
author | Andre Heinecke <[email protected]> | 2016-07-01 14:49:06 +0000 |
---|---|---|
committer | Andre Heinecke <[email protected]> | 2016-07-01 14:52:34 +0000 |
commit | 93c5d420fcfe275aeff2b3d5ce99629edbe6625d (patch) | |
tree | 8939cb19cc9a8dce8b9f3e7401962dd55e53131e /lang/cpp/src/verificationresult.cpp | |
parent | core: Clarify documentation of tofu_stats address (diff) | |
download | gpgme-93c5d420fcfe275aeff2b3d5ce99629edbe6625d.tar.gz gpgme-93c5d420fcfe275aeff2b3d5ce99629edbe6625d.zip |
Cpp: Add TofuInfo to signatures
* lang/cpp/src/tofuinfo.cpp, lang/cpp/src/tofuinfo.h: New class.
* lang/cpp/src/verificationresult.cpp (Signature::tofuInfo): New.
(VerificationResult::Private): Handle tofu info.
(GpgME::operator<<(std::ostream &os, const Signature &sig)): Include
TofuInfo in dump.
* lang/cpp/src/verificationresult.h (Signature::tofuInfo): New.
* lang/cpp/src/Makefile.am (main_sources, gpgmepp_headers): Add
new files.
* configure.ac (LIBGPGMEPP_LT_REVISION): Bump for new API.
Diffstat (limited to 'lang/cpp/src/verificationresult.cpp')
-rw-r--r-- | lang/cpp/src/verificationresult.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lang/cpp/src/verificationresult.cpp b/lang/cpp/src/verificationresult.cpp index b6fde7da..4bd1a7b1 100644 --- a/lang/cpp/src/verificationresult.cpp +++ b/lang/cpp/src/verificationresult.cpp @@ -24,6 +24,7 @@ #include <notation.h> #include "result_p.h" #include "util.h" +#include "tofuinfo.h" #include <gpgme.h> @@ -81,6 +82,11 @@ public: } nota.back().push_back(n); } + // copy tofu info: + tinfos.push_back(std::vector<TofuInfo>()); + for (gpgme_tofu_info_t in = is->tofu; in ; in = in->next) { + tinfos.back().push_back(TofuInfo(in)); + } } } ~Private() @@ -107,6 +113,7 @@ public: std::vector<gpgme_signature_t> sigs; std::vector< std::vector<Nota> > nota; + std::vector< std::vector<TofuInfo> > tinfos; std::vector<char *> purls; std::string file_name; }; @@ -363,6 +370,15 @@ std::vector<GpgME::Notation> GpgME::Signature::notations() const return result; } +std::vector<GpgME::TofuInfo> GpgME::Signature::tofuInfo() const +{ + if (isNull()) { + return std::vector<GpgME::TofuInfo>(); + } + + return d->tinfos[idx]; +} + class GpgME::Notation::Private { public: @@ -530,6 +546,9 @@ std::ostream &GpgME::operator<<(std::ostream &os, const Signature &sig) const std::vector<Notation> nota = sig.notations(); std::copy(nota.begin(), nota.end(), std::ostream_iterator<Notation>(os, "\n")); + const std::vector<TofuInfo> tinfos = sig.tofuInfo(); + std::copy(tinfos.begin(), tinfos.end(), + std::ostream_iterator<TofuInfo>(os, "\n")); } return os << ')'; } |