diff options
author | Bernard Normier <bernard@zeroc.com> | 2007-08-23 10:33:05 -0400 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2007-08-23 10:33:05 -0400 |
commit | 4170a1b8e1a134afd315a26eb65de1048f009e5c (patch) | |
tree | 1dce8f0e9c77bfb18486913aaef5bdd3e35cb580 /cpp/src/Ice/PluginManagerI.cpp | |
parent | http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=2426 - logger date/time fo... (diff) | |
download | ice-4170a1b8e1a134afd315a26eb65de1048f009e5c.tar.bz2 ice-4170a1b8e1a134afd315a26eb65de1048f009e5c.tar.xz ice-4170a1b8e1a134afd315a26eb65de1048f009e5c.zip |
First cut
Diffstat (limited to 'cpp/src/Ice/PluginManagerI.cpp')
-rw-r--r-- | cpp/src/Ice/PluginManagerI.cpp | 70 |
1 files changed, 63 insertions, 7 deletions
diff --git a/cpp/src/Ice/PluginManagerI.cpp b/cpp/src/Ice/PluginManagerI.cpp index 123c74c0be8..cda7176581a 100644 --- a/cpp/src/Ice/PluginManagerI.cpp +++ b/cpp/src/Ice/PluginManagerI.cpp @@ -152,7 +152,7 @@ Ice::PluginManagerI::loadPlugins(int& argc, char* argv[]) // with the prefix "Ice.Plugin.". These properties should // have the following format: // - // Ice.Plugin.name=entry_point [args] + // Ice.Plugin.name[.<language>]=entry_point [args] // // If the Ice.PluginLoadOrder property is defined, load the // specified plugins in the specified order, then load any @@ -191,7 +191,16 @@ Ice::PluginManagerI::loadPlugins(int& argc, char* argv[]) throw ex; } - PropertyDict::iterator q = plugins.find("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, false); @@ -209,15 +218,62 @@ Ice::PluginManagerI::loadPlugins(int& argc, char* argv[]) // // Load any remaining plugins that weren't specified in PluginLoadOrder. // - PropertyDict::const_iterator p; - for(p = plugins.begin(); p != plugins.end(); ++p) + + while(!plugins.empty()) { + PropertyDict::iterator p = plugins.begin(); + string name = p->first.substr(prefix.size()); - loadPlugin(name, p->second, cmdArgs, false); + + size_t dotPos = name.find_last_of('.'); + if(dotPos != string::npos) + { + string suffix = name.substr(dotPos + 1); + if(suffix == "java" || suffix == "clr") + { + // + // Ignored + // + plugins.erase(p); + } + else if(suffix == "cpp") + { + name = name.substr(0, dotPos); + loadPlugin(name, p->second, cmdArgs, false); + plugins.erase(p); + } + else + { + // + // Name is just a regular name that happens to contain a dot + // + dotPos = string::npos; + } + } + + if(dotPos == string::npos) + { + // + // Is there a .cpp entry? + // + PropertyDict::iterator q = plugins.find("Ice.Plugin." + name + ".cpp"); + if(q != plugins.end()) + { + plugins.erase(p); + p = q; + } + + loadPlugin(name, p->second, cmdArgs, false); + plugins.erase(p); + } } - string loggerStr = properties->getProperty("Ice.LoggerPlugin"); - if(loggerStr.length() != 0) + string loggerStr = properties->getProperty("Ice.LoggerPlugin.cpp"); + if(loggerStr.empty()) + { + loggerStr = properties->getProperty("Ice.LoggerPlugin"); + } + if(!loggerStr.empty()) { loadPlugin("Logger", loggerStr, cmdArgs, true); } |