diff options
author | Andre Heinecke <[email protected]> | 2018-10-25 12:09:37 +0000 |
---|---|---|
committer | Andre Heinecke <[email protected]> | 2018-10-25 12:13:39 +0000 |
commit | 05a0e97f5c12c06082fbeab0fba6f86ddbfbe6b2 (patch) | |
tree | a4851683b953ecd515889d1412d289e77b086197 /lang/cpp/src/context.h | |
parent | docs: python howto (diff) | |
download | gpgme-05a0e97f5c12c06082fbeab0fba6f86ddbfbe6b2.tar.gz gpgme-05a0e97f5c12c06082fbeab0fba6f86ddbfbe6b2.zip |
cpp: Add some convenience functions
* lang/cpp/src/context.cpp (Context::create): New.
* lang/cpp/src/context.h: Update accordingly.
* lang/cpp/src/key.cpp, lang/cpp/src/key.h:
(Key::isBad, Subkey::isBad, UserID::isBad)
(UserID::Signature::isBad): Add shorthand for the isX checks.
* NEWS: Mention it.
--
I don't know how often I wrote:
if (key.isNull() || key.isExpired() || key.isRevoked() ...
And for the context it is good practice to use a unique ptr
so the API should make it easy.
Diffstat (limited to 'lang/cpp/src/context.h')
-rw-r--r-- | lang/cpp/src/context.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lang/cpp/src/context.h b/lang/cpp/src/context.h index 6e27daa6..d3700e03 100644 --- a/lang/cpp/src/context.h +++ b/lang/cpp/src/context.h @@ -68,6 +68,8 @@ public: // static Context *createForProtocol(Protocol proto); + /** Same as above but returning a unique ptr. */ + static std::unique_ptr<Context> create(Protocol proto); static std::unique_ptr<Context> createForEngine(Engine engine, Error *err = 0); virtual ~Context(); |