/
ApplicationContextBase.h
56 lines (43 loc) · 1.42 KB
/
ApplicationContextBase.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#pragma once
#include "imodule.h"
#include <vector>
namespace radiant
{
class ApplicationContextBase :
public IApplicationContext
{
private:
// The app + home paths
std::string _appPath;
std::string _homePath;
std::string _settingsPath;
std::string _bitmapsPath;
// The path where the .map files are stored
std::string _mapsPath;
// Command line arguments
std::vector<std::string> _cmdLineArgs;
// A function pointer to a global error handler, used for ASSERT_MESSAGE
ErrorHandlingFunction _errorHandler;
public:
/**
* Initialises the context with the arguments given to main().
*/
virtual void initialise(int argc, char* argv[]);
/* ApplicationContext implementation */
virtual std::string getApplicationPath() const override;
virtual std::vector<std::string> getLibraryPaths() const override;
virtual std::string getRuntimeDataPath() const override;
virtual std::string getHTMLPath() const override;
virtual std::string getSettingsPath() const override;
virtual std::string getBitmapsPath() const override;
const ArgumentList& getCmdLineArgs() const override;
const ErrorHandlingFunction& getErrorHandlingFunction() const override;
protected:
void setErrorHandlingFunction(const ErrorHandlingFunction& function);
private:
// Sets up the bitmap path and settings path
void initPaths();
// Initialises the arguments
void initArgs(int argc, char* argv[]);
};
} // namespace radiant