From 1bb162a54ba480413c4da07f2578efe6860494c0 Mon Sep 17 00:00:00 2001 From: Andre Heinecke Date: Mon, 11 Apr 2016 17:02:04 +0200 Subject: Cpp: Add string comparators for keys * lang/cpp/src/global.h (GPGMEPP_MAKE_STRCMP): New. (_gpgmepp_strcmp): NULL save wrapper around std::strcmp. * lang/cpp/src/key.h: Add comparators for various attributes. -- This was taken from libkleo predicates.h. Appears generally useful. --- lang/cpp/src/key.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lang/cpp/src/key.h') diff --git a/lang/cpp/src/key.h b/lang/cpp/src/key.h index a87a35cf..30badeaa 100644 --- a/lang/cpp/src/key.h +++ b/lang/cpp/src/key.h @@ -353,4 +353,9 @@ GPGMEPP_MAKE_STD_SWAP_SPECIALIZATION(Subkey) GPGMEPP_MAKE_STD_SWAP_SPECIALIZATION(UserID) GPGMEPP_MAKE_STD_SWAP_SPECIALIZATION(UserID::Signature) +GPGMEPP_MAKE_STRCMP(ByFingerprint, .primaryFingerprint()); +GPGMEPP_MAKE_STRCMP(ByKeyID, .keyID()); +GPGMEPP_MAKE_STRCMP(ByShortKeyID, .shortKeyID()); +GPGMEPP_MAKE_STRCMP(ByChainID, .chainID()); + #endif // __GPGMEPP_KEY_H__ -- cgit v1.2.3