27 #include <Ice/Initialize.h>
37 Ice::StringSeq strSeq;
49 armarxIceProperties->parseCommandLineOptions(std::string(), propertySeq);
51 return armarxIceProperties;
60 Ice::StringSeq propertySeq = Ice::argsToStringSeq(argn, argv);
63 armarxIceProperties->parseCommandLineOptions(std::string(), propertySeq);
65 return armarxIceProperties;
69 internalProperties(iceProperties), modified(true)
76 internalProperties =
source.internalProperties->clone();
77 modified =
source.modified;
78 if (
source.inheritanceSolver)
93 return internalProperties->getProperty(name);
98 const ::std::string& defaultValue) ICE_NOEXCEPT
102 return internalProperties->getPropertyWithDefault(name, defaultValue);
110 return internalProperties->getPropertyAsInt(name);
115 ::
Ice::Int defaultValue) ICE_NOEXCEPT
119 return internalProperties->getPropertyAsIntWithDefault(name, defaultValue);
127 return internalProperties->getPropertyAsList(name);
132 const ::Ice::StringSeq& defaultValue) ICE_NOEXCEPT
136 return internalProperties->getPropertyAsListWithDefault(name, defaultValue);
144 return internalProperties->getPropertiesForPrefix(prefix);
150 internalProperties->setProperty(name,
value);
159 return internalProperties->getCommandLineOptions();
164 const ::Ice::StringSeq& options)
166 Ice::StringSeq optionSeq = internalProperties->parseCommandLineOptions(prefix, options);
177 Ice::StringSeq optionSeq = internalProperties->parseIceCommandLineOptions(options);
188 internalProperties->load(fileName);
197 return internalProperties->clone();
201 IceProperties::setModified(
bool mod)
203 this->modified = mod;
207 IceProperties::isModified()
213 IceProperties::update()
217 if (inheritanceSolver.get() !=
nullptr)
219 inheritanceSolver->resolveInheritance(internalProperties);
229 return inheritanceSolver;
235 this->inheritanceSolver = solver;
247 extractNamespaces(properties, namespaces);
249 NamespaceMap::const_iterator namespacesIter = namespaces.begin();
251 while (namespacesIter != namespaces.end())
253 resolveNamespaceInheritance(namespacesIter->first, properties);
265 Ice::PropertyDict propertyDict = properties->getPropertiesForPrefix(std::string());
268 Ice::PropertyDict::iterator dictIter = propertyDict.begin();
270 while (dictIter != propertyDict.end())
272 std::string propertyFullName = dictIter->first;
274 unsigned nameDelimiter = propertyFullName.find_last_of(
".");
275 std::string propertyNamespace = propertyFullName.substr(0, nameDelimiter);
276 namespaces[propertyNamespace] =
true;
288 if (properties->getPropertyWithDefault(inheritanceProperty,
"::NOT-SET::")
289 .compare(
"::NOT-SET::") == 0)
303 return properties->getProperty(inheritanceProperty);
308 const std::string& namespace_)
310 std::vector<std::string>::const_iterator heritageLineIter = heritageLine.begin();
312 while (heritageLineIter != heritageLine.end())
314 if ((*heritageLineIter).compare(namespace_) == 0)
327 const std::string& namespace_)
329 return propertyName.substr(namespace_.length() + 1);
336 std::vector<std::string> heritageLine;
338 if (hasParent(childNamespace, properties))
341 childNamespace, getParent(childNamespace, properties), properties, heritageLine);
347 const std::string& parentNamespace,
349 std::vector<std::string> heritageLine)
351 heritageLine.push_back(childNamespace);
354 if (hasParent(parentNamespace, properties))
356 if (isInHeritageLine(heritageLine, parentNamespace))
358 heritageLine.push_back(parentNamespace);
363 parentNamespace, getParent(parentNamespace, properties), properties, heritageLine);
367 Ice::PropertyDict parentProperties = properties->getPropertiesForPrefix(parentNamespace);
369 Ice::PropertyDict::iterator parentPropIter = parentProperties.begin();
371 while (parentPropIter != parentProperties.end())
377 for (
auto property : properties->getPropertiesForPrefix(childNamespace))
379 std::string propertyVariable =
380 "{" + stripNamespace(parentPropIter->first, parentNamespace) +
"}";
381 auto index =
property.second.find(propertyVariable);
382 if (
index != std::string::npos)
384 std::string newValue =
property.second.replace(
385 index, propertyVariable.size(), parentPropIter->second);
386 properties->setProperty(property.first, newValue);
392 std::string newPropertyName =
393 childNamespace +
"." + stripNamespace(parentPropIter->first, parentNamespace);
396 if (properties->getProperty(newPropertyName).empty())
398 properties->setProperty(newPropertyName, parentPropIter->second);