diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2008-02-19 09:22:00 -0330 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2008-02-19 09:22:00 -0330 |
commit | f5066cecf33527ef0401445e5836dcc859ff1692 (patch) | |
tree | b7e106eb1c5e9890faebfe616fe3bbd8ccb29474 /cpp/src/IceGrid/NodeI.cpp | |
parent | Merge branch 'master' of ssh://git/home/git/ice (diff) | |
download | ice-f5066cecf33527ef0401445e5836dcc859ff1692.tar.bz2 ice-f5066cecf33527ef0401445e5836dcc859ff1692.tar.xz ice-f5066cecf33527ef0401445e5836dcc859ff1692.zip |
Fixed errors indtoduced with adding getPropertyAsList
Diffstat (limited to 'cpp/src/IceGrid/NodeI.cpp')
-rw-r--r-- | cpp/src/IceGrid/NodeI.cpp | 81 |
1 files changed, 50 insertions, 31 deletions
diff --git a/cpp/src/IceGrid/NodeI.cpp b/cpp/src/IceGrid/NodeI.cpp index 899511f95a9..fad3df4afcc 100644 --- a/cpp/src/IceGrid/NodeI.cpp +++ b/cpp/src/IceGrid/NodeI.cpp @@ -228,45 +228,64 @@ NodeI::NodeI(const Ice::ObjectAdapterPtr& adapter, // // Parse the properties override property. // - Ice::StringSeq overrides = props->getPropertyAsList("IceGrid.Node.PropertiesOverride"); - for(Ice::StringSeq::const_iterator p = overrides.begin(); p != overrides.end(); ++p) + string overrides = props->getProperty("IceGrid.Node.PropertiesOverride"); + if(!overrides.empty()) { - string arg = *p; + string::size_type end = 0; + while(end != string::npos) + { + const string delim = " \t\r\n"; - const string delim = " \t\r\n"; + string::size_type beg = overrides.find_first_not_of(delim, end); + if(beg == string::npos) + { + break; + } + + end = overrides.find_first_of(delim, beg); + string arg; + if(end == string::npos) + { + arg = overrides.substr(beg); + } + else + { + arg = overrides.substr(beg, end - beg); + } - if(arg.find("--") == 0) - { - arg = arg.substr(2); - } + if(arg.find("--") == 0) + { + arg = arg.substr(2); + } - // - // Extract the key/value - // - string::size_type argEnd = arg.find_first_of(delim + "="); - if(argEnd == string::npos) - { - continue; - } + // + // Extract the key/value + // + string::size_type argEnd = arg.find_first_of(delim + "="); + if(argEnd == string::npos) + { + continue; + } - string key = arg.substr(0, argEnd); + string key = arg.substr(0, argEnd); - argEnd = arg.find('=', argEnd); - if(argEnd == string::npos) - { - return; - } - ++argEnd; + argEnd = arg.find('=', argEnd); + if(argEnd == string::npos) + { + return; + } + ++argEnd; - string value; - string::size_type argBeg = arg.find_first_not_of(delim, argEnd); - if(argBeg != string::npos) - { - argEnd = arg.length(); - value = arg.substr(argBeg, argEnd - argBeg); + string value; + string::size_type argBeg = arg.find_first_not_of(delim, argEnd); + if(argBeg != string::npos) + { + argEnd = arg.length(); + value = arg.substr(argBeg, argEnd - argBeg); + } + + _propertiesOverride.push_back(createProperty(key, value)); } - - _propertiesOverride.push_back(createProperty(key, value)); } } |