aboutsummaryrefslogtreecommitdiffstats
path: root/src/security/sasl/SASLContext.cpp
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2013-11-21 21:16:57 +0000
committerVincent Richard <[email protected]>2013-11-21 21:16:57 +0000
commitf9913fa28a27f23fde2d4956c62cbb2fb2bc2ee8 (patch)
tree2bdc90e361a8f6e0a81164cf67afec9f78f9b959 /src/security/sasl/SASLContext.cpp
parentPer-protocol include files. (diff)
downloadvmime-f9913fa28a27f23fde2d4956c62cbb2fb2bc2ee8.tar.gz
vmime-f9913fa28a27f23fde2d4956c62cbb2fb2bc2ee8.zip
Boost/C++11 shared pointers.
Diffstat (limited to 'src/security/sasl/SASLContext.cpp')
-rw-r--r--src/security/sasl/SASLContext.cpp24
1 files changed, 12 insertions, 12 deletions
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 <SASLSession> SASLContext::createSession
+shared_ptr <SASLSession> SASLContext::createSession
(const string& serviceName,
- ref <authenticator> auth, ref <SASLMechanism> mech)
+ shared_ptr <authenticator> auth, shared_ptr <SASLMechanism> mech)
{
- return vmime::create <SASLSession>
- (serviceName, thisRef().dynamicCast <SASLContext>(), auth, mech);
+ return make_shared <SASLSession>
+ (serviceName, dynamicCast <SASLContext>(shared_from_this()), auth, mech);
}
-ref <SASLMechanism> SASLContext::createMechanism(const string& name)
+shared_ptr <SASLMechanism> SASLContext::createMechanism(const string& name)
{
return SASLMechanismFactory::getInstance()->create
- (thisRef().dynamicCast <SASLContext>(), name);
+ (dynamicCast <SASLContext>(shared_from_this()), name);
}
-ref <SASLMechanism> SASLContext::suggestMechanism
- (const std::vector <ref <SASLMechanism> >& mechs)
+shared_ptr <SASLMechanism> SASLContext::suggestMechanism
+ (const std::vector <shared_ptr <SASLMechanism> >& mechs)
{
if (mechs.empty())
- return 0;
+ return null;
std::ostringstream oss;
@@ -102,7 +102,7 @@ ref <SASLMechanism> 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 <utility::encoder::encoder> dec =
+ shared_ptr <utility::encoder::encoder> 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 <utility::encoder::encoder> enc =
+ shared_ptr <utility::encoder::encoder> enc =
utility::encoder::encoderFactory::getInstance()->create("base64");
enc->encode(is, os);