From f9913fa28a27f23fde2d4956c62cbb2fb2bc2ee8 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Thu, 21 Nov 2013 22:16:57 +0100 Subject: Boost/C++11 shared pointers. --- src/security/sasl/SASLContext.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/security/sasl/SASLContext.cpp') diff --git a/src/security/sasl/SASLContext.cpp b/src/security/sasl/SASLContext.cpp index 7b24f1e3..c4d60bd9 100644 --- a/src/security/sasl/SASLContext.cpp +++ b/src/security/sasl/SASLContext.cpp @@ -62,27 +62,27 @@ SASLContext::~SASLContext() } -ref SASLContext::createSession +shared_ptr SASLContext::createSession (const string& serviceName, - ref auth, ref mech) + shared_ptr auth, shared_ptr mech) { - return vmime::create - (serviceName, thisRef().dynamicCast (), auth, mech); + return make_shared + (serviceName, dynamicCast (shared_from_this()), auth, mech); } -ref SASLContext::createMechanism(const string& name) +shared_ptr SASLContext::createMechanism(const string& name) { return SASLMechanismFactory::getInstance()->create - (thisRef().dynamicCast (), name); + (dynamicCast (shared_from_this()), name); } -ref SASLContext::suggestMechanism - (const std::vector >& mechs) +shared_ptr SASLContext::suggestMechanism + (const std::vector >& mechs) { if (mechs.empty()) - return 0; + return null; std::ostringstream oss; @@ -102,7 +102,7 @@ ref SASLContext::suggestMechanism } } - return 0; + return null; } @@ -113,7 +113,7 @@ void SASLContext::decodeB64(const string& input, byte_t** output, long* outputLe utility::inputStreamStringAdapter is(input); utility::outputStreamStringAdapter os(res); - ref dec = + shared_ptr dec = utility::encoder::encoderFactory::getInstance()->create("base64"); dec->decode(is, os); @@ -134,7 +134,7 @@ const string SASLContext::encodeB64(const byte_t* input, const long inputLen) utility::inputStreamByteBufferAdapter is(input, inputLen); utility::outputStreamStringAdapter os(res); - ref enc = + shared_ptr enc = utility::encoder::encoderFactory::getInstance()->create("base64"); enc->encode(is, os); -- cgit v1.2.3