本文整理汇总了C++中Global::readFile方法的典型用法代码示例。如果您正苦于以下问题:C++ Global::readFile方法的具体用法?C++ Global::readFile怎么用?C++ Global::readFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Global
的用法示例。
在下文中一共展示了Global::readFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadScenes
void Global::loadScenes()
{
string sz_scenes = global.readFile("./config/scenes.cfg");
JSONValue *j_val = JSON::parse(sz_scenes.c_str());
ASSERT_WITH_CODE(j_val != NULL, "Config file corrupted!...", return);
JSONObject j_scenes_obj = j_val->asObject();
_scenes.clear();
for(JSONObject::iterator it_scene = j_scenes_obj.begin(); it_scene != j_scenes_obj.end(); ++it_scene)
{
map<string, map<string, Value> > sources;
JSONObject j_sources_obj = it_scene->second->asObject();
for(JSONObject::iterator it_sources = j_sources_obj.begin(); it_sources != j_sources_obj.end(); ++it_sources)
{
map<string, Value> source_settings;
JSONObject j_source_settings_obj = it_sources->second->asObject();
for(JSONObject::iterator it_source_settings = j_source_settings_obj.begin(); it_source_settings != j_source_settings_obj.end(); ++it_source_settings)
{
Value vec(it_source_settings->second->asNumber());
source_settings[it_source_settings->first] = vec;
}
sources[it_sources->first] = source_settings;
}
_scenes[it_scene->first] = sources;
}
delete j_val;
}