示例#1
0
文件: Scene.cpp 项目: Reyfin/MyEngine
bool look(libconfig::Setting& setting,std::string place,ValueType &value)
{
	if (setting.exists(place))
	{
		return setting.lookupValue(place, value);

	}
	else std::cout << setting.getPath() + place << " does not exist. Value remains unchanged." << std::endl;
	return false;
}
MillerReciprocalHexIndices readMillerReciprocalHexIndices(const libconfig::Setting& stg)
{
    MillerReciprocalHexIndices index;
	if(stg.isArray() && stg.getLength() == MillerHexIndicesDimension)
	{
			index.H = stg[0];
			index.K = stg[1];
			index.I = stg[2];
			index.L = stg[3];
	}
	else
	{
		throw ProgramSettings::Exception("Check setting: " + toString(stg.getPath()));
	}
	return index;
}
示例#3
0
void SettingUsageRecorder::markAsUsed(const libconfig::Setting & s){
    used_paths.insert(s.getPath());
}