From 370ee1aa802ec6a4030a39b2df7d24a0c47e5ac7 Mon Sep 17 00:00:00 2001 From: Andre Heinecke Date: Wed, 5 Oct 2016 16:43:16 +0200 Subject: [PATCH] cpp: Add support for URL Data encodings * lang/cpp/src/data.h (Data::Encoding): Extend enum. * lang/cpp/src/data.cpp (Data::encoding), Data::setEncoding): Support new values. --- lang/cpp/src/data.cpp | 6 ++++++ lang/cpp/src/data.h | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lang/cpp/src/data.cpp b/lang/cpp/src/data.cpp index 84ed336d..2cb4fa88 100644 --- a/lang/cpp/src/data.cpp +++ b/lang/cpp/src/data.cpp @@ -161,6 +161,9 @@ GpgME::Data::Encoding GpgME::Data::encoding() const case GPGME_DATA_ENCODING_BASE64: return Base64Encoding; case GPGME_DATA_ENCODING_ARMOR: return ArmorEncoding; case GPGME_DATA_ENCODING_MIME: return MimeEncoding; + case GPGME_DATA_ENCODING_URL: return UrlEncoding; + case GPGME_DATA_ENCODING_URLESC: return UrlEscEncoding; + case GPGME_DATA_ENCODING_URL0: return Url0Encoding; } return AutoEncoding; } @@ -174,6 +177,9 @@ GpgME::Error GpgME::Data::setEncoding(Encoding enc) case Base64Encoding: ge = GPGME_DATA_ENCODING_BASE64; break; case ArmorEncoding: ge = GPGME_DATA_ENCODING_ARMOR; break; case MimeEncoding: ge = GPGME_DATA_ENCODING_MIME; break; + case UrlEncoding: ge = GPGME_DATA_ENCODING_URL; break; + case UrlEscEncoding: ge = GPGME_DATA_ENCODING_URLESC; break; + case Url0Encoding: ge = GPGME_DATA_ENCODING_URL0; break; } return Error(gpgme_data_set_encoding(d->data, ge)); } diff --git a/lang/cpp/src/data.h b/lang/cpp/src/data.h index b2f2173f..50bdf627 100644 --- a/lang/cpp/src/data.h +++ b/lang/cpp/src/data.h @@ -78,7 +78,10 @@ public: BinaryEncoding, Base64Encoding, ArmorEncoding, - MimeEncoding + MimeEncoding, + UrlEncoding, + UrlEscEncoding, + Url0Encoding, }; Encoding encoding() const; Error setEncoding(Encoding encoding);