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/word.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'src/word.cpp') diff --git a/src/word.cpp b/src/word.cpp index 8e254865..fc791b53 100644 --- a/src/word.cpp +++ b/src/word.cpp @@ -25,7 +25,6 @@ #include "vmime/text.hpp" #include "vmime/utility/stringUtils.hpp" -#include "vmime/utility/smartPtr.hpp" #include "vmime/parserHelpers.hpp" #include "vmime/utility/outputStreamStringAdapter.hpp" @@ -66,7 +65,7 @@ word::word(const string& buffer, const charset& charset) } -ref word::parseNext +shared_ptr word::parseNext (const parsingContext& ctx, const string& buffer, const string::size_type position, const string::size_type end, string::size_type* newPosition, bool prevIsEncoded, bool* isEncoded, bool isFirst) @@ -128,7 +127,7 @@ ref word::parseNext if (prevIsEncoded && !isFirst) unencoded = whiteSpaces + unencoded; - ref w = vmime::create (unencoded, defaultCharset); + shared_ptr w = make_shared (unencoded, defaultCharset); w->setParsedBounds(position, pos); if (newPosition) @@ -185,7 +184,7 @@ ref word::parseNext pos += 2; // ?= - ref w = vmime::create (); + shared_ptr w = make_shared (); w->parse(buffer, wordStart, pos, NULL); if (newPosition) @@ -211,7 +210,7 @@ ref word::parseNext // Treat unencoded text at the end of the buffer if (!unencoded.empty()) { - ref w = vmime::create (unencoded, defaultCharset); + shared_ptr w = make_shared (unencoded, defaultCharset); w->setParsedBounds(position, end); if (newPosition) @@ -227,12 +226,12 @@ ref word::parseNext } -const std::vector > word::parseMultiple +const std::vector > word::parseMultiple (const parsingContext& ctx, const string& buffer, const string::size_type position, const string::size_type end, string::size_type* newPosition) { - std::vector > res; - ref w; + std::vector > res; + shared_ptr w; string::size_type pos = position; @@ -743,9 +742,9 @@ const string word::getConvertedText(const charset& dest, const charsetConverterO } -ref word::clone() const +shared_ptr word::clone() const { - return vmime::create (m_buffer, m_charset); + return make_shared (m_buffer, m_charset); } @@ -785,9 +784,9 @@ void word::setBuffer(const string& buffer) } -const std::vector > word::getChildComponents() +const std::vector > word::getChildComponents() { - return std::vector >(); + return std::vector >(); } -- cgit v1.2.3