#pragma once #include #include #include "TessesFramework/Streams/Stream.hpp" #include "TessesFramework/HiddenField.hpp" #include #if defined(_WIN32) #define SIGKILL 9 #endif namespace Tesses::Framework::Platform { class Process { private: HiddenField hidden; bool exited = false; int exitCode=0; public: std::string name; std::vector args; std::string workingDirectory; std::vector> env; bool includeThisEnv; bool redirectStdIn=false; bool redirectStdOut=false; bool redirectStdErr=false; bool HasExited(); void CloseStdInNow(); std::shared_ptr GetStdinStream(); std::shared_ptr GetStdoutStream(); std::shared_ptr GetStderrStream(); Process(); Process(std::string name, std::vector args,bool includeThisEnv=true); Process(std::string name, std::vector args, std::vector> env,bool includeThisEnv=false); Process(std::string name, std::vector args, std::vector env,bool includeThisEnv=false); bool Start(); void Kill(int signal); int WaitForExit(); ~Process(); }; }