- Timestamp:
- May 30, 2015, 12:22:27 PM (9 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core7/src/libraries/core/ApplicationPaths.h
r10457 r10509 32 32 */ 33 33 34 #ifndef _ PathConfig_H__35 #define _ PathConfig_H__34 #ifndef _ApplicationPaths_H__ 35 #define _ApplicationPaths_H__ 36 36 37 37 #include "CorePrereqs.h" … … 47 47 /** 48 48 @brief 49 The PathConfig class is a singleton used to configure different paths.49 The ApplicationPaths class is a singleton which provides static paths of the application. 50 50 @details 51 The class provides information about the data, config, log, executable, 52 root and module path. 51 The class provides information about the executable, root and module 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_export60 : public Singleton< PathConfig>57 class _CoreExport ApplicationPaths //tolua_export 58 : public Singleton<ApplicationPaths> 61 59 { //tolua_export 62 friend class Singleton<PathConfig>; 63 friend class Core; 60 friend class Singleton<ApplicationPaths>; 64 61 65 62 public: … … 67 64 @brief 68 65 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 dire tory.66 Also checks for "orxonox_dev_build.keep_me" in the executable directory. 70 67 If found it means that this is not an installed run, hence we 71 68 don't write the logs and config files to ~/.orxonox … … 73 70 GeneralException 74 71 */ 75 PathConfig();76 ~ PathConfig();72 ApplicationPaths(); 73 ~ApplicationPaths(); 77 74 78 75 //! Returns the path to the root folder as boost::filesystem::path … … 82 79 static const boost::filesystem::path& getExecutablePath() 83 80 { return getInstance().executablePath_; } 84 //! Returns the path to the data files as boost::filesystem::path85 static const boost::filesystem::path& getDataPath()86 { return getInstance().dataPath_; }87 //! Returns the path to the external data files as boost::filesystem::path88 static const boost::filesystem::path& getExternalDataPath()89 { return getInstance().externalDataPath_; }90 //! Returns the path to the config files as boost::filesystem::path91 static const boost::filesystem::path& getConfigPath()92 { return getInstance().configPath_; }93 //! Returns the path to the log files as boost::filesystem::path94 static const boost::filesystem::path& getLogPath()95 { return getInstance().logPath_; }96 81 //! Returns the path to the modules as boost::filesystem::path 97 82 static const boost::filesystem::path& getModulePath() … … 102 87 //! Returns the path to the executable folder as std::string 103 88 static std::string getExecutablePathString(); 104 //! Returns the path to the data files as std::string105 static std::string getDataPathString();106 //! Returns the path to the external data files as std::string107 static std::string getExternalDataPathString();108 //! Returns the path to the config files as std::string109 static std::string getConfigPathString(); //tolua_export110 //! Returns the path to the log files as std::string111 static std::string getLogPathString();112 89 //! Returns the path to the modules as std::string 113 90 static std::string getModulePathString(); … … 116 93 static bool buildDirectoryRun() { return getInstance().bBuildDirectoryRun_; } 117 94 118 private:119 PathConfig(const PathConfig&); //!< Don't use (undefined symbol)120 121 /**122 @brief123 Sets config, log and media path and creates the folders if necessary.124 @throws125 GeneralException126 */127 void setConfigurablePaths();128 95 //! Returns a list with all modules declared by a *.module file in the module folder. 129 96 std::vector<std::string> getModulePaths(); 97 98 private: 99 ApplicationPaths(const ApplicationPaths&); //!< Don't use (undefined symbol) 130 100 131 101 //! Path to the parent directory of the ones above if program was installed with relative paths … … 133 103 boost::filesystem::path& executablePath_; //!< Path to the executable 134 104 boost::filesystem::path& modulePath_; //!< Path to the modules 135 boost::filesystem::path& dataPath_; //!< Path to the data files folder136 boost::filesystem::path& externalDataPath_; //!< Path to the external data files folder137 boost::filesystem::path& configPath_; //!< Path to the config files folder138 boost::filesystem::path& logPath_; //!< Path to the log files folder139 105 140 106 bool bBuildDirectoryRun_; //!< True for runs in the build directory (not installed) 141 static PathConfig* singletonPtr_s;107 static ApplicationPaths* singletonPtr_s; 142 108 }; //tolua_export 143 109 } //tolua_export 144 110 145 #endif /* _ PathConfig_H__ */111 #endif /* _ApplicationPaths_H__ */
Note: See TracChangeset
for help on using the changeset viewer.