cpp: Add convenience overload to set file name

* lang/cpp/src/data.h, lang/cpp/src/data.cpp (setFileName): Add
overload.
--

GnuPG-bug-id: 6342
This commit is contained in:
Ingo Klöcker 2023-01-27 09:37:05 +01:00
parent 1328a57586
commit 261245a2e0
No known key found for this signature in database
GPG Key ID: F5A5D1692277A1E9
3 changed files with 7 additions and 0 deletions

1
NEWS
View File

@ -42,6 +42,7 @@ Noteworthy changes in version 1.18.1 (unreleased)
gpgme_op_verify_ext NEW.
cpp: GpgGenCardKeyInteractor::Curve NEW.
cpp: GpgGenCardKeyInteractor::setCurve NEW.
cpp: Data::setFileName EXTENDED: New overload
qt: ListAllKeysJob::Option NEW.
qt: ListAllKeysJob::Options NEW.
qt: ListAllKeysJob::setOptions NEW.

View File

@ -217,6 +217,11 @@ GpgME::Error GpgME::Data::setFileName(const char *name)
return Error(gpgme_data_set_file_name(d->data, name));
}
GpgME::Error GpgME::Data::setFileName(const std::string &name)
{
return Error(gpgme_data_set_file_name(d->data, name.c_str()));
}
ssize_t GpgME::Data::read(void *buffer, size_t length)
{
return gpgme_data_read(d->data, buffer, length);

View File

@ -106,6 +106,7 @@ public:
char *fileName() const;
Error setFileName(const char *name);
Error setFileName(const std::string &name);
ssize_t read(void *buffer, size_t length);
ssize_t write(const void *buffer, size_t length);