Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7611 in orxonox.OLD for branches/qt_gui/src/lib/util/loading


Ignore:
Timestamp:
May 12, 2006, 4:15:39 PM (19 years ago)
Author:
bensch
Message:

File stuff started

Location:
branches/qt_gui/src/lib/util/loading
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/qt_gui/src/lib/util/loading/resource_manager.cc

    r7460 r7611  
    1717
    1818#include "util/loading/resource_manager.h"
    19 
     19#include "file.h"
    2020#include "substring.h"
    2121#include "debug.h"
     
    6060
    6161  this->dataDir = "./";
    62   this->_cwd = "";
    6362  this->tryDataDir("./data");
    6463}
     
    874873    if (name[0] == '.' && name[1] != '.')
    875874      retName.erase(0);
    876     const std::string& absDir = ResourceManager::cwd();
     875    const std::string& absDir = File::cwd();
    877876    retName = absDir + retName;
    878877  }
     
    896895  else
    897896    return "";
    898 }
    899 
    900 #ifdef __unix__
    901   #include <unistd.h>
    902 #elif __WIN32__ || _MS_DOS_
    903   #include <dir.h>
    904 #else
    905   #include <direct.h> /* Visual C++ */
    906 #endif
    907 /**
    908  * @returns the Current Woring Directory
    909  */
    910 const std::string& ResourceManager::cwd()
    911 {
    912   if (ResourceManager::getInstance()->_cwd.empty())
    913   {
    914     char cwd[1024];
    915     char* errorCode = getcwd(cwd, 1024);
    916     if (errorCode == 0)
    917       return ResourceManager::getInstance()->_cwd;
    918 
    919     ResourceManager::getInstance()->_cwd = cwd;
    920   }
    921   return ResourceManager::getInstance()->_cwd;
    922897}
    923898
  • branches/qt_gui/src/lib/util/loading/resource_manager.h

    r7225 r7611  
    138138  static bool isInDataDir(const std::string& fileName);
    139139  static std::string getAbsDir(const std::string& fileName);
    140   static const std::string& cwd();
    141140
    142141  static const char* ResourceTypeToChar(ResourceType type);
     
    151150  static ResourceManager*    singletonRef;       //!< singleton Reference
    152151
    153   std::string                _cwd;               //!< The currend Working directory.
    154152  std::string                dataDir;            //!< The Data Directory, where all relevant Data is stored.
    155153  std::vector<std::string>   imageDirs;          //!< A list of directories in which images are stored.
Note: See TracChangeset for help on using the changeset viewer.