-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstatic.h
60 lines (46 loc) · 1.53 KB
/
static.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
/**
@file
@author Stefan Frings
*/
#ifndef STATIC_H
#define STATIC_H
#include <QString>
#include "httpsessionstore.h"
#include "staticfilecontroller.h"
/**
This class contains some static resources that are used by the application.
*/
class Static
{
public:
/**
Search the main config file and return its full path.
On the first call, the INI file gets searched. If not found,
the application aborts with an error message.
<p>
The filename is the applications name plus the ending ".ini". It is searched
in the following directories:
- Same directory as the applications executable file
- In ../etc relative to the applications executable file
- In ../../etc relative to the applications executable file
- In /etc/xdg/{organisation name} on the root drive
- In /etc/opt on the root drive
- In /etc on the root drive
*/
static QString getConfigFileName();
/**
Gets the directory where the main config file is located.
On the first call, the INI file gets searched. If not found,
the application aborts with an error message.
@see getConfigFileName()
*/
static QString getConfigDir();
/** Storage for session cookies */
static HttpSessionStore* sessionStore;
/** Controller for static files */
static StaticFileController* staticFileController;
private:
/** Directory of the main config file */
static QString configDir;
};
#endif // STATIC_H