summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/PropertiesI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Ice/PropertiesI.cpp')
-rw-r--r--cpp/src/Ice/PropertiesI.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/cpp/src/Ice/PropertiesI.cpp b/cpp/src/Ice/PropertiesI.cpp
index 78cd88b4d18..5805c2a4a98 100644
--- a/cpp/src/Ice/PropertiesI.cpp
+++ b/cpp/src/Ice/PropertiesI.cpp
@@ -69,6 +69,22 @@ Ice::PropertiesI::getProperties(const string& prefix)
return result;
}
+Int
+Ice::PropertiesI::getPropertyAsInt(const string& key)
+{
+ IceUtil::Mutex::Lock sync(*this);
+
+ map<string, string>::const_iterator p = _properties.find(key);
+ if (p != _properties.end())
+ {
+ return static_cast<Int>(atoi(p->second.c_str()));
+ }
+ else
+ {
+ return 0;
+ }
+}
+
void
Ice::PropertiesI::setProperty(const string& key, const string& value)
{