diff options
author | Marc Laukien <marc@zeroc.com> | 2002-05-15 20:46:02 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2002-05-15 20:46:02 +0000 |
commit | ec2bf745f5b36cb7f9707c951220d353a7a18f9e (patch) | |
tree | e409fbd6d2415051a630b9d82e6d006f41c3e0a5 /cpp/src | |
parent | fixes (diff) | |
download | ice-ec2bf745f5b36cb7f9707c951220d353a7a18f9e.tar.bz2 ice-ec2bf745f5b36cb7f9707c951220d353a7a18f9e.tar.xz ice-ec2bf745f5b36cb7f9707c951220d353a7a18f9e.zip |
PropertyDict
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/PluginManagerI.cpp | 9 | ||||
-rw-r--r-- | cpp/src/Ice/PropertiesI.cpp | 11 | ||||
-rw-r--r-- | cpp/src/Ice/PropertiesI.h | 2 | ||||
-rw-r--r-- | cpp/src/IceBox/ServiceManagerI.cpp | 11 |
4 files changed, 17 insertions, 16 deletions
diff --git a/cpp/src/Ice/PluginManagerI.cpp b/cpp/src/Ice/PluginManagerI.cpp index c9e2f6c25a0..f69c751fae4 100644 --- a/cpp/src/Ice/PluginManagerI.cpp +++ b/cpp/src/Ice/PluginManagerI.cpp @@ -83,11 +83,12 @@ Ice::PluginManagerI::loadPlugins(int& argc, char* argv[]) // const string prefix = "Ice.Plugin."; PropertiesPtr properties = _instance->properties(); - StringSeq plugins = properties->getProperties(prefix); - for (StringSeq::size_type i = 0; i < plugins.size(); i += 2) + PropertyDict plugins = properties->getPropertiesForPrefix(prefix); + PropertyDict::const_iterator p; + for (p = plugins.begin(); p != plugins.end(); ++p) { - string name = plugins[i].substr(prefix.size()); - string value = plugins[i + 1]; + string name = p->first.substr(prefix.size()); + const string& value = p->second; // // Separate the entry point from the arguments. diff --git a/cpp/src/Ice/PropertiesI.cpp b/cpp/src/Ice/PropertiesI.cpp index e8a7a9b8c16..0306455ce54 100644 --- a/cpp/src/Ice/PropertiesI.cpp +++ b/cpp/src/Ice/PropertiesI.cpp @@ -70,19 +70,18 @@ Ice::PropertiesI::getPropertyAsIntWithDefault(const string& key, Int value) } } -StringSeq -Ice::PropertiesI::getProperties(const string& prefix) +PropertyDict +Ice::PropertiesI::getPropertiesForPrefix(const string& prefix) { IceUtil::Mutex::Lock sync(*this); - StringSeq result; + PropertyDict result; map<string, string>::const_iterator p; for (p = _properties.begin(); p != _properties.end(); ++p) { - if (prefix.empty() || p->first.find(prefix) == 0) + if (prefix.empty() || p->first.compare(0, prefix.size(), prefix) == 0) { - result.push_back(p->first); - result.push_back(p->second); + result.insert(*p); } } diff --git a/cpp/src/Ice/PropertiesI.h b/cpp/src/Ice/PropertiesI.h index 4e301f68306..da843b70611 100644 --- a/cpp/src/Ice/PropertiesI.h +++ b/cpp/src/Ice/PropertiesI.h @@ -26,7 +26,7 @@ public: virtual std::string getPropertyWithDefault(const std::string&, const std::string&); virtual Ice::Int getPropertyAsInt(const std::string&); virtual Ice::Int getPropertyAsIntWithDefault(const std::string&, Ice::Int); - virtual StringSeq getProperties(const std::string&); + virtual PropertyDict getPropertiesForPrefix(const std::string&); virtual void setProperty(const std::string&, const std::string&); virtual StringSeq getCommandLineOptions(); virtual StringSeq parseCommandLineOptions(const std::string&, const StringSeq&); diff --git a/cpp/src/IceBox/ServiceManagerI.cpp b/cpp/src/IceBox/ServiceManagerI.cpp index 472c09d13bc..ea1831ee051 100644 --- a/cpp/src/IceBox/ServiceManagerI.cpp +++ b/cpp/src/IceBox/ServiceManagerI.cpp @@ -72,11 +72,12 @@ IceBox::ServiceManagerI::run() // const string prefix = "IceBox.Service."; PropertiesPtr properties = _communicator->getProperties(); - StringSeq services = properties->getProperties(prefix); - for (StringSeq::size_type i = 0; i < services.size(); i += 2) - { - string name = services[i].substr(prefix.size()); - string value = services[i + 1]; + PropertyDict services = properties->getPropertiesForPrefix(prefix); + PropertyDict::const_iterator p; + for (p = services.begin(); p != services.end(); ++p) + { + string name = p->first.substr(prefix.size()); + const string& value = p->second; // // Separate the entry point from the arguments. |