aboutsummaryrefslogtreecommitdiffstats
path: root/lang/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'lang/cpp/src')
-rw-r--r--lang/cpp/src/data.cpp6
-rw-r--r--lang/cpp/src/data.h4
2 files changed, 10 insertions, 0 deletions
diff --git a/lang/cpp/src/data.cpp b/lang/cpp/src/data.cpp
index 54d156c3..cf43b5bd 100644
--- a/lang/cpp/src/data.cpp
+++ b/lang/cpp/src/data.cpp
@@ -285,3 +285,9 @@ GpgME::Error GpgME::Data::setFlag(const char *name, const char *value)
{
return Error(gpgme_data_set_flag(d->data, name, value));
}
+
+GpgME::Error GpgME::Data::setSizeHint(uint64_t size)
+{
+ const std::string val = std::to_string(size);
+ return Error(gpgme_data_set_flag(d->data, "size-hint", val.c_str()));
+}
diff --git a/lang/cpp/src/data.h b/lang/cpp/src/data.h
index ea394804..178bc309 100644
--- a/lang/cpp/src/data.h
+++ b/lang/cpp/src/data.h
@@ -27,6 +27,7 @@
#include "key.h"
#include <sys/types.h> // for size_t, off_t
+#include <cstdint> // unit64_t
#include <cstdio> // FILE
#include <algorithm>
#include <memory>
@@ -125,6 +126,9 @@ public:
/** See gpgme_data_set_flag */
Error setFlag(const char *name, const char *value);
+ /** Set a size hint for this data e.g. for progress calculations. */
+ Error setSizeHint(uint64_t size);
+
class Private;
Private *impl()
{