diff options
author | Vincent Richard <[email protected]> | 2005-07-12 22:28:02 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2005-07-12 22:28:02 +0000 |
commit | 681297e10b666e13cc463f6fbb16236f36c3266c (patch) | |
tree | 5d2392e2283232ed3475cd9c69e22897b03e8a97 /src/textPartFactory.cpp | |
parent | Added contentHandler::extractRaw(). (diff) | |
download | vmime-681297e10b666e13cc463f6fbb16236f36c3266c.tar.gz vmime-681297e10b666e13cc463f6fbb16236f36c3266c.zip |
Reference counting and smart pointers.
Diffstat (limited to 'src/textPartFactory.cpp')
-rw-r--r-- | src/textPartFactory.cpp | 16 |
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(); } |