本文整理汇总了C++中IConfig::load方法的典型用法代码示例。如果您正苦于以下问题:C++ IConfig::load方法的具体用法?C++ IConfig::load怎么用?C++ IConfig::load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IConfig
的用法示例。
在下文中一共展示了IConfig::load方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processInteractive
// Processes interactive option
void Installer::processInteractive()
{
// process all options
IConfig* config = m_factory->getConfig();
// before set any new config file option
// reread config file
config->load();
// look for the option
OptionList options = config->getOptions();
for (OptionList::iterator i = options.begin();
i != options.end(); i++)
{
const std::string name = (*i)->getName();
const std::string oldval = (*i)->getValue();
std::cout << "Option '" << name << "' has the following value: "
<< oldval << std::endl;
if (ask("Do you want to change it [N/y]: "))
{
std::string value = get("New value: ");
setOption((*i)->getName(), value);
}
}
if (ask("Do you want to recreate DB [N/y]: "))
{
recreateDB();
}
// resources detection
if (ask("Do you want to detect resources [N/y]: "))
{
detectResources();
}
}