cpp: Add gpgme_(get)set_ctx_flag

* NEWS: Mention API extensions.
* lang/cpp/src/context.cpp, lang/cpp/src/context.h
(Context::setFlag, Context::getFlag): New.
This commit is contained in:
Andre Heinecke 2018-06-01 11:08:12 +02:00
parent d46768c960
commit 00b027af86
No known key found for this signature in database
GPG Key ID: 2978E9D40CBABA5C
3 changed files with 20 additions and 3 deletions

3
NEWS
View File

@ -10,7 +10,10 @@ Noteworthy changes in version 1.11.2 (unreleased)
gpgme_set_ctx_flag EXTENDED: New flag 'ignore-mdc-error'. gpgme_set_ctx_flag EXTENDED: New flag 'ignore-mdc-error'.
cpp: DecryptionResult::sessionKey NEW. cpp: DecryptionResult::sessionKey NEW.
cpp: DecryptionResult::symkeyAlgo NEW. cpp: DecryptionResult::symkeyAlgo NEW.
cpp: DecryptionResult::isLegacyCipherNoMDC New.
cpp: Data::rewind NEW. cpp: Data::rewind NEW.
cpp: Context::setFlag NEW.
cpp: Context::getFlag NEW.
Noteworthy changes in version 1.11.1 (2018-04-20) Noteworthy changes in version 1.11.1 (2018-04-20)

View File

@ -1478,6 +1478,16 @@ Error Context::startCreateSubkey(const Key &k, const char *algo,
k.impl(), algo, reserved, expires, flags)); k.impl(), algo, reserved, expires, flags));
} }
Error Context::setFlag(const char *name, const char *value)
{
return Error(d->lasterr = gpgme_set_ctx_flag(d->ctx, name, value));
}
const char *Context::getFlag(const char *name) const
{
return gpgme_get_ctx_flag(d->ctx, name);
}
// Engine Spawn stuff // Engine Spawn stuff
Error Context::spawn(const char *file, const char *argv[], Error Context::spawn(const char *file, const char *argv[],
Data &input, Data &output, Data &err, Data &input, Data &output, Data &err,

View File

@ -86,6 +86,9 @@ public:
void setOffline(bool useOfflineMode); void setOffline(bool useOfflineMode);
bool offline() const; bool offline() const;
const char *getFlag(const char *name) const;
Error setFlag(const char *name, const char *value);
enum CertificateInclusion { enum CertificateInclusion {
DefaultCertificates = -256, DefaultCertificates = -256,
AllCertificatesExceptRoot = -2, AllCertificatesExceptRoot = -2,
@ -453,6 +456,7 @@ public:
{ {
return d; return d;
} }
private: private:
// Helper functions that need to be context because they rely // Helper functions that need to be context because they rely
// on the "Friendlyness" of context to access the gpgme types. // on the "Friendlyness" of context to access the gpgme types.