119 static std::vector<std::string>
executeWithLines(
const std::string& command,
120 size_t maxLines = 0);
150 static bool killProcess(
int pid,
bool force =
false);
166 ProcessExecutor() =
delete;
168 static std::string trimWhitespace(
const std::string& str);
169 static bool commandLogging_;
static ProcessResult executeWithOutput(const std::string &command, bool silent=false)
Execute command and capture stdout.
static bool killProcess(int pid, bool force=false)
Kill process by PID.
static void setCommandLogging(bool enabled)
Enable or disable command logging.
static ProcessResult executeBackground(const std::string &command)
Execute command in background (non-blocking).
static ProcessResult execute(const std::string &command, bool silent=false)
Execute command and check exit code.
static bool isProcessRunning(const std::string &processName)
Check if process is running by name.
static int getProcessPid(const std::string &processName)
Get PID of running process by name.
static std::vector< std::string > executeWithLines(const std::string &command, size_t maxLines=0)
Execute command and capture stdout as lines.
Result of process execution including exit code and output.
int exitCode
Process exit code (0 = success).
bool success
true if command executed successfully (exit code 0)
std::string output
Captured stdout (if requested).
std::string command
The command that was executed.