-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCommandLine.h
116 lines (90 loc) · 3.76 KB
/
CommandLine.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#pragma once
#include <QString>
#include <QVector>
#include "utils.h"
#include "Minecraft.h"
namespace Sparrow::launch {
class processArgument {
private:
QString key;
QString value;
public:
QString toString();
processArgument(void) {}
processArgument(QString key, QString value);
};
class jvmArgument {
QString key;
QString value;
public:
jvmArgument(void) {}
QString toString();
jvmArgument(QString key, QString value);
};
class CommandLine {
CommandLine(void) {}
CommandLine(const QString &javaPath,
const QVector<jvmArgument> &jvmArguments); //ֻ���ɰ��������ĺ��Զ����JVM������CommandLine��ProcessArguments��LaunchArgument������
private:
QString javaPath;
QVector<processArgument> processArguments;
QVector<jvmArgument> jvmArguments;
};
class CommandLineCreator {
public:
CommandLineCreator(void) {}
static jvmArgument maxHeapSize(const qint8 &size);
static jvmArgument newHeapSize(const qint8 &size);
static jvmArgument useG1();
static jvmArgument useAdaptiveSizePolicy();
static jvmArgument useOmitStackTraceInFastThrow();
static const jvmArgument constJvmArgs[];
static processArgument username(const QString &username);
static processArgument version(const QString &version);
static processArgument gameDir(const QString &gameDir);
static processArgument assetsDir(const QString &assetsDir);
static processArgument assetIndex(const QString &assetIndex);
static processArgument uuid(const QString &uuid);
static processArgument userType(const QString &userType);
static processArgument versionType(const QString &versionType);
static processArgument *getProcessArguments(
const QString &username,
const QString &version,
const QString &gameDir,
const QString &assetsDir,
const QString &assetIndex,
const QString &uuid,
const QString &userType,
const QString &versionType
);
};
class __declspec(dllexport) LaunchCommand {
/*jvmArgument osName;
jvmArgument osVersion;
jvmArgument javaLibraryPath;
jvmArgument cp;
jvmArgument log4jConfigurationFile;
processArgument username;
processArgument version;
processArgument gameDir;
processArgument assetsDir;
processArgument assetIndex;
processArgument uuid;
processArgument accessToken;
processArgument userType;
processArgument versionType;*/
QString javaPath;
QString mainClass;
QVector<jvmArgument> jvmArguments;
QVector<processArgument> processArguments;
public:
LaunchCommand(const QString &javaPath, const jvmArgument &osName, const jvmArgument &osVersion, const jvmArgument &javaLibraryPath,
const jvmArgument &cp, const jvmArgument &log4JConfigurationFile, const QString &mainClass,
const processArgument &username, const processArgument &version, const processArgument &gameDir,
const processArgument &assetsDir, const processArgument &assetIndex, const processArgument &uuid,
const processArgument &accessToken, const processArgument &userType,
const processArgument &versionType, const QVector<jvmArgument> &additionalJvmArgument,
const QVector<processArgument> &additionalProcessArgument);
QString getArgumentString();
};
}