Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5014 in orxonox.OLD for orxonox/trunk/src/orxonox.cc


Ignore:
Timestamp:
Aug 14, 2005, 4:29:29 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: implemented a new kind of ini-parser
this parser first reads the file, and then one can search through without accessing the file anymore

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/orxonox.cc

    r4985 r5014  
    219219  PRINT(3)("initializing ResourceManager\n");
    220220
    221   // create parser
    222   if( this->iniParser->getSection (CONFIG_SECTION_DATA) == -1)
     221  const char* dataPath;
     222  if ((dataPath = this->iniParser->getVar(CONFIG_NAME_DATADIR, CONFIG_SECTION_DATA))!= NULL)
    223223  {
    224     PRINTF(1)("Could not find Section %s in %s\n", CONFIG_SECTION_DATA, DEFAULT_CONFIG_FILE);
    225     return -1;
    226   }
    227   char namebuf[256];
    228   char valuebuf[256];
    229   memset (namebuf, 0, 256);
    230   memset (valuebuf, 0, 256);
    231 
    232   while( this->iniParser->nextVar (namebuf, valuebuf) != -1)
    233   {
    234     if (!strcmp(namebuf, CONFIG_NAME_DATADIR))
     224    if (!ResourceManager::getInstance()->setDataDir(dataPath))
    235225    {
    236           //  printf("Not yet implemented\n");
    237       if (!ResourceManager::getInstance()->setDataDir(valuebuf))
    238       {
    239         PRINTF(1)("Data Could not be located\n");
    240         exit(-1);
    241       }
     226      PRINTF(1)("Data Could not be located\n");
     227      exit(-1);
    242228    }
    243 
    244     memset (namebuf, 0, 256);
    245     memset (valuebuf, 0, 256);
    246229  }
    247230
Note: See TracChangeset for help on using the changeset viewer.