Page Menu
Home
GnuPG
Search
Configure Global Search
Log In
Paste
P26
[PATCH] cpp: Expose gpgme_data_set_flag through cpp API
Active
Public
Actions
Authored by
•
aheinecke
on Jun 16 2023, 12:33 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Tags
None
Subscribers
None
From ad3b755de3bae50d8ac823f61132ca49ad94d731 Mon Sep 17 00:00:00 2001
From: Andre Heinecke <aheinecke@gnupg.org>
Date: Fri, 16 Jun 2023 12:30:51 +0200
Subject: [PATCH] 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.
---
NEWS | 3 +++
lang/cpp/src/data.cpp | 5 +++++
lang/cpp/src/data.h | 3 +++
3 files changed, 11 insertions(+)
diff --git a/NEWS b/NEWS
index 33b58f38..ec8024fd 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,9 @@ Noteworthy changes in version 1.21.0 (unreleased)
* Error::isCanceled now also returns true for error code
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)
-------------------------------------------------
diff --git a/lang/cpp/src/data.cpp b/lang/cpp/src/data.cpp
index dd8b1740..54d156c3 100644
--- a/lang/cpp/src/data.cpp
+++ b/lang/cpp/src/data.cpp
@@ -280,3 +280,8 @@ std::string GpgME::Data::toString()
seek (0, SEEK_SET);
return ret;
}
+
+GpgME::Error GpgME::Data::setFlag(const char *name, const char *value)
+{
+ return Error(gpgme_data_set_flag(d->data, name, value));
+}
diff --git a/lang/cpp/src/data.h b/lang/cpp/src/data.h
index 9a5d5b0c..7b098049 100644
--- a/lang/cpp/src/data.h
+++ b/lang/cpp/src/data.h
@@ -122,6 +122,9 @@ public:
/** Return a copy of the data as std::string. Sets seek pos to 0 */
std::string toString();
+ /** Accessor to gpgme_data_set_flag */
+ Error setFlag(const char *name, const char *value);
+
class Private;
Private *impl()
{
--
2.41.0
Event Timeline
•
aheinecke
created this paste.
Jun 16 2023, 12:33 PM
2023-06-16 12:33:25 (UTC+2)
Log In to Comment