本文整理汇总了C++中configfile::SectionIterator::getNext方法的典型用法代码示例。如果您正苦于以下问题:C++ SectionIterator::getNext方法的具体用法?C++ SectionIterator::getNext怎么用?C++ SectionIterator::getNext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类configfile::SectionIterator
的用法示例。
在下文中一共展示了SectionIterator::getNext方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Load
//-----------------------------------------------------------------------
void MapUtil::Load()
{
#ifndef _MAPEDITOR
mRoot = new Root("plugins.cfg", "ogre.cfg", "MapSplitter.log");
// Load resource paths from config file
ConfigFile cf;
cf.load("resources.cfg");
// Go through all sections & settings in the file
ConfigFile::SectionIterator seci = cf.getSectionIterator();
String secName, typeName, archName;
while (seci.hasMoreElements())
{
secName = seci.peekNextKey();
ConfigFile::SettingsMultiMap *settings = seci.getNext();
ConfigFile::SettingsMultiMap::iterator i;
for (i = settings->begin(); i != settings->end(); ++i)
{
typeName = i->first;
archName = i->second;
ResourceGroupManager::getSingleton().addResourceLocation(
archName, typeName, secName);
}
}
mOptions = new PagingLandScapeOptions();
mOptions->load("maptool.cfg");
#endif //_MAPEDITOR
}
示例2: setupResources
/// Method which will define the source of resources (other than current folder)
void OgreApp::setupResources(void)
{
// Load resource paths from config file
ConfigFile cf;
cf.load("resources.cfg");
// Go through all sections & settings in the file
ConfigFile::SectionIterator seci = cf.getSectionIterator();
String secName, typeName, archName;
while (seci.hasMoreElements())
{
secName = seci.peekNextKey();
ConfigFile::SettingsMultiMap *settings = seci.getNext();
ConfigFile::SettingsMultiMap::const_iterator i;
for (i = settings->begin(); i != settings->end(); ++i)
{
typeName = i->first;
archName = i->second;
ResourceGroupManager::getSingleton().addResourceLocation(
archName, typeName, secName);
}
}
ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
}
示例3: readCfg
bool Day::readCfg()
{
ConfigFile cf;
cf.load(DAY_DIR(raceName, dayName)+"/"+DAY_CFG);
dprintf(MY_DEBUG_NOTE, "Read day cfg file: %s / %s\n", raceName.c_str(), dayName.c_str());
// Go through all sections & settings in the file
ConfigFile::SectionIterator seci = cf.getSectionIterator();
std::string secName, keyName, valName;
while (seci.hasMoreElements())
{
secName = seci.peekNextKey();
dprintf(MY_DEBUG_NOTE, "\tSection d: %s\n", secName.c_str());
ConfigFile::SettingsMultiMap *settings = seci.getNext();
ConfigFile::SettingsMultiMap::iterator i;
for (i = settings->begin(); i != settings->end(); ++i)
{
keyName = i->first;
valName = i->second;
dprintf(MY_DEBUG_NOTE, "\t\tkey: %s, value: %s\n", keyName.c_str(), valName.c_str());
if (keyName == "long_name")
{
dayLongName = valName;
}/* else if (keyName == "cache_objects")
{
cacheObjects = StringConverter::parseBool(valName, true);
}*/
}
}
return true;
}
示例4: while
void
GraphicsManager::setupResources()
{
ConfigFile configFile;
configFile.load(m_resourcePath + "resources.cfg");
ConfigFile::SectionIterator secItr = configFile.getSectionIterator();
String secName, typeName, archName;
while (secItr.hasMoreElements())
{
secName = secItr.peekNextKey();
ConfigFile::SettingsMultiMap *settings = secItr.getNext();
ConfigFile::SettingsMultiMap::iterator i;
for (i = settings->begin(); i != settings->end(); ++i)
{
typeName = i->first;
archName = i->second;
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
ResourceGroupManager::getSingleton().addResourceLocation(
String(macBundlePath() + "/" + archName), typeName, secName);
#else
ResourceGroupManager::getSingleton().addResourceLocation(
archName, typeName, secName);
#endif
}
}
}
示例5: defineResources
void defineResources(void){
String secName, typeName, archName;
ConfigFile cf;
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
cf.load(macBundlePath() + "/Contents/Resources/resources.cfg");
#else
cf.load("resources.cfg"); //parses
#endif
ConfigFile::SectionIterator seci = cf.getSectionIterator();
while (seci.hasMoreElements()){ //start looping in the content
secName = seci.peekNextKey(); //get all the content
ConfigFile::SettingsMultiMap *settings = seci.getNext(); //only points to content address
ConfigFile::SettingsMultiMap::iterator i;
for (i = settings->begin(); i != settings->end(); ++i){
typeName = i->first;
archName = i->second;
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
ResourceGroupManager::getSingleton().addResourceLocation( String(macBundlePath() + "/" + archName), typeName, secName);
#else
ResourceGroupManager::getSingleton().addResourceLocation( archName, typeName, secName);
#endif
}
}
}
示例6: setupResources
// Get the resources sources
void ClientMain::setupResources()
{
ConfigFile cf;
ConfigFile::SettingsMultiMap* settings;
ConfigFile::SettingsMultiMap::iterator i;
String secName, typeName, archName;
// Load other resource paths from config file
cf.load(ClientConfig::getSingle() ->getPath(String("resources.cfg")));
// Go through all sections & settings in the file
ConfigFile::SectionIterator seci = cf.getSectionIterator();
while (seci.hasMoreElements()) {
secName = seci.peekNextKey();
settings = seci.getNext();
for (i = settings->begin(); i != settings->end(); ++i) {
typeName = i->first;
archName = i->second;
ResourceGroupManager::getSingleton().addResourceLocation(archName, typeName, secName);
}
}
// Initialise and parse ressources
TextureManager::getSingleton() .setDefaultNumMipmaps(5);
ResourceGroupManager::getSingleton() .initialiseAllResourceGroups();
}
示例7: setUp
void TerrainTests::setUp()
{
mRoot = OGRE_NEW Root();
// Load resource paths from config file
ConfigFile cf;
cf.load("resources.cfg");
// Go through all sections & settings in the file
ConfigFile::SectionIterator seci = cf.getSectionIterator();
String secName, typeName, archName;
while (seci.hasMoreElements())
{
secName = seci.peekNextKey();
ConfigFile::SettingsMultiMap *settings = seci.getNext();
ConfigFile::SettingsMultiMap::iterator i;
for (i = settings->begin(); i != settings->end(); ++i)
{
typeName = i->first;
archName = i->second;
ResourceGroupManager::getSingleton().addResourceLocation(
archName, typeName, secName);
}
}
mSceneMgr = mRoot->createSceneManager(ST_GENERIC);
}
示例8: setupResources
void GameManager::setupResources(void)
{
// load resource paths from config file
ConfigFile cf;
std::string ResourcePath;
ResourcePath = "..\\media\\";
cf.load(ResourcePath + "resources.cfg");
// go through all settings in the file
ConfigFile::SectionIterator seci = cf.getSectionIterator();
String secName, typeName, archName;
while(seci.hasMoreElements())
{
secName = seci.peekNextKey();
ConfigFile::SettingsMultiMap *settings = seci.getNext();
ConfigFile::SettingsMultiMap::iterator i;
for(i = settings->begin() ; i != settings->end() ; ++i)
{
typeName = i->first;
archName = i->second;
ResourceGroupManager::getSingleton().addResourceLocation(
ResourcePath + archName, typeName, secName);
}
}
ParticleSystemRendererFactory* mParticleSystemRendererFact;
ParticleEmitterFactory* mParticleEmitterFact;
mParticleSystemRendererFact = OGRE_NEW ShaderParticleRendererFactory();
mParticleEmitterFact = OGRE_NEW BoxEmitterFactory();
ParticleSystemManager::getSingleton().addRendererFactory(mParticleSystemRendererFact);
ParticleSystemManager::getSingleton().addEmitterFactory(mParticleEmitterFact);
}
示例9: RemoveResourceLocations
void AApplication::RemoveResourceLocations(std::string path)
{
// Load resource paths from config file
ConfigFile cf;
cf.load(path+"resources.cfg");
// Go through all sections & settings in the file
ConfigFile::SectionIterator seci = cf.getSectionIterator();
String secName, typeName, archName;
while (seci.hasMoreElements())
{
secName = seci.peekNextKey();
ConfigFile::SettingsMultiMap *settings = seci.getNext();
ConfigFile::SettingsMultiMap::iterator i;
for (i = settings->begin(); i != settings->end(); ++i)
{
typeName = i->first;
archName = i->second;
ResourceGroupManager::getSingleton().removeResourceLocation(archName, secName);
}
}
}
示例10: setupResources
/// Method which will define the source of resources (other than current folder)
void Renderer::setupResources(void)
{
// Load resource paths from config file
ConfigFile cf;
cf.load(mResourcePath + "resources.cfg");
// Go through all sections & settings in the file
ConfigFile::SectionIterator seci = cf.getSectionIterator();
String secName, typeName, archName;
while (seci.hasMoreElements())
{
secName = seci.peekNextKey();
ConfigFile::SettingsMultiMap *settings = seci.getNext();
ConfigFile::SettingsMultiMap::iterator i;
for (i = settings->begin(); i != settings->end(); ++i)
{
typeName = i->first;
archName = i->second;
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
// OS X does not set the working directory relative to the app,
// In order to make things portable on OS X we need to provide
// the loading with it's own bundle path location
ResourceGroupManager::getSingleton().addResourceLocation(
String(macBundlePath() + "/" + archName), typeName, secName);
#else
ResourceGroupManager::getSingleton().addResourceLocation(
archName, typeName, secName);
#endif
}
}
}
示例11: setupResources
//------------------------------------------------------------------------------------------
/// Method which will define the source of resources (other than current folder)
void CRtcApplication::setupResources()
{
// Load resource paths from config file
ConfigFile cf;
cf.load(mResourcePath + skResourceFilename);
// Go through all sections & settings in the file
ConfigFile::SectionIterator seci = cf.getSectionIterator();
String secName, typeName, archName;
while (seci.hasMoreElements())
{
secName = seci.peekNextKey();
ConfigFile::SettingsMultiMap *settings = seci.getNext();
ConfigFile::SettingsMultiMap::iterator i;
for (i = settings->begin(); i != settings->end(); ++i)
{
typeName = i->first;
archName = i->second;
ResourceGroupManager::getSingleton().addResourceLocation( String(mOGREResourcePath + "/" + archName), typeName, secName);
if ( typeName == "FileSystem" )
{
ResourceGroupManager::getSingleton().addResourceLocation( String(mResourcePath + archName), typeName, secName);
}
}
}
}
示例12: setupResources
void OgreApp::setupResources(void){
Ogre::ResourceGroupManager* res_manager = Ogre::ResourceGroupManager::getSingletonPtr();
#if 0
std::string res_path = respath + "materials/programs";
res_manager->addResourceLocation(res_path, "FileSystem", "General");
res_path = respath + "materials/scripts";
res_manager->addResourceLocation(res_path, "FileSystem", "General");
res_path = respath + "materials/textures";
res_manager->addResourceLocation(res_path, "FileSystem", "General");
res_path = respath + "models";
res_manager->addResourceLocation(res_path, "FileSystem", "General");
#endif
// Load resource paths from config file
ConfigFile cf;
#if( CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID )
if (gAssetMgr) {
ArchiveManager::getSingleton().addArchiveFactory(
new APKFileSystemArchiveFactory(gAssetMgr) );
ArchiveManager::getSingleton().addArchiveFactory(
new APKZipArchiveFactory(gAssetMgr) );
}
cf.load(openAPKFile(resource_cfg_file));
#else
cf.load(mResourcePath + resource_cfg_file);
#endif
// Go through all sections & settings in the file
ConfigFile::SectionIterator seci = cf.getSectionIterator();
String sec, type, arch;
while (seci.hasMoreElements()){
sec = seci.peekNextKey();
ConfigFile::SettingsMultiMap *settings = seci.getNext();
ConfigFile::SettingsMultiMap::iterator i;
for (i = settings->begin(); i != settings->end(); ++i){
type = i->first;
arch = i->second;
#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS
// OS X does not set the working directory relative to the app,
// In order to make things portable on OS X we need to provide
// the loading with it's own bundle path location
arch = String(macBundlePath) + "/" + arch;
#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID
// arch= "assets/" + arch;
#else
//notice: mResourcePath must be prefix
arch= mResourcePath + arch;
#endif
res_manager->addResourceLocation(arch, type, sec);
}
}
#if( CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID )
res_manager->initialiseResourceGroup(Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
#endif
}
示例13: setupResources
void GameManager::setupResources( void ) {
// Load resource paths from config file
ConfigFile cf;
cf.load( "resources.cfg" );
// Go through all settings in the file
ConfigFile::SectionIterator itSection = cf.getSectionIterator();
String sSection, sType, sArch;
while( itSection.hasMoreElements() ) {
sSection = itSection.peekNextKey();
ConfigFile::SettingsMultiMap *mapSettings = itSection.getNext();
ConfigFile::SettingsMultiMap::iterator itSetting = mapSettings->begin();
while( itSetting != mapSettings->end() ) {
sType = itSetting->first;
sArch = itSetting->second;
ResourceGroupManager::getSingleton().addResourceLocation(
sArch, sType, sSection );
++itSetting;
}
}
}
示例14: setUp
//--------------------------------------------------------------------------
void MeshLodTests::setUp()
{
mFSLayer = OGRE_NEW_T(Ogre::FileSystemLayer, Ogre::MEMCATEGORY_GENERAL)(OGRE_VERSION_NAME);
#ifdef OGRE_STATIC_LIB
mStaticPluginLoader = OGRE_NEW StaticPluginLoader();
Root* root = OGRE_NEW Root(BLANKSTRING);
mStaticPluginLoader.load();
#else
String pluginsPath = mFSLayer->getConfigFilePath("plugins.cfg");
Root* root = OGRE_NEW Root(pluginsPath);
#endif
CPPUNIT_ASSERT(!root->getAvailableRenderers().empty());
root->setRenderSystem(root->getAvailableRenderers().back());
root->initialise(false); // Needed for setting up HardwareBufferManager
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
Ogre::NameValuePairList misc;
// Tell OGRE that we're using cocoa, so it doesn't need to make a window for us
misc["macAPI"] = "cocoa";
root->createRenderWindow("", 320, 240, false, &misc)->setHidden(true);
#else
root->createRenderWindow("", 320, 240, false, NULL)->setHidden(true);
#endif
new MeshLodGenerator;
// Load resource paths from config file
ConfigFile cf;
String resourcesPath;
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE || OGRE_PLATFORM == OGRE_PLATFORM_WIN32
resourcesPath = mFSLayer->getConfigFilePath("resources.cfg");
#else
resourcesPath = mFSLayer->getConfigFilePath("bin/resources.cfg");
#endif
cf.load(resourcesPath);
// Go through all sections & settings in the file
ConfigFile::SectionIterator seci = cf.getSectionIterator();
String secName, typeName, archName;
while (seci.hasMoreElements()) {
secName = seci.peekNextKey();
ConfigFile::SettingsMultiMap* settings = seci.getNext();
ConfigFile::SettingsMultiMap::iterator i;
for (i = settings->begin(); i != settings->end(); ++i) {
typeName = i->first;
archName = i->second;
ResourceGroupManager::getSingleton().addResourceLocation(
archName, typeName, secName);
}
}
// Create the mesh for testing
mMesh = MeshManager::getSingleton().load("Sinbad.mesh", ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
}
示例15: setUp
void TerrainTests::setUp()
{
// set up silent logging to not pollute output
if(LogManager::getSingletonPtr())
OGRE_DELETE Ogre::LogManager::getSingletonPtr();
if(LogManager::getSingletonPtr() == 0)
{
LogManager* logManager = OGRE_NEW LogManager();
logManager->createLog("testTerrain.log", true, false);
}
LogManager::getSingleton().setLogDetail(LL_LOW);
mFSLayer = OGRE_NEW_T(Ogre::FileSystemLayer, Ogre::MEMCATEGORY_GENERAL)(OGRE_VERSION_NAME);
#ifdef OGRE_STATIC_LIB
mRoot = OGRE_NEW Root(BLANKSTRING);
mStaticPluginLoader.load();
#else
String pluginsPath = mFSLayer->getConfigFilePath("plugins.cfg");
mRoot = OGRE_NEW Root(pluginsPath);
#endif
mTerrainOpts = OGRE_NEW TerrainGlobalOptions();
// Load resource paths from config file
ConfigFile cf;
String resourcesPath;
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE || OGRE_PLATFORM == OGRE_PLATFORM_WIN32
resourcesPath = mFSLayer->getConfigFilePath("resources.cfg");
#else
resourcesPath = mFSLayer->getConfigFilePath("bin/resources.cfg");
#endif
cf.load(resourcesPath);
// Go through all sections & settings in the file
ConfigFile::SectionIterator seci = cf.getSectionIterator();
String secName, typeName, archName;
while (seci.hasMoreElements())
{
secName = seci.peekNextKey();
ConfigFile::SettingsMultiMap *settings = seci.getNext();
ConfigFile::SettingsMultiMap::iterator i;
for (i = settings->begin(); i != settings->end(); ++i)
{
typeName = i->first;
archName = i->second;
ResourceGroupManager::getSingleton().addResourceLocation(
archName, typeName, secName);
}
}
mSceneMgr = mRoot->createSceneManager(ST_GENERIC);
}