diff options
author | Bernard Normier <bernard@zeroc.com> | 2006-06-08 05:10:13 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2006-06-08 05:10:13 +0000 |
commit | 353add91960fa4f133bd2db69a11f7efa1ced160 (patch) | |
tree | bed068f5c9b04488ddbaa48eb9b58283232d78bf /cpp/src/Ice/PropertiesI.cpp | |
parent | *** empty log message *** (diff) | |
download | ice-353add91960fa4f133bd2db69a11f7efa1ced160.tar.bz2 ice-353add91960fa4f133bd2db69a11f7efa1ced160.tar.xz ice-353add91960fa4f133bd2db69a11f7efa1ced160.zip |
Fix for bugs #1015 and #542 (default properties)
Diffstat (limited to 'cpp/src/Ice/PropertiesI.cpp')
-rw-r--r-- | cpp/src/Ice/PropertiesI.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/cpp/src/Ice/PropertiesI.cpp b/cpp/src/Ice/PropertiesI.cpp index 44e3bfb9b3e..598dd2110a5 100644 --- a/cpp/src/Ice/PropertiesI.cpp +++ b/cpp/src/Ice/PropertiesI.cpp @@ -240,11 +240,28 @@ Ice::PropertiesI::PropertiesI(const PropertiesI* p) : Ice::PropertiesI::PropertiesI() { - loadConfig(); } -Ice::PropertiesI::PropertiesI(StringSeq& args) +Ice::PropertiesI::PropertiesI(StringSeq& args, const PropertiesPtr& defaults) { + // + // Since there is no way to iterate over all Properties, we + // assume that defaults (when not null) points to a PropertiesI + // + if(defaults != 0) + { + PropertiesI* defaultsI = dynamic_cast<PropertiesI*>(defaults.get()); + if(defaultsI == 0) + { + throw InitializationException(__FILE__, __LINE__, + "Invalid Properties implementation"); + } + + IceUtil::Mutex::Lock sync(*defaultsI); + _properties = defaultsI->_properties; + } + + StringSeq::iterator q = args.begin(); if(q != args.end()) { @@ -282,6 +299,7 @@ Ice::PropertiesI::PropertiesI(StringSeq& args) args = parseIceCommandLineOptions(args); } + void Ice::PropertiesI::parseLine(const string& line) { |