diff options
author | Bernard Normier <bernard@zeroc.com> | 2014-09-10 19:09:53 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2014-09-10 19:09:53 +0000 |
commit | ac587d9f1a6d34e46956fd17c81f99beb7ed97ad (patch) | |
tree | fa09b2b2d5b6037c76976ee293eb0d15b7a93717 /cpp/src/IceGrid/Util.cpp | |
parent | Fix networkProxy test dependencies (diff) | |
download | ice-ac587d9f1a6d34e46956fd17c81f99beb7ed97ad.tar.bz2 ice-ac587d9f1a6d34e46956fd17c81f99beb7ed97ad.tar.xz ice-ac587d9f1a6d34e46956fd17c81f99beb7ed97ad.zip |
IceGrid::Admin now provides remote access to IceGrid registry and node Admin objects, and icegridadmin uses these
new operations to show the Ice log file for IceGrid registries and IceGrid nodes (ICE-2400)
Diffstat (limited to 'cpp/src/IceGrid/Util.cpp')
-rw-r--r-- | cpp/src/IceGrid/Util.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/cpp/src/IceGrid/Util.cpp b/cpp/src/IceGrid/Util.cpp index 5b0fc8d72fc..3d402b4f278 100644 --- a/cpp/src/IceGrid/Util.cpp +++ b/cpp/src/IceGrid/Util.cpp @@ -78,6 +78,31 @@ IceGrid::getProperty(const PropertyDescriptorSeq& properties, const string& name return result; } +int +IceGrid::getPropertyAsInt(const PropertyDescriptorSeq& properties, const string& name, int def) +{ + string strVal; + for(PropertyDescriptorSeq::const_iterator q = properties.begin(); q != properties.end(); ++q) + { + if(q->name == name) + { + strVal = q->value; + } + } + + int result = def; + + if(!strVal.empty()) + { + istringstream v(strVal); + if(!(v >> result) || !v.eof()) + { + result = def; + } + } + return result; +} + bool IceGrid::hasProperty(const PropertyDescriptorSeq& properties, const string& name) { |