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/net/smtp/SMTPCommand.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/net/smtp/SMTPCommand.cpp') diff --git a/src/net/smtp/SMTPCommand.cpp b/src/net/smtp/SMTPCommand.cpp index e40797f2..6b3d1d79 100644 --- a/src/net/smtp/SMTPCommand.cpp +++ b/src/net/smtp/SMTPCommand.cpp @@ -47,7 +47,7 @@ SMTPCommand::SMTPCommand(const string& text) // static -ref SMTPCommand::EHLO(const string& hostname) +shared_ptr SMTPCommand::EHLO(const string& hostname) { std::ostringstream cmd; cmd.imbue(std::locale::classic()); @@ -58,7 +58,7 @@ ref SMTPCommand::EHLO(const string& hostname) // static -ref SMTPCommand::HELO(const string& hostname) +shared_ptr SMTPCommand::HELO(const string& hostname) { std::ostringstream cmd; cmd.imbue(std::locale::classic()); @@ -69,7 +69,7 @@ ref SMTPCommand::HELO(const string& hostname) // static -ref SMTPCommand::AUTH(const string& mechName) +shared_ptr SMTPCommand::AUTH(const string& mechName) { std::ostringstream cmd; cmd.imbue(std::locale::classic()); @@ -80,21 +80,21 @@ ref SMTPCommand::AUTH(const string& mechName) // static -ref SMTPCommand::STARTTLS() +shared_ptr SMTPCommand::STARTTLS() { return createCommand("STARTTLS"); } // static -ref SMTPCommand::MAIL(const mailbox& mbox, const bool utf8) +shared_ptr SMTPCommand::MAIL(const mailbox& mbox, const bool utf8) { return MAIL(mbox, utf8, 0); } // static -ref SMTPCommand::MAIL(const mailbox& mbox, const bool utf8, const unsigned long size) +shared_ptr SMTPCommand::MAIL(const mailbox& mbox, const bool utf8, const unsigned long size) { std::ostringstream cmd; cmd.imbue(std::locale::classic()); @@ -123,7 +123,7 @@ ref SMTPCommand::MAIL(const mailbox& mbox, const bool utf8, const // static -ref SMTPCommand::RCPT(const mailbox& mbox, const bool utf8) +shared_ptr SMTPCommand::RCPT(const mailbox& mbox, const bool utf8) { std::ostringstream cmd; cmd.imbue(std::locale::classic()); @@ -146,21 +146,21 @@ ref SMTPCommand::RCPT(const mailbox& mbox, const bool utf8) // static -ref SMTPCommand::RSET() +shared_ptr SMTPCommand::RSET() { return createCommand("RSET"); } // static -ref SMTPCommand::DATA() +shared_ptr SMTPCommand::DATA() { return createCommand("DATA"); } // static -ref SMTPCommand::BDAT(const unsigned long chunkSize, const bool last) +shared_ptr SMTPCommand::BDAT(const unsigned long chunkSize, const bool last) { std::ostringstream cmd; cmd.imbue(std::locale::classic()); @@ -174,23 +174,23 @@ ref SMTPCommand::BDAT(const unsigned long chunkSize, const bool la // static -ref SMTPCommand::NOOP() +shared_ptr SMTPCommand::NOOP() { return createCommand("NOOP"); } // static -ref SMTPCommand::QUIT() +shared_ptr SMTPCommand::QUIT() { return createCommand("QUIT"); } // static -ref SMTPCommand::createCommand(const string& text) +shared_ptr SMTPCommand::createCommand(const string& text) { - return vmime::create (text); + return shared_ptr (new SMTPCommand(text)); } @@ -200,7 +200,7 @@ const string SMTPCommand::getText() const } -void SMTPCommand::writeToSocket(ref sok) +void SMTPCommand::writeToSocket(shared_ptr sok) { sok->send(m_text + "\r\n"); } -- cgit v1.2.3