diff options
author | Andre Heinecke <[email protected]> | 2016-04-11 13:50:17 +0000 |
---|---|---|
committer | Andre Heinecke <[email protected]> | 2016-04-11 15:00:59 +0000 |
commit | 691950e18cf08a3f9bbc2004501834cd47bea579 (patch) | |
tree | 25253f07fa380bb00b89e5a8f0461f90e6e40379 /lang/cpp/src/context.cpp | |
parent | Add pthread in gpgmepp config (diff) | |
download | gpgme-691950e18cf08a3f9bbc2004501834cd47bea579.tar.gz gpgme-691950e18cf08a3f9bbc2004501834cd47bea579.zip |
Cpp: Remove last usages of boost
* lang/cpp/src/configuration.cpp: Use std::remove_pointer.
(Configuration::operator<<): std::for_each.
* lang/cpp/src/context.cpp: Delete manually instead of scoped ptr.
* lang/cpp/src/scdgetinfoassuantransaction.cpp: Use static_assert.
(to_reader_list): Tokenize with getline.
Diffstat (limited to 'lang/cpp/src/context.cpp')
-rw-r--r-- | lang/cpp/src/context.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lang/cpp/src/context.cpp b/lang/cpp/src/context.cpp index 398836c9..93244b41 100644 --- a/lang/cpp/src/context.cpp +++ b/lang/cpp/src/context.cpp @@ -45,8 +45,6 @@ #include <gpgme.h> -#include <boost/scoped_array.hpp> - #include <istream> #ifndef NDEBUG #include <iostream> @@ -584,7 +582,7 @@ ImportResult Context::importKeys(const std::vector<Key> &kk) d->lasterr = make_error(GPG_ERR_NOT_IMPLEMENTED); bool shouldHaveResult = false; - const boost::scoped_array<gpgme_key_t> keys(new gpgme_key_t[ kk.size() + 1 ]); + gpgme_key_t * const keys = new gpgme_key_t[ kk.size() + 1 ]; gpgme_key_t *keys_it = &keys[0]; for (std::vector<Key>::const_iterator it = kk.begin(), end = kk.end() ; it != end ; ++it) { if (it->impl()) { @@ -592,7 +590,7 @@ ImportResult Context::importKeys(const std::vector<Key> &kk) } } *keys_it++ = 0; - d->lasterr = gpgme_op_import_keys(d->ctx, keys.get()); + d->lasterr = gpgme_op_import_keys(d->ctx, keys); shouldHaveResult = true; if ((gpgme_err_code(d->lasterr) == GPG_ERR_NOT_IMPLEMENTED || gpgme_err_code(d->lasterr) == GPG_ERR_NOT_SUPPORTED) && @@ -623,6 +621,7 @@ ImportResult Context::importKeys(const std::vector<Key> &kk) shouldHaveResult = true; } } + delete[] keys; if (shouldHaveResult) { return ImportResult(d->ctx, Error(d->lasterr)); } else { @@ -640,7 +639,7 @@ Error Context::startKeyImport(const Data &data) Error Context::startKeyImport(const std::vector<Key> &kk) { d->lastop = Private::Import; - const boost::scoped_array<gpgme_key_t> keys(new gpgme_key_t[ kk.size() + 1 ]); + gpgme_key_t * const keys = new gpgme_key_t[ kk.size() + 1 ]; gpgme_key_t *keys_it = &keys[0]; for (std::vector<Key>::const_iterator it = kk.begin(), end = kk.end() ; it != end ; ++it) { if (it->impl()) { @@ -648,7 +647,9 @@ Error Context::startKeyImport(const std::vector<Key> &kk) } } *keys_it++ = 0; - return Error(d->lasterr = gpgme_op_import_keys_start(d->ctx, keys.get())); + Error err = Error(d->lasterr = gpgme_op_import_keys_start(d->ctx, keys)); + delete[] keys; + return err; } ImportResult Context::importResult() const |