void CConfigFile::setBool(const std::string & key, const bool val) { bool tmpUnknownKeyQueryedFlag = unknownKeyQueryedFlag; unknownKeyQueryedFlag = false; bool oldVal = getBool(key); if ((oldVal != val) || (unknownKeyQueryedFlag)) { modifiedFlag = true; storeBool(key, val); } unknownKeyQueryedFlag = tmpUnknownKeyQueryedFlag; }
bool CConfigFile::getBool(const std::string & key, const bool defaultVal) { if (configData.find(key) == configData.end()) { unknownKeyQueryedFlag = true; if (saveDefaults) { storeBool(key, defaultVal); } else { return defaultVal; } } return !((configData[key] == "false") || (configData[key] == "0")); }
void IpeEnv::storeFoo(LcnSymbol* sym, IpeValue value) { #if 0 if (sym->type == dtBools[BOOL_SIZE_SYS]) { storeBool(sym, value.boolGet()); } else if (sym->type == dtInt[INT_SIZE_64]) { storeInteger(sym, value.integerGet()); } else if (sym->type == dtReal[FLOAT_SIZE_64]) { storeReal(sym, value.realGet()); } else { AstDumpToNode logger(stdout, 3); printf("\n\n"); printf(" IpeEnv::store(LcnSymbol*) Unsupported\n"); printf(" "); sym->accept(&logger); printf("\n\n"); INT_ASSERT(false); } #endif INT_ASSERT(false); }