projects
/
shibboleth
/
cpp-xmltooling.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
29ac236
)
Change type indicator to a string reference.
author
Scott Cantor
<cantor.2@osu.edu>
Mon, 31 Jul 2006 19:47:28 +0000
(19:47 +0000)
committer
Scott Cantor
<cantor.2@osu.edu>
Mon, 31 Jul 2006 19:47:28 +0000
(19:47 +0000)
xmltooling/PluginManager.h
patch
|
blob
|
history
diff --git
a/xmltooling/PluginManager.h
b/xmltooling/PluginManager.h
index
67323c8
..
5f248e0
100644
(file)
--- a/
xmltooling/PluginManager.h
+++ b/
xmltooling/PluginManager.h
@@
-58,8
+58,8
@@
namespace xmltooling {
* @param type the name of the plugin type
\r
* @param factory the factory function for the plugin type
\r
*/
\r
* @param type the name of the plugin type
\r
* @param factory the factory function for the plugin type
\r
*/
\r
- void registerFactory(const
char*
type, typename PluginManager::Factory* factory) {
\r
- if (
type
&& factory)
\r
+ void registerFactory(const
std::string&
type, typename PluginManager::Factory* factory) {
\r
+ if (
!type.empty()
&& factory)
\r
m_map[type]=factory;
\r
}
\r
\r
m_map[type]=factory;
\r
}
\r
\r
@@
-68,8
+68,8
@@
namespace xmltooling {
*
\r
* @param type the name of the plugin type
\r
*/
\r
*
\r
* @param type the name of the plugin type
\r
*/
\r
- void deregisterFactory(const
char*
type) {
\r
- if (
type
)
\r
+ void deregisterFactory(const
std::string&
type) {
\r
+ if (
!type.empty()
)
\r
m_map.erase(type);
\r
}
\r
\r
m_map.erase(type);
\r
}
\r
\r
@@
-88,10
+88,10
@@
namespace xmltooling {
* @param p parameters to configure plugin
\r
* @return the constructed plugin
\r
*/
\r
* @param p parameters to configure plugin
\r
* @return the constructed plugin
\r
*/
\r
- T* newPlugin(const
char*
type, const Params& p) {
\r
+ T* newPlugin(const
std::string&
type, const Params& p) {
\r
typename std::map<std::string, typename PluginManager::Factory*>::const_iterator i=m_map.find(type);
\r
if (i==m_map.end())
\r
typename std::map<std::string, typename PluginManager::Factory*>::const_iterator i=m_map.find(type);
\r
if (i==m_map.end())
\r
- throw UnknownExtensionException("Unable to build plugin of type '$1'",params(1,type));
\r
+ throw UnknownExtensionException("Unable to build plugin of type '$1'",params(1,type
.c_str()
));
\r
return i->second(p);
\r
}
\r
\r
return i->second(p);
\r
}
\r
\r