57 Process(
const std::filesystem::path& path,
const std::vector<std::string>& args = {},
const std::filesystem::path& workingDir = {});
72 const std::filesystem::path&
getPath()
const;
131 bool send(
const std::string& s);
144 mutable std::mutex m_mutex;
145 std::filesystem::path m_path;
146 std::vector<std::string> m_args;
147 std::filesystem::path m_workingDirectory;
151 std::string m_output;
152 std::thread m_watchThread;
154 HANDLE m_childOutRead;
155 HANDLE m_childOutWrite;
156 HANDLE m_childInRead;
157 HANDLE m_childInWrite;
158 PROCESS_INFORMATION m_pi;
160 mutable unsigned long long m_lastProcKernelTime;
161 mutable unsigned long long m_lastProcUserTime;
162 mutable unsigned long long m_lastSysKernelTime;
163 mutable unsigned long long m_lastSysUserTime;
165 int m_childOutPipes[2];
166 int m_childInPipes[2];
168 mutable unsigned long long m_lastUserTime;
169 mutable unsigned long long m_lastSystemTime;
An event that can have handlers subscribe to it, which in turn will be called when the event is invok...
Definition event.h:49
double getCPUUsage() const
Gets the percent of the CPU being used by the process.
~Process()
Destructs a Process.
bool sendCommand(std::string s)
Sends text to the process' console and adds the return characters.
bool start()
Starts the process.
unsigned long long getRAMUsage() const
Gets the amount of RAM being used by the process in bytes.
int getExitCode() const
Gets the exit code of the process.
Process(const std::filesystem::path &path, const std::vector< std::string > &args={}, const std::filesystem::path &workingDir={})
Constructs a Process.
bool kill()
Kills the process.
ProcessState getState() const
Gets the state of the proicess.
const std::string & getOutput() const
Gets the console output of the process.
bool send(const std::string &s)
Sends text to the process' console.
bool pause()
Pauses the process.
Events::Event< ProcessExitedEventArgs > & exited()
Gets the event for when the process has exited.
int waitForExit()
Waits for the process to exit.
const std::filesystem::path & getPath() const
Gets the path of the process.
bool resume()
Resumes the process.
Definition dependencysearchoption.h:5
ProcessState
States of a process.
Definition processstate.h:10