本文整理汇总了C++中ConfigFile::get方法的典型用法代码示例。如果您正苦于以下问题:C++ ConfigFile::get方法的具体用法?C++ ConfigFile::get怎么用?C++ ConfigFile::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfigFile
的用法示例。
在下文中一共展示了ConfigFile::get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Assert
StarCatalog::StarCatalog(
const InputCatalog& incat,
const ConfigFile& params, std::string fs_prefix) :
_id(incat.getIdList()), _pos(incat.getPosList()),
_sky(incat.getSkyList()), _noise(incat.getNoiseList()),
_flags(incat.getFlagsList()), _mag(incat.getMagList()),
_sg(incat.getSgList()), _nu(_id.size(),DEFVALNEG),
_objsize(incat.getObjSizeList()),
_is_star(_id.size(),0), _params(params), _prefix(fs_prefix)
{
Assert(int(_id.size()) == size());
Assert(int(_pos.size()) == size());
Assert(int(_sky.size()) == size());
Assert(int(_noise.size()) == size());
Assert(int(_flags.size()) == size());
if (_sg.size() == 0) _sg.resize(size(),DEFVALNEG);
Assert(int(_sg.size()) == size());
if (_nu.size() == 0) _nu.resize(size(),DEFVALNEG);
Assert(int(_nu.size()) == size());
if (_objsize.size() == 0) _objsize.resize(size(),DEFVALNEG);
Assert(int(_objsize.size()) == size());
Assert(int(_is_star.size()) == size());
if (params.read("cat_all_stars",false)) {
for(int i=0;i<size();++i) _is_star[i] = 1;
} else if (params.read("stars_trust_sg",false)) {
double minsg = params.get("stars_minsg");
double maxsg = params.get("stars_maxsg");
Assert(int(_sg.size()) == size());
for(int i=0;i<size();++i)
_is_star[i] = (_sg[i] >= minsg && _sg[i] <= maxsg);
} else {
Assert(int(_mag.size()) == size());
}
}
示例2: cfgLoadStr
string cfgLoadStr(const wchar * Section, const wchar * Key, const wchar* Default)
{
if(!cfgdb.has_entry(string(Section), string(Key)))
{
cfgSaveStr(Section, Key, Default);
}
return cfgdb.get(string(Section), string(Key), string(Default));
}
示例3: load_mapping
EvdevControllerMapping load_mapping(FILE* fd)
{
ConfigFile mf;
mf.parse(fd);
EvdevControllerMapping mapping = {
mf.get("emulator", "mapping_name", "<Unknown>").c_str(),
load_keycode(&mf, "dreamcast", "btn_a"),
load_keycode(&mf, "dreamcast", "btn_b"),
load_keycode(&mf, "dreamcast", "btn_c"),
load_keycode(&mf, "dreamcast", "btn_d"),
load_keycode(&mf, "dreamcast", "btn_x"),
load_keycode(&mf, "dreamcast", "btn_y"),
load_keycode(&mf, "dreamcast", "btn_z"),
load_keycode(&mf, "dreamcast", "btn_start"),
load_keycode(&mf, "emulator", "btn_escape"),
load_keycode(&mf, "dreamcast", "btn_dpad1_left"),
load_keycode(&mf, "dreamcast", "btn_dpad1_right"),
load_keycode(&mf, "dreamcast", "btn_dpad1_up"),
load_keycode(&mf, "dreamcast", "btn_dpad1_down"),
load_keycode(&mf, "dreamcast", "btn_dpad2_left"),
load_keycode(&mf, "dreamcast", "btn_dpad2_right"),
load_keycode(&mf, "dreamcast", "btn_dpad2_up"),
load_keycode(&mf, "dreamcast", "btn_dpad2_down"),
load_keycode(&mf, "compat", "btn_trigger_left"),
load_keycode(&mf, "compat", "btn_trigger_right"),
load_keycode(&mf, "compat", "axis_dpad1_x"),
load_keycode(&mf, "compat", "axis_dpad1_y"),
load_keycode(&mf, "compat", "axis_dpad2_x"),
load_keycode(&mf, "compat", "axis_dpad2_y"),
load_keycode(&mf, "dreamcast", "axis_x"),
load_keycode(&mf, "dreamcast", "axis_y"),
load_keycode(&mf, "dreamcast", "axis_trigger_left"),
load_keycode(&mf, "dreamcast", "axis_trigger_right"),
mf.get_bool("compat", "axis_x_inverted", false),
mf.get_bool("compat", "axis_y_inverted", false),
mf.get_bool("compat", "axis_trigger_left_inverted", false),
mf.get_bool("compat", "axis_trigger_right_inverted", false)
};
return mapping;
}
示例4: position
ParticleSystem::ParticleSystem(TextureManager &texture_manager, ConfigFile &config_file)
: position(0, 0, 0), unitx(1,0,0), unity(0,1,0), unitz(0,0,1), enabled(true), active(true), alive(true)
{
string texture;
config_file.selectSection("ParticleSystem");
config_file.get("dimensions", dimensions);
config_file.get("maxparticles", maxparticles);
config_file.get("minspawntime", minspawntime);
config_file.get("maxspawntime", maxspawntime);
config_file.get("maxspawncount", maxspawncount);
config_file.selectSection("SpawnVelocity");
config_file.get("min", minvel);
config_file.get("max", maxvel);
config_file.get("acceleration", acceleration);
config_file.selectSection("Particle");
config_file.get("texture", texture);
config_file.get("startsize", startsize);
config_file.get("endsize", endsize);
config_file.get("minlifetime", minlifetime);
config_file.get("maxlifetime", maxlifetime);
config_file.get("startangle", startangle);
config_file.get("endangle", endangle);
config_file.get("startcolor", startcolor);
config_file.get("endcolor", endcolor);
this->texture = texture_manager.load(texture);
spawntime = 0.0;
}