summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/PropertiesI.cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2007-09-26 16:38:18 -0400
committerBernard Normier <bernard@zeroc.com>2007-09-26 16:38:18 -0400
commit8c37266661594245c4bea4c4094c86851bdf5550 (patch)
tree1871c4c29711c162a296f7994bfd9115a30216ef /cpp/src/Ice/PropertiesI.cpp
parentFixed bug 2488 (diff)
downloadice-8c37266661594245c4bea4c4094c86851bdf5550.tar.bz2
ice-8c37266661594245c4bea4c4094c86851bdf5550.tar.xz
ice-8c37266661594245c4bea4c4094c86851bdf5550.zip
Squashed commit of the following:
commit 569cd3ce2933b104c980b4bfa8a1d0bc6d3be4c9 Author: Bernard Normier <bernard@zeroc.com> Date: Wed Sep 26 16:36:46 2007 -0400 Implemented admin facet filtering (Ice.Admin.Facets property) and Properties::getPropertyAsList[WithDefault]
Diffstat (limited to 'cpp/src/Ice/PropertiesI.cpp')
-rw-r--r--cpp/src/Ice/PropertiesI.cpp53
1 files changed, 35 insertions, 18 deletions
diff --git a/cpp/src/Ice/PropertiesI.cpp b/cpp/src/Ice/PropertiesI.cpp
index 72671064a06..048c7bfab96 100644
--- a/cpp/src/Ice/PropertiesI.cpp
+++ b/cpp/src/Ice/PropertiesI.cpp
@@ -84,6 +84,41 @@ Ice::PropertiesI::getPropertyAsIntWithDefault(const string& key, Int value)
return value;
}
+Ice::StringSeq
+Ice::PropertiesI::getPropertyAsList(const string& key)
+{
+ return getPropertyAsListWithDefault(key, StringSeq());
+}
+
+Ice::StringSeq
+Ice::PropertiesI::getPropertyAsListWithDefault(const string& key, const StringSeq& value)
+{
+ IceUtil::Mutex::Lock sync(*this);
+
+ map<string, PropertyValue>::iterator p = _properties.find(key);
+ if(p != _properties.end())
+ {
+ p->second.used = true;
+
+ StringSeq result;
+ if(!IceUtil::splitString(p->second.value, " \t\n", result))
+ {
+ Warning out(getProcessLogger());
+ out << "mismatched quotes in property " << key << "'s value, returning default value";
+ }
+ if(result.size() == 0)
+ {
+ result = value;
+ }
+ return result;
+ }
+ else
+ {
+ return value;
+ }
+}
+
+
PropertyDict
Ice::PropertiesI::getPropertiesForPrefix(const string& prefix)
{
@@ -490,24 +525,6 @@ Ice::PropertiesAdminI::getProperty(const string& name, const Ice::Current&)
return _properties->getProperty(name);
}
-string
-Ice::PropertiesAdminI::getPropertyWithDefault(const string& name, const string& dflt, const Ice::Current&)
-{
- return _properties->getPropertyWithDefault(name, dflt);
-}
-
-Ice::Int
-Ice::PropertiesAdminI::getPropertyAsInt(const string& name, const Ice::Current&)
-{
- return _properties->getPropertyAsInt(name);
-}
-
-Ice::Int
-Ice::PropertiesAdminI::getPropertyAsIntWithDefault(const string& name, Ice::Int dflt, const Ice::Current&)
-{
- return _properties->getPropertyAsIntWithDefault(name, dflt);
-}
-
Ice::PropertyDict
Ice::PropertiesAdminI::getPropertiesForPrefix(const string& prefix, const Ice::Current&)
{