cpp: Add some convenience functions
authorAndre Heinecke <aheinecke@intevation.de>
Thu, 25 Oct 2018 12:09:37 +0000 (14:09 +0200)
committerAndre Heinecke <aheinecke@intevation.de>
Thu, 25 Oct 2018 12:13:39 +0000 (14:13 +0200)
commit05a0e97f5c12c06082fbeab0fba6f86ddbfbe6b2
treea4851683b953ecd515889d1412d289e77b086197
parent04791c896712857feaf9a472a48d7a4c4f287775
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.
NEWS
lang/cpp/src/context.cpp
lang/cpp/src/context.h
lang/cpp/src/key.cpp
lang/cpp/src/key.h