Launches external commands and redirects their output to a file; kills the external process when going out of scope. More...
#include <ServerLauncher.h>
Public Member Functions | |
| ServerLauncher (const char *path, char *const argv[], const char *outfile=0, bool append_output=false) | |
| Constructor; launches the external command, optionally redirects the output. More... | |
| ~ServerLauncher () | |
| Destructor; kills the external program. More... | |
| int | get_write_descriptor () const |
| Returns stdin of the external program. More... | |
| pid_t | get_pid () const |
| Returns the pid of the external program. More... | |
Private Attributes | |
| const char * | m_path |
| The path of the external program. More... | |
| pid_t | m_child_pid |
| The pid of the external program. More... | |
| int | m_write_fd |
| The file descriptor writing to stdin of the external program. More... | |
Launches external commands and redirects their output to a file; kills the external process when going out of scope.
This class is used for testing purposes.
Definition at line 54 of file ServerLauncher.h.
|
inline |
Constructor; launches the external command, optionally redirects the output.
| path | The path of the external program |
| argv | The argument list of the program |
| outfile | Path of the redirected output file (for stdout AND stderr); optional. If NULL then will use stdout/stderr of the host program |
| append_output | If true, output will be appended. Otherwise output file will be overwritten |
Definition at line 67 of file ServerLauncher.h.
|
inline |
Destructor; kills the external program.
Definition at line 104 of file ServerLauncher.h.
|
inline |
Returns the pid of the external program.
Definition at line 118 of file ServerLauncher.h.
|
inline |
Returns stdin of the external program.
Definition at line 113 of file ServerLauncher.h.
|
private |
The pid of the external program.
Definition at line 127 of file ServerLauncher.h.
|
private |
The path of the external program.
Definition at line 124 of file ServerLauncher.h.
|
private |
The file descriptor writing to stdin of the external program.
Definition at line 130 of file ServerLauncher.h.
1.8.8