#pragma once #include #include #include #include using namespace std; class Process { string execname; optional stderrRedirect; pid_t pid = -1; int infd = -1, outfd = -1; string readBuf; public: Process(const string_view execname); void redirectStderr(const string_view fname); void run(); void wait(); void stop(); void unStop(); void terminate(); bool writeLine(const string_view line); optional readLine(); };