diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/PropertiesI.cpp | 25 | ||||
-rw-r--r-- | cpp/src/IceGrid/NodeI.cpp | 81 |
2 files changed, 70 insertions, 36 deletions
diff --git a/cpp/src/Ice/PropertiesI.cpp b/cpp/src/Ice/PropertiesI.cpp index bf8840badbe..5608d5715c1 100644 --- a/cpp/src/Ice/PropertiesI.cpp +++ b/cpp/src/Ice/PropertiesI.cpp @@ -101,7 +101,7 @@ Ice::PropertiesI::getPropertyAsListWithDefault(const string& key, const StringSe p->second.used = true; StringSeq result; - if(!IceUtilInternal::splitString(p->second.value, ", \t\n", result)) + if(!IceUtilInternal::splitString(p->second.value, ", \t\r\n", result)) { Warning out(getProcessLogger()); out << "mismatched quotes in property " << key << "'s value, returning default value"; @@ -486,14 +486,29 @@ Ice::PropertiesI::loadConfig() if(s && *s != '\0') { value = s; - setProperty("Ice.Config", value); } } - StringSeq files = getPropertyAsList("Ice.Config"); - for(StringSeq::const_iterator p = files.begin(); p != files.end(); ++p) + if(!value.empty()) { - load(*p); + const string delim = " \t\r\n"; + string::size_type beg = value.find_first_not_of(delim); + while(beg != string::npos) + { + string::size_type end = value.find(",", beg); + string file; + if(end == string::npos) + { + file = value.substr(beg); + beg = end; + } + else + { + file = value.substr(beg, end - beg); + beg = value.find_first_not_of("," + delim, end); + } + load(file); + } } PropertyValue pv(value, true); 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)); } } |