Exemplo n.º 1
0
void CConfigFile::setInt64(const std::string & key, const int64_t val)
{
	bool tmpUnknownKeyQueryedFlag = unknownKeyQueryedFlag;
	unknownKeyQueryedFlag = false;
	int64_t oldVal = getInt64(key);

	if ((oldVal != val) || (unknownKeyQueryedFlag))
	{
		modifiedFlag = true;
		storeInt64(key, val);
	}

	unknownKeyQueryedFlag = tmpUnknownKeyQueryedFlag;
}
Exemplo n.º 2
0
int64_t CConfigFile::getInt64(const std::string & key, const int64_t defaultVal)
{
	//an empty string returns always 0. in this case return the default value!
	if (configData.find(key) == configData.end() || configData[key].empty())
	{
		unknownKeyQueryedFlag = true;
		if (saveDefaults) {
			storeInt64(key, defaultVal);
		}
		else {
			return defaultVal;
		}
	}

	return atoll(configData[key].c_str());
}
Exemplo n.º 3
0
int64_t CConfigFile::getInt64(const std::string & key, const int64_t defaultVal)
{
	if (configData.find(key) == configData.end())
	{
		if (saveDefaults) 
		{
			unknownKeyQueryedFlag = true;
			storeInt64(key, defaultVal);
		}
		else 
		{
			return defaultVal;
		}
	}

	return atoll(configData[key].c_str());
}