22 std::string _executablePath;
23 StringCollection _arguments;
24 EnvironmentBlock _environment;
25 std::string _workingDirectory;
36 typedef std::function<void(
void *buf,
size_t size)> RedirectDelegate;
39 bool setExecutable(std::string
const &path);
40 bool setShellCommand(std::string
const &command);
41 bool setWorkingDirectory(std::string
const &path);
44 bool setArguments(StringCollection
const &args);
46 template <
typename... Args>
inline bool setArguments(Args
const &... args) {
47 std::string args_[] = {args...};
48 return setArguments(StringCollection(&args_[0], &args_[
sizeof...(Args)]));
52 bool setEnvironment(EnvironmentBlock
const &args);
53 bool addEnvironment(std::string
const &key, std::string
const &val);
56 bool redirectInputToConsole() {
return false; }
57 bool redirectOutputToConsole() {
return false; }
58 bool redirectErrorToConsole() {
return false; }
61 bool redirectInputToNull() {
return false; }
62 bool redirectOutputToNull() {
return false; }
63 bool redirectErrorToNull() {
return false; }
66 bool redirectInputToFile(std::string
const &path) {
return false; }
67 bool redirectOutputToFile(std::string
const &path) {
return false; }
68 bool redirectErrorToFile(std::string
const &path) {
return false; }
71 bool redirectOutputToBuffer() {
return false; }
72 bool redirectErrorToBuffer() {
return false; }
75 bool redirectInputToTerminal() {
return false; }
78 bool redirectOutputToDelegate(RedirectDelegate delegate) {
return false; }
79 bool redirectErrorToDelegate(RedirectDelegate delegate) {
return false; }
82 ErrorCode run(std::function<
bool()> preExecAction = []() {
return true; });
83 ErrorCode wait() {
return kErrorUnsupported; }
84 bool isRunning()
const {
return false; }
85 void flushAndExit() {}
88 inline ProcessId pid()
const {
return _pid; }
89 inline HANDLE handle()
const {
return _handle; }
90 inline ThreadId tid()
const {
return _tid; }
91 inline HANDLE threadHandle()
const {
return _threadHandle; }
92 inline int exitStatus()
const {
return 0; }
93 inline int signalCode()
const {
return 0; }
94 inline std::string
const &executable()
const {
return _executablePath; }
95 inline StringCollection
const &arguments()
const {
return _arguments; }
96 inline EnvironmentBlock
const &environment()
const {
return _environment; }
99 ErrorCode input(ByteVector
const &buf) {
return kErrorUnsupported; }
101 inline std::string
const &output()
const {
102 static std::string s;
107 void redirectionThread();