本文整理汇总了C++中CInifile::sections方法的典型用法代码示例。如果您正苦于以下问题:C++ CInifile::sections方法的具体用法?C++ CInifile::sections怎么用?C++ CInifile::sections使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CInifile
的用法示例。
在下文中一共展示了CInifile::sections方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: load
void manager::load()
{
string_path file_name;
CInifile* config =
xr_new<CInifile>(
FS.update_path(
file_name,
"$game_config$",
"environment\\sound_channels.ltx"
),
TRUE,
TRUE,
FALSE
);
VERIFY(m_channels.empty());
typedef CInifile::Root sections_type;
sections_type& sections = config->sections();
m_channels.reserve(sections.size());
sections_type::const_iterator i = sections.begin();
sections_type::const_iterator e = sections.end();
for (; i != e; ++i)
{
channel* object = xr_new<channel>(*this, (*i)->Name);
object->load(*config);
object->fill(m_collection);
m_channels.push_back(object);
}
xr_delete(config);
}
示例2: get_diff
LPCSTR configs_verifyer::get_diff(CInifile & received,
CInifile & active_params,
string256 & dst_diff)
{
LPCSTR diff_str = NULL;
for (CInifile::RootIt sit = received.sections().begin(),
siet = received.sections().end(); sit != siet; ++sit)
{
CInifile::Sect* tmp_sect = *sit;
if (tmp_sect->Name == cd_info_secion)
continue;
if (tmp_sect->Name == active_params_section)
continue;
diff_str = get_section_diff(tmp_sect, active_params, dst_diff);
if (diff_str)
{
return diff_str;
}
}
strcpy_s(dst_diff, "unknown diff or currepted config dump");
return dst_diff;
}
示例3: time
void weather::load ()
{
string_path file_name;
FS.update_path (file_name, "$game_weathers$", m_id.c_str());
strcat_s (file_name, ".ltx");
CInifile* config = CInifile::Create(file_name);
m_manager.WeatherCycles[m_id].clear ();
typedef CInifile::Root sections_type;
sections_type& sections = config->sections();
m_times.reserve (sections.size());
sections_type::const_iterator i = sections.begin();
sections_type::const_iterator e = sections.end();
for ( ; i != e; ++i) {
time* object = new time(&m_manager, this, (*i)->Name);
object->load (*config);
object->fill (m_collection);
m_times.push_back (object);
m_manager.WeatherCycles[m_id].push_back (object);
}
CInifile::Destroy (config);
}