/
ApplicationContextImpl.h
61 lines (47 loc) · 1.63 KB
/
ApplicationContextImpl.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
57
58
59
60
61
#pragma once
#include "imodule.h"
#include <vector>
namespace radiant
{
class ApplicationContextImpl :
public ApplicationContext
{
// 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().
*/
void initialise(int argc, char* argv[]);
// Initialises the function handling pointers for debug builds
void initErrorHandler();
/* ApplicationContext implementation */
std::string getApplicationPath() const override;
std::string getLibraryPath() const override;
std::string getRuntimeDataPath() const override;
std::string getHTMLPath() const override;
std::string getSettingsPath() const override;
std::string getBitmapsPath() const override;
const ArgumentList& getCmdLineArgs() const override;
// Return the global stream references
virtual std::ostream& getOutputStream() const override;
virtual std::ostream& getWarningStream() const override;
virtual std::ostream& getErrorStream() const override;
virtual std::mutex& getStreamLock() const override;
virtual const ErrorHandlingFunction& getErrorHandlingFunction() const override;
private:
// Sets up the bitmap path and settings path
void initPaths();
// Initialises the arguments
void initArgs(int argc, char* argv[]);
};
} // namespace radiant