Changeset 7908 for code/forks/sandbox_light/src/libraries/core
- Timestamp:
- Feb 17, 2011, 5:47:22 AM (14 years ago)
- Location:
- code/forks/sandbox_light/src/libraries/core
- Files:
-
- 74 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/forks/sandbox_light/src/libraries/core/CMakeLists.txt
r7284 r7908 20 20 SET_SOURCE_FILES(CORE_SRC_FILES 21 21 CommandLineParser.cc 22 ConfigValueContainer.cc23 22 Core.cc 24 DynLib.cc25 DynLibManager.cc26 Event.cc27 Game.cc28 GameMode.cc29 GameState.cc30 GraphicsManager.cc31 GUIManager.cc32 Language.cc33 LuaState.cc34 ObjectListBase.cc35 OrxonoxClass.cc36 Resource.cc37 WindowEventListener.cc38 39 # hierarchy40 Identifier.cc41 MetaObjectList.cc42 43 # level44 BaseObject.cc45 ClassTreeMask.cc46 Loader.cc47 Namespace.cc48 NamespaceNode.cc49 Template.cc50 XMLPort.cc51 XMLNameListener.cc52 53 COMPILATION_BEGIN FilesystemCompilation.cc54 command/ArgumentCompletionFunctions.cc55 ConfigFileManager.cc56 MemoryArchive.cc57 23 PathConfig.cc 58 COMPILATION_END59 60 # multithreading61 ThreadPool.cc62 COMPILATION_BEGIN ThreadCompilation.cc63 command/TclThreadManager.cc64 Thread.cc65 COMPILATION_END66 24 ) 67 68 ADD_SUBDIRECTORY(command)69 ADD_SUBDIRECTORY(input)70 25 71 26 ORXONOX_ADD_LIBRARY(core 72 27 FIND_HEADER_FILES 73 TOLUA_FILES74 command/CommandExecutor.h75 ConfigFileManager.h76 Game.h77 GameMode.h78 GUIManager.h79 Loader.h80 LuaState.h81 PathConfig.h82 input/InputManager.h83 input/KeyBinder.h84 input/KeyBinderManager.h85 PCH_FILE86 CorePrecompiledHeaders.h87 28 LINK_LIBRARIES 88 ${OGRE_LIBRARY}89 29 ${Boost_FILESYSTEM_LIBRARY} 90 30 ${Boost_SYSTEM_LIBRARY} # Filesystem dependency 91 ${Boost_THREAD_LIBRARY}92 ${Boost_DATE_TIME_LIBRARY} # Thread dependency93 ${CEGUI_LIBRARY}94 ${CEGUILUA_LIBRARY}95 ${LUA_LIBRARIES}96 cpptcl_orxonox97 ogreceguirenderer_orxonox98 ois_orxonox99 tinyxml_orxonox100 tolua_orxonox101 31 util 102 32 SOURCE_FILES -
code/forks/sandbox_light/src/libraries/core/Core.cc
r7872 r7908 51 51 #endif 52 52 53 #include "util/Clock.h"54 53 #include "util/Debug.h" 55 #include "util/Exception.h"56 #include "util/Scope.h"57 #include "util/ScopedSingletonManager.h"58 54 #include "util/SignalHandler.h" 59 55 #include "PathConfig.h" 60 56 #include "CommandLineParser.h" 61 #include "ConfigFileManager.h"62 #include "ConfigValueIncludes.h"63 #include "CoreIncludes.h"64 #include "DynLibManager.h"65 #include "GameMode.h"66 #include "GraphicsManager.h"67 #include "GUIManager.h"68 #include "Identifier.h"69 #include "Language.h"70 #include "LuaState.h"71 #include "command/ConsoleCommand.h"72 #include "command/IOConsole.h"73 #include "command/TclBind.h"74 #include "command/TclThreadManager.h"75 #include "input/InputManager.h"76 57 77 58 namespace orxonox … … 80 61 Core* Core::singletonPtr_s = 0; 81 62 82 SetCommandLineArgument(settingsFile, "orxonox.ini").information("THE configuration file");83 SetCommandLineSwitch(noIOConsole).information("Use this if you don't want to use the IOConsole (for instance for Lua debugging)");84 85 63 #ifdef ORXONOX_PLATFORM_WINDOWS 86 64 SetCommandLineArgument(limitToCPU, 1).information("Limits the program to one CPU/core (1, 2, 3, etc.). Default is the first core (faster than off)"); … … 88 66 89 67 Core::Core(const std::string& cmdLine) 90 // Cleanup guard for identifier destruction (incl. XMLPort, configValues, consoleCommands)91 : identifierDestroyer_(Identifier::destroyAllIdentifiers)92 // Cleanup guard for external console commands that don't belong to an Identifier93 , consoleCommandDestroyer_(ConsoleCommand::destroyAll)94 , bGraphicsLoaded_(false)95 , bStartIOConsole_(true)96 , lastLevelTimestamp_(0)97 , ogreConfigTimestamp_(0)98 68 { 99 69 // Set the hard coded fixed paths 100 70 this->pathConfig_.reset(new PathConfig()); 101 102 // Create a new dynamic library manager103 this->dynLibManager_.reset(new DynLibManager());104 105 // Load modules106 const std::vector<std::string>& modulePaths = this->pathConfig_->getModulePaths();107 for (std::vector<std::string>::const_iterator it = modulePaths.begin(); it != modulePaths.end(); ++it)108 {109 try110 {111 this->dynLibManager_->load(*it);112 }113 catch (...)114 {115 COUT(1) << "Couldn't load module \"" << *it << "\": " << Exception::handleMessage() << std::endl;116 }117 }118 71 119 72 // Parse command line arguments AFTER the modules have been loaded (static code!) … … 143 96 #endif 144 97 145 // Manage ini files and set the default settings file (usually orxonox.ini)146 this->configFileManager_.reset(new ConfigFileManager());147 this->configFileManager_->setFilename(ConfigFileType::Settings,148 CommandLineParser::getValue("settingsFile").getString());149 150 // Required as well for the config values151 this->languageInstance_.reset(new Language());152 153 // Do this soon after the ConfigFileManager has been created to open up the154 // possibility to configure everything below here155 ClassIdentifier<Core>::getIdentifier("Core")->initialiseObject(this, "Core", true);156 this->setConfigValues();157 158 // create persistent io console159 if (CommandLineParser::getValue("noIOConsole").getBool())160 {161 ModifyConfigValue(bStartIOConsole_, tset, false);162 }163 if (this->bStartIOConsole_)164 this->ioConsole_.reset(new IOConsole());165 166 // creates the class hierarchy for all classes with factories167 Identifier::createClassHierarchy();168 169 // Load OGRE excluding the renderer and the render window170 this->graphicsManager_.reset(new GraphicsManager(false));171 172 // initialise Tcl173 this->tclBind_.reset(new TclBind(PathConfig::getDataPathString()));174 this->tclThreadManager_.reset(new TclThreadManager(tclBind_->getTclInterpreter()));175 176 // Create singletons that always exist (in other libraries)177 this->rootScope_.reset(new Scope<ScopeID::Root>());178 179 98 // Generate documentation instead of normal run? 180 99 std::string docFilename; … … 199 118 Core::~Core() 200 119 { 201 // Remove us from the object lists again to avoid problems when destroying them202 this->unregisterObject();203 }204 205 //! Function to collect the SetConfigValue-macro calls.206 void Core::setConfigValues()207 {208 #ifdef ORXONOX_RELEASE209 const unsigned int defaultLevelLogFile = 3;210 #else211 const unsigned int defaultLevelLogFile = 4;212 #endif213 SetConfigValueExternal(softDebugLevelLogFile_, "OutputHandler", "softDebugLevelLogFile", defaultLevelLogFile)214 .description("The maximum level of debug output shown in the log file");215 OutputHandler::getInstance().setSoftDebugLevel(OutputHandler::logFileOutputListenerName_s, this->softDebugLevelLogFile_);216 217 SetConfigValue(language_, Language::getInstance().defaultLanguage_)218 .description("The language of the in game text")219 .callback(this, &Core::languageChanged);220 SetConfigValue(bInitRandomNumberGenerator_, true)221 .description("If true, all random actions are different each time you start the game")222 .callback(this, &Core::initRandomNumberGenerator);223 SetConfigValue(bStartIOConsole_, true)224 .description("Set to false if you don't want to use the IOConsole (for Lua debugging for instance)");225 SetConfigValue(lastLevelTimestamp_, 0)226 .description("Timestamp when the last level was started.");227 SetConfigValue(ogreConfigTimestamp_, 0)228 .description("Timestamp when the ogre config file was changed.");229 }230 231 //! Callback function if the language has changed.232 void Core::languageChanged()233 {234 // Read the translation file after the language was configured235 Language::getInstance().readTranslatedLanguageFile();236 120 } 237 121 … … 245 129 bInitialized = true; 246 130 } 247 }248 249 void Core::loadGraphics()250 {251 // Any exception should trigger this, even in upgradeToGraphics (see its remarks)252 Loki::ScopeGuard unloader = Loki::MakeObjGuard(*this, &Core::unloadGraphics);253 254 // Upgrade OGRE to receive a render window255 try256 {257 graphicsManager_->upgradeToGraphics();258 }259 catch (const InitialisationFailedException&)260 {261 // Exit the application if the Ogre config dialog was canceled262 COUT(1) << Exception::handleMessage() << std::endl;263 exit(EXIT_FAILURE);264 }265 catch (...)266 {267 // Recovery from this is very difficult. It requires to completely268 // destroy Ogre related objects and load again (without graphics).269 // However since Ogre 1.7 there seems to be a problem when Ogre270 // throws an exception and the graphics engine then gets destroyed271 // and reloaded between throw and catch (access violation in MSVC).272 // That's why we abort completely and only display the exception.273 COUT(1) << "An exception occurred during upgrade to graphics. "274 << "That is unrecoverable. The message was:" << endl275 << Exception::handleMessage() << endl;276 abort();277 }278 279 // Calls the InputManager which sets up the input devices.280 inputManager_.reset(new InputManager());281 282 // Load the CEGUI interface283 guiManager_.reset(new GUIManager(inputManager_->getMousePosition()));284 285 bGraphicsLoaded_ = true;286 GameMode::bShowsGraphics_s = true;287 288 // Load some sort of a debug overlay (only denoted by its name, "debug.oxo")289 graphicsManager_->loadDebugOverlay();290 291 // Create singletons associated with graphics (in other libraries)292 graphicsScope_.reset(new Scope<ScopeID::Graphics>());293 294 unloader.Dismiss();295 }296 297 void Core::unloadGraphics()298 {299 this->graphicsScope_.reset();300 this->guiManager_.reset();301 this->inputManager_.reset();302 this->graphicsManager_.reset();303 304 // Load Ogre::Root again, but without the render system305 try306 { this->graphicsManager_.reset(new GraphicsManager(false)); }307 catch (...)308 {309 COUT(0) << "An exception occurred during 'unloadGraphics':" << Exception::handleMessage() << std::endl310 << "Another exception might be being handled which may lead to undefined behaviour!" << std::endl311 << "Terminating the program." << std::endl;312 abort();313 }314 315 bGraphicsLoaded_ = false;316 GameMode::bShowsGraphics_s = false;317 }318 319 //! Sets the language in the config-file back to the default.320 void Core::resetLanguage()321 {322 ResetConfigValue(language_);323 131 } 324 132 … … 368 176 #endif 369 177 } 370 371 void Core::preUpdate(const Clock& time)372 {373 // Update singletons before general ticking374 ScopedSingletonManager::preUpdate<ScopeID::Root>(time);375 if (this->bGraphicsLoaded_)376 {377 // Process input events378 this->inputManager_->preUpdate(time);379 // Update GUI380 this->guiManager_->preUpdate(time);381 // Update singletons before general ticking382 ScopedSingletonManager::preUpdate<ScopeID::Graphics>(time);383 }384 // Process console events and status line385 if (this->ioConsole_ != NULL)386 this->ioConsole_->preUpdate(time);387 // Process thread commands388 this->tclThreadManager_->preUpdate(time);389 }390 391 void Core::postUpdate(const Clock& time)392 {393 // Update singletons just before rendering394 ScopedSingletonManager::postUpdate<ScopeID::Root>(time);395 if (this->bGraphicsLoaded_)396 {397 // Update singletons just before rendering398 ScopedSingletonManager::postUpdate<ScopeID::Graphics>(time);399 // Render (doesn't throw)400 this->graphicsManager_->postUpdate(time);401 }402 }403 404 void Core::updateLastLevelTimestamp()405 {406 ModifyConfigValue(lastLevelTimestamp_, set, static_cast<long long>(time(NULL)));407 }408 409 void Core::updateOgreConfigTimestamp()410 {411 ModifyConfigValue(ogreConfigTimestamp_, set, static_cast<long long>(time(NULL)));412 }413 178 } -
code/forks/sandbox_light/src/libraries/core/Core.h
r7870 r7908 46 46 #include <string> 47 47 #include <boost/scoped_ptr.hpp> 48 #include <loki/ScopeGuard.h>49 48 50 49 #include "util/Singleton.h" 51 #include "OrxonoxClass.h"52 50 53 51 namespace orxonox … … 59 57 You should only create this singleton once because it destroys the identifiers! 60 58 */ 61 class _CoreExport Core : public Singleton<Core> , public OrxonoxClass59 class _CoreExport Core : public Singleton<Core> 62 60 { 63 typedef Loki::ScopeGuardImpl0<void (*)()> SimpleScopeGuard;64 61 friend class Singleton<Core>; 65 friend class Game;66 62 67 63 public: … … 76 72 ~Core(); 77 73 78 void setConfigValues();79 80 //! Returns the configured language.81 const std::string& getLanguage()82 { return this->language_; }83 void resetLanguage();84 85 void updateLastLevelTimestamp();86 inline long long getLastLevelTimestamp() const87 { return this->lastLevelTimestamp_; }88 89 void updateOgreConfigTimestamp();90 inline long long getOgreConfigTimestamp() const91 { return this->ogreConfigTimestamp_; }92 93 74 private: 94 75 Core(const Core&); //!< Don't use (undefined symbol) 95 76 96 void languageChanged();97 77 void initRandomNumberGenerator(); 98 78 99 void preUpdate(const Clock& time); 100 void postUpdate(const Clock& time); 79 void setThreadAffinity(int limitToCPU); 101 80 102 void loadGraphics();103 void unloadGraphics();104 105 void setThreadAffinity(int limitToCPU);106 81 // MANAGED SINGLETONS/OBJECTS 107 82 // Mind the order for the destruction! 108 83 scoped_ptr<PathConfig> pathConfig_; 109 scoped_ptr<DynLibManager> dynLibManager_;110 84 scoped_ptr<SignalHandler> signalHandler_; 111 SimpleScopeGuard identifierDestroyer_;112 SimpleScopeGuard consoleCommandDestroyer_;113 scoped_ptr<ConfigFileManager> configFileManager_;114 scoped_ptr<Language> languageInstance_;115 scoped_ptr<IOConsole> ioConsole_;116 scoped_ptr<TclBind> tclBind_;117 scoped_ptr<TclThreadManager> tclThreadManager_;118 scoped_ptr<Scope<ScopeID::Root> > rootScope_;119 // graphical120 scoped_ptr<GraphicsManager> graphicsManager_; //!< Interface to OGRE121 scoped_ptr<InputManager> inputManager_; //!< Interface to OIS122 scoped_ptr<GUIManager> guiManager_; //!< Interface to GUI123 scoped_ptr<Scope<ScopeID::Graphics> > graphicsScope_;124 85 125 bool bGraphicsLoaded_;126 86 int softDebugLevelLogFile_; //!< The debug level for the log file (belongs to OutputHandler) 127 std::string language_; //!< The language128 87 bool bInitRandomNumberGenerator_; //!< If true, srand(time(0)) is called 129 bool bStartIOConsole_; //!< Set to false if you don't want to use the IOConsole130 long long lastLevelTimestamp_; ///< Timestamp when the last level was started131 long long ogreConfigTimestamp_; ///< Timestamp wehen the ogre config level was modified132 88 133 89 static Core* singletonPtr_s; -
code/forks/sandbox_light/src/libraries/core/CorePrereqs.h
r7849 r7908 65 65 namespace orxonox 66 66 { 67 static const uint32_t OBJECTID_UNKNOWN = static_cast<uint32_t>(-1);68 67 } 69 68 … … 74 73 namespace orxonox 75 74 { 76 namespace XMLPort77 {78 enum Mode79 {80 NOP,81 LoadObject,82 SaveObject,83 ExpandObject84 };85 }86 87 namespace ConfigFileType88 {89 enum Value90 {91 Settings,92 JoyStickCalibration,93 CommandHistory94 // Don't forget to adjust the array size in the ConfigFileManager when adding a new entry here!95 };96 }97 98 namespace KeybindMode99 {100 enum Value101 {102 OnPress,103 OnHold,104 OnRelease,105 None106 };107 };108 75 } 109 76 … … 114 81 namespace orxonox 115 82 { 116 typedef std::string LanguageEntryLabel;117 118 template <class T, class U>119 T orxonox_cast(U*);120 121 class BaseObject;122 template <class T>123 class ClassFactory;124 template <class T>125 class ClassIdentifier;126 class ClassTreeMask;127 class ClassTreeMaskIterator;128 class ClassTreeMaskNode;129 class ClassTreeMaskObjectIterator;130 83 class CommandLineParser; 131 84 class CommandLineArgument; 132 class ConfigFile;133 class ConfigFileEntry;134 class ConfigFileEntryComment;135 class ConfigFileEntryValue;136 class ConfigFileManager;137 class ConfigFileSection;138 class ConfigValueContainer;139 85 class Core; 140 class DestructionListener;141 class DynLib;142 class DynLibManager;143 struct Event;144 class EventState;145 class Factory;146 class Game;147 class GameState;148 struct GameStateInfo;149 struct GameStateTreeNode;150 class GraphicsManager;151 class GUIManager;152 class Identifier;153 template <class T>154 class Iterator;155 class Language;156 class LuaFunctor;157 class LuaState;158 class MemoryArchive;159 class MemoryArchiveFactory;160 class MetaObjectList;161 class MetaObjectListElement;162 class Namespace;163 class NamespaceNode;164 template <class T>165 class ObjectList;166 class ObjectListBase;167 class ObjectListBaseElement;168 template <class T>169 class ObjectListElement;170 template <class T>171 class ObjectListIterator;172 class OgreWindowEventListener;173 class OrxonoxClass;174 86 class PathConfig; 175 struct ResourceInfo;176 class SettingsConfigFile;177 template <class T>178 class SmartPtr;179 template <class T>180 class SubclassIdentifier;181 class Template;182 class Thread;183 class ThreadPool;184 template <class T>185 class WeakPtr;186 class WindowEventListener;187 class XMLFile;188 class XMLNameListener;189 template <class T, class O>190 class XMLPortClassObjectContainer;191 template <class T>192 class XMLPortClassParamContainer;193 class XMLPortObjectContainer;194 class XMLPortParamContainer;195 196 // Command197 class ArgumentCompleter;198 class ArgumentCompletionListElement;199 class CommandEvaluation;200 class ConsoleCommand;201 class Executor;202 template <class T>203 class ExecutorMember;204 class ExecutorStatic;205 class Functor;206 template <class O>207 class FunctorMember;208 typedef FunctorMember<void> FunctorStatic;209 template <class F, class O>210 class FunctorPointer;211 class IOConsole;212 class IRC;213 class Shell;214 class ShellListener;215 class TclBind;216 struct TclInterpreterBundle;217 template <class T>218 class TclThreadList;219 class TclThreadManager;220 221 // Input222 class BaseCommand;223 class BufferedParamCommand;224 class Button;225 class HalfAxis;226 class InputBuffer;227 class InputDevice;228 template <class Traits>229 class InputDeviceTemplated;230 class InputHandler;231 class InputManager;232 class InputState;233 struct InputStatePriority;234 class JoyStickQuantityListener;235 class JoyStick;236 class KeyBinder;237 class KeyBinderManager;238 class Keyboard;239 class KeyDetector;240 class KeyEvent;241 class Mouse;242 class ParamCommand;243 class SimpleCommand;244 }245 246 #include "command/FunctorPtr.h"247 #include "command/ExecutorPtr.h"248 249 // CppTcl250 namespace Tcl251 {252 class interpreter;253 class object;254 87 } 255 88 … … 278 111 } 279 112 #endif 280 class thread;281 class mutex;282 class shared_mutex;283 class condition_variable;284 }285 286 // Ogre287 namespace Ogre288 {289 class DataStream;290 template <class T> class SharedPtr;291 typedef SharedPtr<DataStream> DataStreamPtr;292 }293 namespace orxonox294 {295 // Import the Ogre::DataStream296 using Ogre::DataStream;297 using Ogre::DataStreamPtr;298 }299 300 // CEGUI301 namespace CEGUI302 {303 class DefaultLogger;304 class Logger;305 class LuaScriptModule;306 307 class OgreCEGUIRenderer;308 class OgreCEGUIResourceProvider;309 class OgreCEGUITexture;310 }311 312 // Lua313 struct lua_State;314 315 // TinyXML and TinyXML++316 class TiXmlString;317 class TiXmlOutStream;318 class TiXmlNode;319 class TiXmlHandle;320 class TiXmlDocument;321 class TiXmlElement;322 class TiXmlComment;323 class TiXmlUnknown;324 class TiXmlAttribute;325 class TiXmlText;326 class TiXmlDeclaration;327 class TiXmlParsingData;328 namespace ticpp329 {330 class Document;331 class Element;332 class Declaration;333 class StylesheetReference;334 class Text;335 class Comment;336 class Attribute;337 }338 namespace orxonox339 {340 using ticpp::Element;341 113 } 342 114 -
code/forks/sandbox_light/src/libraries/core/PathConfig.cc
r6417 r7908 76 76 : rootPath_(*(new bf::path())) 77 77 , executablePath_(*(new bf::path())) 78 , modulePath_(*(new bf::path()))79 78 , dataPath_(*(new bf::path())) 80 , externalDataPath_(*(new bf::path()))81 79 , configPath_(*(new bf::path())) 82 80 , logPath_(*(new bf::path())) … … 138 136 COUT(1) << "Running from the build tree." << std::endl; 139 137 PathConfig::bDevRun_ = true; 140 modulePath_ = specialConfig::moduleDevDirectory;141 138 } 142 139 else … … 153 150 ThrowException(General, "Could not derive a root directory. Might the binary installation directory contain '..' when taken relative to the installation prefix path?"); 154 151 155 // Module path is fixed as well156 modulePath_ = rootPath_ / specialConfig::defaultModulePath;157 158 152 #else 159 153 160 154 // There is no root path, so don't set it at all 161 // Module path is fixed as well162 modulePath_ = specialConfig::moduleInstallDirectory;163 155 164 156 #endif … … 170 162 delete &rootPath_; 171 163 delete &executablePath_; 172 delete &modulePath_;173 164 delete &dataPath_; 174 delete &externalDataPath_;175 165 delete &configPath_; 176 166 delete &logPath_; … … 184 174 configPath_ = specialConfig::configDevDirectory; 185 175 logPath_ = specialConfig::logDevDirectory; 186 187 // Check for data path override by the command line188 if (!CommandLineParser::getArgument("externalDataPath")->hasDefaultValue())189 externalDataPath_ = CommandLineParser::getValue("externalDataPath").getString();190 else191 externalDataPath_ = specialConfig::externalDataDevDirectory;192 176 } 193 177 else … … 251 235 } 252 236 253 std::vector<std::string> PathConfig::getModulePaths()254 {255 std::vector<std::string> modulePaths;256 257 // We search for helper files with the following extension258 const std::string& moduleextension = specialConfig::moduleExtension;259 size_t moduleextensionlength = moduleextension.size();260 261 // Add that path to the PATH variable in case a module depends on another one262 std::string pathVariable(getenv("PATH"));263 putenv(const_cast<char*>(("PATH=" + pathVariable + ';' + modulePath_.string()).c_str()));264 265 // Make sure the path exists, otherwise don't load modules266 if (!boost::filesystem::exists(modulePath_))267 return modulePaths;268 269 boost::filesystem::directory_iterator file(modulePath_);270 boost::filesystem::directory_iterator end;271 272 // Iterate through all files273 while (file != end)274 {275 const std::string& filename = file->BOOST_LEAF_FUNCTION();276 277 // Check if the file ends with the exension in question278 if (filename.size() > moduleextensionlength)279 {280 if (filename.substr(filename.size() - moduleextensionlength) == moduleextension)281 {282 // We've found a helper file283 const std::string& library = filename.substr(0, filename.size() - moduleextensionlength);284 modulePaths.push_back((modulePath_ / library).file_string());285 }286 }287 ++file;288 }289 290 return modulePaths;291 }292 293 237 /*static*/ std::string PathConfig::getRootPathString() 294 238 { … … 306 250 } 307 251 308 /*static*/ std::string PathConfig::getExternalDataPathString()309 {310 return getInstance().externalDataPath_.string() + '/';311 }312 313 252 /*static*/ std::string PathConfig::getConfigPathString() 314 253 { … … 320 259 return getInstance().logPath_.string() + '/'; 321 260 } 322 323 /*static*/ std::string PathConfig::getModulePathString()324 {325 return getInstance().modulePath_.string() + '/';326 }327 261 } -
code/forks/sandbox_light/src/libraries/core/PathConfig.h
r7427 r7908 85 85 static const boost::filesystem::path& getDataPath() 86 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 87 //! Returns the path to the config files as boost::filesystem::path 91 88 static const boost::filesystem::path& getConfigPath() … … 94 91 static const boost::filesystem::path& getLogPath() 95 92 { 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 93 100 94 //! Returns the path to the root folder as std::string … … 104 98 //! Returns the path to the data files as std::string 105 99 static std::string getDataPathString(); 106 //! Returns the path to the external data files as std::string107 static std::string getExternalDataPathString();108 100 //! Returns the path to the config files as std::string 109 101 static std::string getConfigPathString(); //tolua_export 110 102 //! Returns the path to the log files as std::string 111 103 static std::string getLogPathString(); 112 //! Returns the path to the modules as std::string113 static std::string getModulePathString();114 104 115 105 //! Return trrue for runs in the build directory (not installed) … … 126 116 */ 127 117 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 118 131 119 //! Path to the parent directory of the ones above if program was installed with relativ paths 132 120 boost::filesystem::path& rootPath_; 133 121 boost::filesystem::path& executablePath_; //!< Path to the executable 134 boost::filesystem::path& modulePath_; //!< Path to the modules135 122 boost::filesystem::path& dataPath_; //!< Path to the data files folder 136 boost::filesystem::path& externalDataPath_; //!< Path to the external data files folder137 123 boost::filesystem::path& configPath_; //!< Path to the config files folder 138 124 boost::filesystem::path& logPath_; //!< Path to the log files folder
Note: See TracChangeset
for help on using the changeset viewer.