cpp: Expose gpgme_data_set_flag through cpp API

* lang/cpp/src/data.cpp (Data::setFlag): New.
* lang/cpp/src/data.h: Update accordingly.
* NEWS: Mention this.

--
This exposes the generic flag mechanism for data to users
of the C++ library. It is similar to Context::setFlag but
has no getter.
This commit is contained in:
Andre Heinecke 2023-06-16 12:30:51 +02:00
parent 91bbb1e482
commit cbcea4a09b
No known key found for this signature in database
GPG Key ID: 2978E9D40CBABA5C
3 changed files with 11 additions and 0 deletions

3
NEWS
View File

@ -4,6 +4,9 @@ Noteworthy changes in version 1.21.0 (unreleased)
* Error::isCanceled now also returns true for error code * Error::isCanceled now also returns true for error code
GPG_ERR_FULLY_CANCELED. [T6510] GPG_ERR_FULLY_CANCELED. [T6510]
* Interface changes relative to the 1.20.0 release:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cpp: Data::setFlag NEW.
Noteworthy changes in version 1.20.0 (2023-04-20) Noteworthy changes in version 1.20.0 (2023-04-20)
------------------------------------------------- -------------------------------------------------

View File

@ -280,3 +280,8 @@ std::string GpgME::Data::toString()
seek (0, SEEK_SET); seek (0, SEEK_SET);
return ret; return ret;
} }
GpgME::Error GpgME::Data::setFlag(const char *name, const char *value)
{
return Error(gpgme_data_set_flag(d->data, name, value));
}

View File

@ -122,6 +122,9 @@ public:
/** Return a copy of the data as std::string. Sets seek pos to 0 */ /** Return a copy of the data as std::string. Sets seek pos to 0 */
std::string toString(); std::string toString();
/** See gpgme_data_set_flag */
Error setFlag(const char *name, const char *value);
class Private; class Private;
Private *impl() Private *impl()
{ {