-
Notifications
You must be signed in to change notification settings - Fork 2
/
InvocationParams.h
76 lines (51 loc) · 1.83 KB
/
InvocationParams.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
#ifndef _INVOCATION_PARAMS_H_
#define _INVOCATION_PARAMS_H_
#include <string>
#include <vector>
#include "Process.h"
namespace runexe {
class InvocationParams {
public:
static const int INFINITE_LIMIT = 2000000000;
static const long long INFINITE_LIMIT_INT64 = 1000000000000000000LL;
InvocationParams(const std::vector<std::string> &cmdLineParams);
long long getTimeLimit() const;
long long getMemoryLimit() const;
std::string getRedirectInput() const;
std::string getRedirectOutput() const;
std::string getRedirectError() const;
std::string getHomeDirectory() const;
std::string getCommandLine() const;
std::string getUserName() const;
std::string getDomain() const;
std::string getPassword() const;
std::string getInjectDll() const;
std::string getProgramName() const;
bool isTrustedProcess() const;
bool isIdlenessChecking() const;
ProcessParams asProcessParams() const;
void setProgramName(const std::string &programName);
private:
long long timeLimit;
long long memoryLimit;
std::string redirectInput;
std::string redirectOutput;
std::string redirectError;
std::string homeDirectory;
std::string commandLine;
std::string userName;
std::string domain;
std::string password;
std::string injectDll;
std::string programName;
bool trustedProcess;
bool idlenessChecking;
private:
std::string buildCommandLine(const std::vector<std::string> ¶ms,
size_t fromIndex);
long long parseTimeLimit(const std::string &s);
long long parseMemoryLimit(const std::string &s);
void setDefaults();
};
}
#endif