本文整理汇总了C++中ConfigFile::getBool方法的典型用法代码示例。如果您正苦于以下问题:C++ ConfigFile::getBool方法的具体用法?C++ ConfigFile::getBool怎么用?C++ ConfigFile::getBool使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfigFile
的用法示例。
在下文中一共展示了ConfigFile::getBool方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: comm
CommConfigurable::CommConfigurable(ConfigFile & configFile, Log & log)
: comm() {
// Should we use CommPlayer?
if (configFile.getBool("configurable/comm/useCommPlayer", true)) {
comm.push_back(new CommPlayer(configFile, log));
}
// Should we use CommRemote?
if (configFile.getBool("configurable/comm/useCommRemote", true)) {
comm.push_back(new CommRemote(configFile, log));
}
}
示例2: Log
LogConfigurable::LogConfigurable(ConfigFile & configFile)
: Log(configFile),
log() {
// Should we use LogToRemote?
if (configFile.getBool("configurable/log/useLogToRemote", true)) {
log.push_back(new LogToRemote(configFile));
}
// Should we use LogToText?
if (configFile.getBool("configurable/log/useLogToText", true)) {
log.push_back(new LogToText(configFile));
}
// Should we use LogToFile?
if (configFile.getBool("configurable/log/useLogToFile", true)) {
log.push_back(new LogToFile(configFile));
}
}
示例3: OpenLastFiles
void SubMainFrame::OpenLastFiles()
{
ConfigFile *clientConfig = Globals::Instance()->GetConfig();
//Open the last file in the history
if(clientConfig->getBool("AutoOpenLastSession", true))
{
std::vector<std::string> listFileSession = clientConfig->getArray("RecentFileSession");
for(std::vector<std::string>::iterator iter = listFileSession.begin(); iter != listFileSession.end(); iter++)
{
OpenFile(wxString((*iter).c_str(), wxConvLocal));
wxLogDebug(wxT("Auto Opened: %s"), wxString(*iter));
}
}
}
示例4: initSection
bool Annotation::initSection(const std::string &entry, const std::string &cfgname)
{
AnnotationCfgEntry e, *ne;
ConfigFile *cfg = s2e()->getConfig();
llvm::raw_ostream &os = s2e()->getWarningsStream();
std::vector<std::string> cfgkeys = s2e()->getConfig()->getListKeys(entry);
e.cfgname = cfgname;
bool ok;
e.isActive = cfg->getBool(entry + ".active", false, &ok);
if (!ok) {
os << "You must specify whether the entry is active in " << entry << ".active!" << '\n';
return false;
}
e.module = cfg->getString(entry + ".module", "", &ok);
if (!ok) {
os << "You must specify a valid module for " << entry << ".module!" << '\n';
return false;
}else {
if (!m_moduleExecutionDetector->isModuleConfigured(e.module)) {
os << "The module " << e.module << " is not configured in ModuleExecutionDetector!" << '\n';
return false;
}
}
e.address = cfg->getInt(entry + ".address", 0, &ok);
if (!ok) {
os << "You must specify a valid address for " << entry << ".address!" << '\n';
return false;
}
if (!m_functionMonitor || !m_moduleExecutionDetector || !m_osMonitor) {
os << "You must enable FunctionMonitor, ModuleExecutionDetector, and an OS monitor plugin\n";
return false;
}
// Check if this is a call or an instruction annotation
e.annotation = "";
if (std::find(cfgkeys.begin(), cfgkeys.end(), "callAnnotation") != cfgkeys.end()) {
e.annotation = cfg->getString(entry + ".callAnnotation", e.annotation, &ok);
e.isCallAnnotation = true;
} else if (std::find(cfgkeys.begin(), cfgkeys.end(), "instructionAnnotation") != cfgkeys.end()) {
e.annotation = cfg->getString(entry + ".instructionAnnotation", e.annotation, &ok);
e.isCallAnnotation = false;
}
// Assert that this is a properly attached annotation
if (!ok || e.annotation=="") {
os << "You must specify either " << entry << ".callAnnotation or .instructionAnnotation!" << '\n';
return false;
}
// Get additional annotation-specific options
e.paramCount = 0;
e.beforeInstruction = false;
e.switchInstructionToSymbolic = false;
if (e.isCallAnnotation) {
// Get the number of arguments of the annotated subroutine
e.paramCount = cfg->getInt(entry + ".paramcount", e.paramCount, &ok);
if (!ok) {
os << "You must specify a valid number of function parameters for " << entry << ".paramcount!" << '\n';
return false;
}
} else {
// Whether to call the annotation before or after the instruction
e.beforeInstruction = cfg->getBool(entry + ".beforeInstruction", e.beforeInstruction, &ok);
e.switchInstructionToSymbolic = cfg->getBool(entry + ".switchInstructionToSymbolic", e.switchInstructionToSymbolic, &ok);
}
ne = new AnnotationCfgEntry(e);
m_entries.insert(ne);
return true;
}
示例5: isBlueTeam
GameControllerAlwaysPlaying::GameControllerAlwaysPlaying(ConfigFile & configFile, Log & _log)
: isBlueTeam(configFile.getBool("gameController/isBlueTeam", 1)),
log(_log)
{
}