예제 #1
0
double CConfiguration::getValue(const string &varName, double defaultValue)
{
	if (m_ConfigFile.exists(varName)) return m_ConfigFile.getVar(varName).asDouble();
	CConfigFile::CVar varToCopy;
	varToCopy.forceAsDouble(defaultValue);	
	m_ConfigFile.insertVar(varName, varToCopy);
	return defaultValue;
}
예제 #2
0
float CConfiguration::getValue(const string &varName, float defaultValue)
{
	if (ConfigFile.exists(varName)) return ConfigFile.getVar(varName).asFloat();
	CConfigFile::CVar varToCopy;
	varToCopy.forceAsDouble((double)defaultValue);	
	ConfigFile.insertVar(varName, varToCopy);
	return defaultValue;
}