diff options
author | Andre Heinecke <[email protected]> | 2016-08-09 11:07:30 +0000 |
---|---|---|
committer | Andre Heinecke <[email protected]> | 2016-08-09 12:23:51 +0000 |
commit | 17372393798ea5e2d6838f3dd1e001dd4a66c941 (patch) | |
tree | 7b2c46759cfbae78c0953e7809604d31c46f7d68 /lang/cpp/src/context.cpp | |
parent | Cpp: Fix simple symmetric encryption (diff) | |
download | gpgme-17372393798ea5e2d6838f3dd1e001dd4a66c941.tar.gz gpgme-17372393798ea5e2d6838f3dd1e001dd4a66c941.zip |
Cpp: Add support for all EncryptionFlags
* lang/cpp/src/context.h (EncryptionFlags): Extend.
* lang/cpp/src/context.cpp (encryptflags2encryptflags): Ditto.
Diffstat (limited to 'lang/cpp/src/context.cpp')
-rw-r--r-- | lang/cpp/src/context.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lang/cpp/src/context.cpp b/lang/cpp/src/context.cpp index 814e5a82..d63573f0 100644 --- a/lang/cpp/src/context.cpp +++ b/lang/cpp/src/context.cpp @@ -1094,6 +1094,18 @@ static gpgme_encrypt_flags_t encryptflags2encryptflags(Context::EncryptionFlags if (flags & Context::NoEncryptTo) { result |= GPGME_ENCRYPT_NO_ENCRYPT_TO; } + if (flags & Context::Prepare) { + result |= GPGME_ENCRYPT_PREPARE; + } + if (flags & Context::ExpectSign) { + result |= GPGME_ENCRYPT_EXPECT_SIGN; + } + if (flags & Context::NoCompress) { + result |= GPGME_ENCRYPT_NO_COMPRESS; + } + if (flags & Context::Symmetric) { + result |= GPGME_ENCRYPT_SYMMETRIC; + } return static_cast<gpgme_encrypt_flags_t>(result); } @@ -1395,6 +1407,11 @@ std::ostream &operator<<(std::ostream &os, Context::EncryptionFlags flags) os << "GpgME::Context::EncryptionFlags("; #define CHECK( x ) if ( !(flags & (Context::x)) ) {} else do { os << #x " "; } while (0) CHECK(AlwaysTrust); + CHECK(NoEncryptTo); + CHECK(Prepare); + CHECK(ExpectSign); + CHECK(NoCompress); + CHECK(Symmetric); #undef CHECK return os << ')'; } |