Orxonox  0.0.5 Codename: Arcturus
ConfigurablePaths.h
Go to the documentation of this file.
1 /*
2  * ORXONOX - the hottest 3D action shooter ever to exist
3  * > www.orxonox.net <
4  *
5  *
6  * License notice:
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  * Author:
23  * Reto Grieder
24  * Co-authors:
25  * ...
26  *
27  */
28 
34 #ifndef _ConfigurablePaths_H__
35 #define _ConfigurablePaths_H__
36 
37 #include "CorePrereqs.h"
38 
39 #include <string>
40 #include "util/Singleton.h"
41 
42 //tolua_begin
43 namespace orxonox
44 {
45 //tolua_end
55  class _CoreExport ConfigurablePaths //tolua_export
56  : public Singleton<ConfigurablePaths>
57  { //tolua_export
59 
60  public:
63 
66  { return getInstance().dataPath_; }
69  { return getInstance().externalDataPath_; }
72  { return getInstance().configPath_; }
75  { return getInstance().logPath_; }
76 
78  static std::string getDataPathString();
80  static std::string getExternalDataPathString();
82  static std::string getConfigPathString(); //tolua_export
84  static std::string getLogPathString();
85 
92  void setConfigurablePaths(const ApplicationPaths& applicationPaths);
93 
94  private:
95  // non-copyable:
96  ConfigurablePaths(const ConfigurablePaths&) = delete;
97  ConfigurablePaths& operator=(const ConfigurablePaths&) = delete;
98 
103 
105  }; //tolua_export
106 } //tolua_export
107 
108 #endif /* _ConfigurablePaths_H__ */
static const boost::filesystem::path & getConfigPath()
Returns the path to the config files as boost::filesystem::path.
Definition: ConfigurablePaths.h:71
The ApplicationPaths class is a singleton which provides static paths of the application.
Definition: ApplicationPaths.h:57
boost::filesystem::path & externalDataPath_
Path to the external data files folder.
Definition: ConfigurablePaths.h:100
Shared library macros, enums, constants and forward declarations for the core library ...
::std::string string
Definition: gtest-port.h:756
static const boost::filesystem::path & getExternalDataPath()
Returns the path to the external data files as boost::filesystem::path.
Definition: ConfigurablePaths.h:68
static const boost::filesystem::path & getDataPath()
Returns the path to the data files as boost::filesystem::path.
Definition: ConfigurablePaths.h:65
static ConfigurablePaths * singletonPtr_s
Static pointer to the singleton.
Definition: ConfigurablePaths.h:104
boost::filesystem::path & configPath_
Path to the config files folder.
Definition: ConfigurablePaths.h:101
Definition: CorePrereqs.h:316
static const boost::filesystem::path & getLogPath()
Returns the path to the log files as boost::filesystem::path.
Definition: ConfigurablePaths.h:74
Base for singleton classes.
Definition: Singleton.h:114
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
#define _CoreExport
Definition: CorePrereqs.h:61
The ConfigurablePaths class is a singleton used to configure different paths.
Definition: ConfigurablePaths.h:55
boost::filesystem::path & dataPath_
Path to the data files folder.
Definition: ConfigurablePaths.h:99
Definition of the Singleton template that is used as base class for classes that allow only one insta...
boost::filesystem::path & logPath_
Path to the log files folder.
Definition: ConfigurablePaths.h:102