diff options
author | Mark Spruiell <mes@zeroc.com> | 2002-03-27 00:31:38 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2002-03-27 00:31:38 +0000 |
commit | 5c2a5725eb11167478d817c78fa3485f9b3c19fe (patch) | |
tree | 126501f1f3bad143a1201f7bc7f8efe79ae8f1ef /cpp/src | |
parent | Oops. Compatibility issue with Linux. (diff) | |
download | ice-5c2a5725eb11167478d817c78fa3485f9b3c19fe.tar.bz2 ice-5c2a5725eb11167478d817c78fa3485f9b3c19fe.tar.xz ice-5c2a5725eb11167478d817c78fa3485f9b3c19fe.zip |
adding getProperties
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/PropertiesI.cpp | 19 | ||||
-rw-r--r-- | cpp/src/Ice/PropertiesI.h | 1 |
2 files changed, 20 insertions, 0 deletions
diff --git a/cpp/src/Ice/PropertiesI.cpp b/cpp/src/Ice/PropertiesI.cpp index 11a0d1aa7ca..8f3767b2530 100644 --- a/cpp/src/Ice/PropertiesI.cpp +++ b/cpp/src/Ice/PropertiesI.cpp @@ -50,6 +50,25 @@ Ice::PropertiesI::getPropertyWithDefault(const string& key, const string& value) } } +StringSeq +Ice::PropertiesI::getProperties(const string& prefix) +{ + IceUtil::Mutex::Lock sync(*this); + + StringSeq result; + map<string, string>::const_iterator p; + for (p = _properties.begin(); p != _properties.end(); ++p) + { + if (prefix.empty() || p->first.find(prefix) == 0) + { + result.push_back(p->first); + result.push_back(p->second); + } + } + + return result; +} + void Ice::PropertiesI::setProperty(const string& key, const string& value) { diff --git a/cpp/src/Ice/PropertiesI.h b/cpp/src/Ice/PropertiesI.h index d134544016e..f97e368bad8 100644 --- a/cpp/src/Ice/PropertiesI.h +++ b/cpp/src/Ice/PropertiesI.h @@ -24,6 +24,7 @@ public: virtual std::string getProperty(const std::string&); virtual std::string getPropertyWithDefault(const std::string&, const std::string&); + virtual StringSeq getProperties(const std::string&); virtual void setProperty(const std::string&, const std::string&); virtual StringSeq getCommandLineOptions(); virtual PropertiesPtr clone(); |