本文整理汇总了C++中ConfigManager::removeConfig方法的典型用法代码示例。如果您正苦于以下问题:C++ ConfigManager::removeConfig方法的具体用法?C++ ConfigManager::removeConfig怎么用?C++ ConfigManager::removeConfig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfigManager
的用法示例。
在下文中一共展示了ConfigManager::removeConfig方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runConfigManagerTest
//.........这里部分代码省略.........
assertDynoCmp(cm.getConfig("config"), expect);
}
tr.passIfNoException();
tr.test("add");
{
DynamicObject expect;
expect["a"] = 0;
expect["b"] = 1;
expect["c"] = 2;
ConfigManager cm;
Config a;
a[ConfigManager::ID] = "config";
a[ConfigManager::MERGE]["a"] = 0;
Config b;
b[ConfigManager::ID] = "config";
b[ConfigManager::MERGE]["b"] = 1;
Config c;
c[ConfigManager::ID] = "config";
c[ConfigManager::MERGE]["c"] = 2;
assert(cm.addConfig(a));
assertNoExceptionSet();
assert(cm.addConfig(b));
assertNoExceptionSet();
assert(cm.addConfig(c));
assertNoExceptionSet();
assertDynoCmp(cm.getConfig("config"), expect);
}
tr.passIfNoException();
tr.test("bad remove");
{
ConfigManager cm;
assert(!cm.removeConfig("error"));
assertExceptionSet();
Exception::clear();
}
tr.passIfNoException();
tr.test("remove");
{
DynamicObject expect;
expect["a"] = 0;
expect["b"] = 1;
expect["c"] = 2;
ConfigManager cm;
Config a;
a[ConfigManager::ID] = "config a";
a[ConfigManager::GROUP] = "group";
a[ConfigManager::MERGE]["a"] = 0;
Config b;
b[ConfigManager::ID] = "config b";
b[ConfigManager::GROUP] = "group";
b[ConfigManager::MERGE]["b"] = 1;
Config c;
c[ConfigManager::ID] = "config c";
c[ConfigManager::GROUP] = "group";
c[ConfigManager::MERGE]["c"] = 2;
assert(cm.addConfig(a));
assertNoExceptionSet();
assert(cm.addConfig(b));
assertNoExceptionSet();
assert(cm.addConfig(c));
assertNoExceptionSet();
assertDynoCmp(cm.getConfig("group"), expect);
DynamicObject expect2;