aboutsummaryrefslogtreecommitdiffstats
path: root/src/textPartFactory.cpp
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2005-07-12 22:28:02 +0000
committerVincent Richard <[email protected]>2005-07-12 22:28:02 +0000
commit681297e10b666e13cc463f6fbb16236f36c3266c (patch)
tree5d2392e2283232ed3475cd9c69e22897b03e8a97 /src/textPartFactory.cpp
parentAdded contentHandler::extractRaw(). (diff)
downloadvmime-681297e10b666e13cc463f6fbb16236f36c3266c.tar.gz
vmime-681297e10b666e13cc463f6fbb16236f36c3266c.zip
Reference counting and smart pointers.
Diffstat (limited to 'src/textPartFactory.cpp')
-rw-r--r--src/textPartFactory.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/textPartFactory.cpp b/src/textPartFactory.cpp
index c76697b2..2c910be0 100644
--- a/src/textPartFactory.cpp
+++ b/src/textPartFactory.cpp
@@ -49,18 +49,16 @@ textPartFactory* textPartFactory::getInstance()
}
-textPart* textPartFactory::create(const mediaType& type)
+ref <textPart> textPartFactory::create(const mediaType& type)
{
- NameMap::const_iterator pos = m_nameMap.find(type.generate());
-
- if (pos != m_nameMap.end())
- {
- return ((*pos).second)();
- }
- else
+ for (MapType::const_iterator it = m_map.begin() ;
+ it != m_map.end() ; ++it)
{
- throw exceptions::no_factory_available();
+ if ((*it).first == type)
+ return ((*it).second)();
}
+
+ throw exceptions::no_factory_available();
}