Changeset 7421 for sandbox_qt/src/libraries/core/PathConfig.h
- Timestamp:
- Sep 12, 2010, 12:47:30 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox_qt/src/libraries/core/PathConfig.h
r7401 r7421 39 39 #include <string> 40 40 #include <vector> 41 #include <QDir> 41 42 #include "util/Singleton.h" 42 43 43 //tolua_begin44 44 namespace orxonox 45 45 { 46 //tolua_end47 46 /** 48 47 @brief 49 48 The PathConfig class is a singleton used to configure different paths. 50 49 @details 51 The class provides information about the data, config, log, executable ,52 root and modulepath.50 The class provides information about the data, config, log, executable 51 and root path. 53 52 It determines those by the use of platform specific functions. 54 53 @remarks 55 54 Not all paths are always available: 56 55 - root only when installed copyable 57 - externalData only for development builds in the build tree58 56 */ 59 class _CoreExport PathConfig //tolua_export 60 : public Singleton<PathConfig> 61 { //tolua_export 57 class _CoreExport PathConfig : public Singleton<PathConfig> 58 { 62 59 friend class Singleton<PathConfig>; 63 60 friend class Core; … … 66 63 /** 67 64 @brief 68 Retriev s the executable path and sets all hard coded fixed paths (currently only the module path)65 Retrieves the executable path and sets all hard coded fixed paths (currently only the module path) 69 66 Also checks for "orxonox_dev_build.keep_me" in the executable diretory. 70 67 If found it means that this is not an installed run, hence we … … 76 73 ~PathConfig(); 77 74 78 //! Returns the path to the root folder as boost::filesystem::path79 static const boost::filesystem::path& getRootPath()75 //! Returns the path to the root folder as QDir 76 static const QDir& getRootPath() 80 77 { return getInstance().rootPath_; } 81 //! Returns the path to the executable folder as boost::filesystem::path82 static const boost::filesystem::path& getExecutablePath()78 //! Returns the path to the executable folder as QDir 79 static const QDir& getExecutablePath() 83 80 { return getInstance().executablePath_; } 84 //! Returns the path to the data files as boost::filesystem::path85 static const boost::filesystem::path& getDataPath()81 //! Returns the path to the data files as QDir 82 static const QDir& getDataPath() 86 83 { return getInstance().dataPath_; } 87 //! Returns the path to the external data files as boost::filesystem::path 88 static const boost::filesystem::path& getExternalDataPath() 89 { return getInstance().externalDataPath_; } 90 //! Returns the path to the config files as boost::filesystem::path 91 static const boost::filesystem::path& getConfigPath() 84 //! Returns the path to the config files as QDir 85 static const QDir& getConfigPath() 92 86 { return getInstance().configPath_; } 93 //! Returns the path to the log files as boost::filesystem::path94 static const boost::filesystem::path& getLogPath()87 //! Returns the path to the log files as QDir 88 static const QDir& getLogPath() 95 89 { return getInstance().logPath_; } 96 //! Returns the path to the modules as boost::filesystem::path97 static const boost::filesystem::path& getModulePath()98 { return getInstance().modulePath_; }99 90 100 91 //! Returns the path to the root folder as std::string … … 104 95 //! Returns the path to the data files as std::string 105 96 static std::string getDataPathString(); 106 //! Returns the path to the external data files as std::string107 static std::string getExternalDataPathString();108 97 //! Returns the path to the config files as std::string 109 98 static std::string getConfigPathString(); //tolua_export 110 99 //! Returns the path to the log files as std::string 111 100 static std::string getLogPathString(); 112 //! Returns the path to the modules as std::string113 static std::string getModulePathString();114 101 115 102 //! Return trrue for runs in the build directory (not installed) … … 126 113 */ 127 114 void setConfigurablePaths(); 128 //! Returns a list with all modules declared by a *.module file in the module folder.129 std::vector<std::string> getModulePaths();130 115 131 116 //! Path to the parent directory of the ones above if program was installed with relativ paths 132 boost::filesystem::path& rootPath_; 133 boost::filesystem::path& executablePath_; //!< Path to the executable 134 boost::filesystem::path& modulePath_; //!< Path to the modules 135 boost::filesystem::path& dataPath_; //!< Path to the data files folder 136 boost::filesystem::path& externalDataPath_; //!< Path to the external data files folder 137 boost::filesystem::path& configPath_; //!< Path to the config files folder 138 boost::filesystem::path& logPath_; //!< Path to the log files folder 117 QDir rootPath_; 118 QDir executablePath_; //!< Path to the executable 119 QDir dataPath_; //!< Path to the data files folder 120 QDir configPath_; //!< Path to the config files folder 121 QDir logPath_; //!< Path to the log files folder 139 122 140 bool 123 bool bDevRun_; //!< True for runs in the build directory (not installed) 141 124 static PathConfig* singletonPtr_s; 142 125 }; //tolua_export
Note: See TracChangeset
for help on using the changeset viewer.