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/propertySet.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/propertySet.cpp') diff --git a/src/propertySet.cpp b/src/propertySet.cpp index 284f3eaa..151c3e12 100644 --- a/src/propertySet.cpp +++ b/src/propertySet.cpp @@ -43,8 +43,8 @@ propertySet::propertySet(const string& props) propertySet::propertySet(const propertySet& set) : object() { - for (std::list >::const_iterator it = set.m_props.begin() ; it != set.m_props.end() ; ++it) - m_props.push_back(vmime::create (**it)); + for (std::list >::const_iterator it = set.m_props.begin() ; it != set.m_props.end() ; ++it) + m_props.push_back(make_shared (**it)); } @@ -58,8 +58,8 @@ propertySet& propertySet::operator=(const propertySet& set) { removeAllProperties(); - for (std::list >::const_iterator it = set.m_props.begin() ; it != set.m_props.end() ; ++it) - m_props.push_back(vmime::create (**it)); + for (std::list >::const_iterator it = set.m_props.begin() ; it != set.m_props.end() ; ++it) + m_props.push_back(make_shared (**it)); return (*this); } @@ -79,7 +79,7 @@ void propertySet::removeAllProperties() void propertySet::removeProperty(const string& name) { - std::list >::iterator it = std::find_if + std::list >::iterator it = std::find_if (m_props.begin(), m_props.end(), propFinder(name)); if (it != m_props.end()) @@ -174,24 +174,24 @@ void propertySet::parse(const string& props) } } - m_props.push_back(vmime::create (option, value)); + m_props.push_back(make_shared (option, value)); } } } -ref propertySet::find(const string& name) const +shared_ptr propertySet::find(const string& name) const { - std::list >::const_iterator it = std::find_if + std::list >::const_iterator it = std::find_if (m_props.begin(), m_props.end(), propFinder(name)); - return (it != m_props.end() ? *it : NULL); + return (it != m_props.end() ? *it : null); } -ref propertySet::findOrCreate(const string& name) +shared_ptr propertySet::findOrCreate(const string& name) { - std::list >::const_iterator it = std::find_if + std::list >::const_iterator it = std::find_if (m_props.begin(), m_props.end(), propFinder(name)); if (it != m_props.end()) @@ -200,7 +200,7 @@ ref propertySet::findOrCreate(const string& name) } else { - ref prop = vmime::create (name, ""); + shared_ptr prop = make_shared (name, ""); m_props.push_back(prop); return (prop); } @@ -225,9 +225,9 @@ bool propertySet::hasProperty(const string& name) const } -const std::vector > propertySet::getPropertyList() const +const std::vector > propertySet::getPropertyList() const { - std::vector > res; + std::vector > res; for (list_type::const_iterator it = m_props.begin() ; it != m_props.end() ; ++it) res.push_back(*it); @@ -236,9 +236,9 @@ const std::vector > propertySet::getPropertyL } -const std::vector > propertySet::getPropertyList() +const std::vector > propertySet::getPropertyList() { - std::vector > res; + std::vector > res; for (list_type::const_iterator it = m_props.begin() ; it != m_props.end() ; ++it) res.push_back(*it); -- cgit v1.2.3