39
39
transform(find_str.begin(), find_str.end(), find_str.begin(), ::tolower);
41
41
map<string, plugin::Handle *>::iterator map_iter;
42
map_iter= plugin_map.find(find_str);
43
if (map_iter != plugin_map.end())
42
map_iter= handle_map.find(find_str);
43
if (map_iter != handle_map.end())
44
44
return (*map_iter).second;
48
void plugin::Registry::add(plugin::Handle *plugin)
48
void plugin::Registry::add(plugin::Handle *handle)
50
string add_str(plugin->getName());
50
string add_str(handle->getName());
51
51
transform(add_str.begin(), add_str.end(),
52
52
add_str.begin(), ::tolower);
54
plugin_map[add_str]= plugin;
54
handle_map[add_str]= handle;
57
void plugin::Registry::add(plugin::Plugin *plugin)
59
plugin->setHandle(current_handle);
60
plugin_registry.add(plugin);
63
void plugin::Registry::remove(const plugin::Plugin *plugin)
65
plugin_registry.remove(plugin);
58
68
vector<plugin::Handle *> plugin::Registry::get_list(bool active)
60
70
plugin::Handle *plugin= NULL;
62
72
vector <plugin::Handle *> plugins;
63
plugins.reserve(plugin_map.size());
73
plugins.reserve(handle_map.size());
65
75
map<string, plugin::Handle *>::iterator map_iter;
66
for (map_iter= plugin_map.begin();
67
map_iter != plugin_map.end();
76
for (map_iter= handle_map.begin();
77
map_iter != handle_map.end();
70
80
plugin= (*map_iter).second;