Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4167 in orxonox.OLD


Ignore:
Timestamp:
May 11, 2005, 3:14:03 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: check if file exists

File:
1 edited

Legend:

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

    r4166 r4167  
    643643/**
    644644    \param fileName the Name of the File to check
    645     \returns The full name of the file, including the DataDir
     645    \returns The full name of the file, including the DataDir, and NULL if the file does not exist
    646646    IMPORTANT: this has to be deleted from the outside
    647647*/
     
    650650  char* retName = new char[strlen(ResourceManager::getInstance()->getDataDir()) + strlen(fileName)+1];
    651651  sprintf(retName, "%s%s", ResourceManager::getInstance()->getDataDir(), fileName);
    652   return retName;
     652  if (ResourceManager::isFile(retName))
     653    return retName;
     654  else
     655    {
     656      delete retName;
     657      return NULL;
     658    }
    653659}
    654660
Note: See TracChangeset for help on using the changeset viewer.