- Timestamp:
- May 30, 2015, 12:22:27 PM (9 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core7/src/libraries/core/ConfigurablePaths.h
r10457 r10509 32 32 */ 33 33 34 #ifndef _ PathConfig_H__35 #define _ PathConfig_H__34 #ifndef _ConfigurablePaths_H__ 35 #define _ConfigurablePaths_H__ 36 36 37 37 #include "CorePrereqs.h" 38 38 39 39 #include <string> 40 #include <vector>41 40 #include "util/Singleton.h" 42 41 … … 47 46 /** 48 47 @brief 49 The PathConfigclass is a singleton used to configure different paths.48 The ConfigurablePaths 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 module path. 53 It determines those by the use of platform specific functions. 50 The class provides information about the data, config, and log path. 54 51 @remarks 55 52 Not all paths are always available: 56 - root only when installed copyable57 53 - externalData only for development builds in the build tree 58 54 */ 59 class _CoreExport PathConfig//tolua_export60 : public Singleton< PathConfig>55 class _CoreExport ConfigurablePaths //tolua_export 56 : public Singleton<ConfigurablePaths> 61 57 { //tolua_export 62 friend class Singleton<PathConfig>; 63 friend class Core; 58 friend class Singleton<ConfigurablePaths>; 64 59 65 60 public: 66 /** 67 @brief 68 Retrieves the executable path and sets all hard coded fixed paths (currently only the module path) 69 Also checks for "orxonox_dev_build.keep_me" in the executable diretory. 70 If found it means that this is not an installed run, hence we 71 don't write the logs and config files to ~/.orxonox 72 @throw 73 GeneralException 74 */ 75 PathConfig(); 76 ~PathConfig(); 61 ConfigurablePaths(); 62 ~ConfigurablePaths(); 77 63 78 //! Returns the path to the root folder as boost::filesystem::path79 static const boost::filesystem::path& getRootPath()80 { return getInstance().rootPath_; }81 //! Returns the path to the executable folder as boost::filesystem::path82 static const boost::filesystem::path& getExecutablePath()83 { return getInstance().executablePath_; }84 64 //! Returns the path to the data files as boost::filesystem::path 85 65 static const boost::filesystem::path& getDataPath() … … 94 74 static const boost::filesystem::path& getLogPath() 95 75 { 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 76 100 //! Returns the path to the root folder as std::string101 static std::string getRootPathString();102 //! Returns the path to the executable folder as std::string103 static std::string getExecutablePathString();104 77 //! Returns the path to the data files as std::string 105 78 static std::string getDataPathString(); … … 110 83 //! Returns the path to the log files as std::string 111 84 static std::string getLogPathString(); 112 //! Returns the path to the modules as std::string113 static std::string getModulePathString();114 115 //! Return true for runs in the build directory (not installed)116 static bool buildDirectoryRun() { return getInstance().bBuildDirectoryRun_; }117 118 private:119 PathConfig(const PathConfig&); //!< Don't use (undefined symbol)120 85 121 86 /** … … 125 90 GeneralException 126 91 */ 127 void setConfigurablePaths(); 128 //! Returns a list with all modules declared by a *.module file in the module folder. 129 std::vector<std::string> getModulePaths(); 92 void setConfigurablePaths(const ApplicationPaths& applicationPaths); 130 93 131 //! Path to the parent directory of the ones above if program was installed with relative paths 132 boost::filesystem::path& rootPath_; 133 boost::filesystem::path& executablePath_; //!< Path to the executable 134 boost::filesystem::path& modulePath_; //!< Path to the modules 94 private: 95 ConfigurablePaths(const ConfigurablePaths&); //!< Don't use (undefined symbol) 96 135 97 boost::filesystem::path& dataPath_; //!< Path to the data files folder 136 98 boost::filesystem::path& externalDataPath_; //!< Path to the external data files folder … … 138 100 boost::filesystem::path& logPath_; //!< Path to the log files folder 139 101 140 bool bBuildDirectoryRun_; //!< True for runs in the build directory (not installed) 141 static PathConfig* singletonPtr_s; 102 static ConfigurablePaths* singletonPtr_s; 142 103 }; //tolua_export 143 104 } //tolua_export 144 105 145 #endif /* _ PathConfig_H__ */106 #endif /* _ConfigurablePaths_H__ */
Note: See TracChangeset
for help on using the changeset viewer.