-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathpaths.cpp
65 lines (59 loc) · 1.87 KB
/
paths.cpp
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
62
63
64
65
#include "paths.h"
Paths::Paths(QString exeDir) {
m_exeDir = exeDir;
}
QString Paths::getAttachmentPath() {
#if defined(Q_OS_MACOS) || defined(Q_OS_MAC64)
return m_exeDir + "/../../../attachment.txt";
#elif defined(Q_OS_WINDOWS)
return m_exeDir + "\\..\\attachment.txt";
#elif defined(Q_OS_LINUX)
return m_exeDir + "/attachment.txt";
#else
#error getAttachmentPath() not implemented on this platform
#endif
}
QString Paths::getHandlerPath() {
#if defined(Q_OS_MAC)
return m_exeDir + "/../../../crashpad/crashpad_handler";
#elif defined(Q_OS_WINDOWS)
return m_exeDir + "\\..\\crashpad\\crashpad_handler.exe";
#elif defined(Q_OS_LINUX)
return m_exeDir + "/crashpad/crashpad_handler";
#else
#error getHandlerPath not implemented on this platform
#endif
}
QString Paths::getReportsPath() {
#if defined(Q_OS_MAC)
return m_exeDir + "/../../../crashpad";
#elif defined(Q_OS_WINDOWS)
return m_exeDir + "\\..\\crashpad";
#elif defined(Q_OS_LINUX)
return m_exeDir + "/crashpad";
#else
#error getReportsPath not implemented on this platform
#endif
}
QString Paths::getMetricsPath() {
#if defined(Q_OS_MAC)
return m_exeDir + "/../../../crashpad";
#elif defined(Q_OS_WINDOWS)
return m_exeDir + "\\..\\crashpad";
#elif defined(Q_OS_LINUX)
return m_exeDir + "/crashpad";
#else
#error getMetricsPath not implemented on this platform
#endif
}
#if defined(Q_OS_UNIX)
std::string Paths::getPlatformString(QString string){
return string.toStdString();
}
#elif defined(Q_OS_WINDOWS)
std::wstring Paths::getPlatformString(QString string) {
return string.toStdWString();
}
#else
#error getPlatformString not implemented on this platform
#endif