diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2008-02-13 13:48:36 -0330 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2008-02-13 13:48:36 -0330 |
commit | 51454ae5a6219fb8e3a6464b35f545b620001279 (patch) | |
tree | 42ad16d4151a9ffb5f7675c5307c5e20f01cd159 /cpp/src/Ice/PluginManagerI.cpp | |
parent | Added deprecated warning to error outputs (diff) | |
download | ice-51454ae5a6219fb8e3a6464b35f545b620001279.tar.bz2 ice-51454ae5a6219fb8e3a6464b35f545b620001279.tar.xz ice-51454ae5a6219fb8e3a6464b35f545b620001279.zip |
Bug 2491 - Use getPropertyAsList
Diffstat (limited to 'cpp/src/Ice/PluginManagerI.cpp')
-rw-r--r-- | cpp/src/Ice/PluginManagerI.cpp | 75 |
1 files changed, 29 insertions, 46 deletions
diff --git a/cpp/src/Ice/PluginManagerI.cpp b/cpp/src/Ice/PluginManagerI.cpp index 4a850896e5b..ec7bae151d0 100644 --- a/cpp/src/Ice/PluginManagerI.cpp +++ b/cpp/src/Ice/PluginManagerI.cpp @@ -161,56 +161,39 @@ Ice::PluginManagerI::loadPlugins(int& argc, char* argv[]) PropertiesPtr properties = _communicator->getProperties(); PropertyDict plugins = properties->getPropertiesForPrefix(prefix); - string loadOrder = properties->getProperty("Ice.PluginLoadOrder"); - string::size_type beg = 0; - if(!loadOrder.empty()) + StringSeq loadOrder = properties->getPropertyAsList("Ice.PluginLoadOrder"); + for(StringSeq::const_iterator p = loadOrder.begin(); p != loadOrder.end(); ++p) { - const string delim = ", \t\n"; - beg = loadOrder.find_first_not_of(delim, beg); - while(beg != string::npos) - { - string name; - string::size_type end = loadOrder.find_first_of(delim, beg); - if(end == string::npos) - { - name = loadOrder.substr(beg); - beg = end; - } - else - { - name = loadOrder.substr(beg, end - beg); - beg = loadOrder.find_first_not_of(delim, end); - } + string name = *p; - map<string, PluginPtr>::iterator p = _plugins.find(name); - if(p != _plugins.end()) - { - PluginInitializationException ex(__FILE__, __LINE__); - ex.reason = "plugin `" + name + "' already loaded"; - throw ex; - } + map<string, PluginPtr>::iterator p = _plugins.find(name); + if(p != _plugins.end()) + { + PluginInitializationException ex(__FILE__, __LINE__); + ex.reason = "plugin `" + name + "' already loaded"; + throw ex; + } - PropertyDict::iterator q = plugins.find("Ice.Plugin." + name + ".cpp"); - if(q == plugins.end()) - { - q = plugins.find("Ice.Plugin." + name); - } - else - { - plugins.erase("Ice.Plugin." + name); - } + PropertyDict::iterator q = plugins.find("Ice.Plugin." + name + ".cpp"); + if(q == plugins.end()) + { + q = plugins.find("Ice.Plugin." + name); + } + else + { + plugins.erase("Ice.Plugin." + name); + } - if(q != plugins.end()) - { - loadPlugin(name, q->second, cmdArgs); - plugins.erase(q); - } - else - { - PluginInitializationException ex(__FILE__, __LINE__); - ex.reason = "plugin `" + name + "' not defined"; - throw ex; - } + if(q != plugins.end()) + { + loadPlugin(name, q->second, cmdArgs); + plugins.erase(q); + } + else + { + PluginInitializationException ex(__FILE__, __LINE__); + ex.reason = "plugin `" + name + "' not defined"; + throw ex; } } |