当前位置: 首页>>代码示例>>C++>>正文


C++ SectionIterator::hasMoreElements方法代码示例

本文整理汇总了C++中configfile::SectionIterator::hasMoreElements方法的典型用法代码示例。如果您正苦于以下问题:C++ SectionIterator::hasMoreElements方法的具体用法?C++ SectionIterator::hasMoreElements怎么用?C++ SectionIterator::hasMoreElements使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在configfile::SectionIterator的用法示例。


在下文中一共展示了SectionIterator::hasMoreElements方法的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
    }
开发者ID:proton,项目名称:ireon,代码行数:30,代码来源:MapUtil.cpp

示例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();
}
开发者ID:aufheben1,项目名称:visual-experiments,代码行数:26,代码来源:OgreApp.cpp

示例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;
}
开发者ID:Berkananna,项目名称:rallyraid,代码行数:33,代码来源:Day.cpp

示例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
        }
    }
}
开发者ID:twiad,项目名称:COA-Jump-And-Run---Engine,代码行数:28,代码来源:GraphicsManager.cpp

示例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
            }
        }
    }
开发者ID:ramyD,项目名称:boksey,代码行数:28,代码来源:main.cpp

示例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();
}
开发者ID:wengerclub,项目名称:3DInteractiveSimulation,代码行数:29,代码来源:ClientMain.cpp

示例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);

}
开发者ID:brunobg,项目名称:TuxSinbad,代码行数:30,代码来源:TerrainTests.cpp

示例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);
}
开发者ID:xDusk,项目名称:lostisland04,代码行数:33,代码来源:GameManager.cpp

示例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);
        }
    }

}
开发者ID:beorc,项目名称:flare_star,代码行数:25,代码来源:AApplication.cpp

示例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
        }
    }
}
开发者ID:mwilksy,项目名称:ogreGame,代码行数:33,代码来源:Renderer.cpp

示例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);
            }
        }
    }
}
开发者ID:leandronunescorreia,项目名称:realtimecameras,代码行数:30,代码来源:crtcapplication.cpp

示例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
}
开发者ID:dorgonman,项目名称:cocos2d-x-ogre,代码行数:60,代码来源:ogreapp.cpp

示例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;
        }
    }

}
开发者ID:ramyD,项目名称:Fourth,代码行数:26,代码来源:GameManager.cpp

示例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);
}
开发者ID:whztt07,项目名称:ogre3d,代码行数:59,代码来源:MeshLodTests.cpp

示例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);

}
开发者ID:j-rivero,项目名称:ogre-acornacorn,代码行数:57,代码来源:TerrainTests.cpp


注:本文中的configfile::SectionIterator::hasMoreElements方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。