11#include <system_error>
43 class PlatformProcess;
71 [[nodiscard]]
auto start(std::filesystem::path
const& executablePath, std::vector<std::string>
const& arguments) -> std::error_code;
83 [[nodiscard]]
auto kill(uint32_t
const exitCode = 1) -> std::error_code;
93 enum class StopRequest
100 std::unique_ptr<PlatformProcess> _platformProcess;
101 StopRequest _stopRequest = StopRequest::None;
Forward declaration.
Definition process.hxx:47
auto wait() -> ProcessResult
Process & operator=(Process const &)=delete
Delete copy operation.
auto kill(uint32_t const exitCode=1) -> std::error_code
auto terminate() -> std::error_code
auto start(std::filesystem::path const &executablePath, std::vector< std::string > const &arguments) -> std::error_code
Process(Process const &)=delete
Delete copy operation.
Process(Process &&)=delete
Delete copy operation.
Process & operator=(Process &&)=delete
Delete copy operation.
Describes the outcome of launching and running a process.
Definition process.hxx:18
auto succeeded() const -> bool
Definition process.hxx:37
std::string message
Additional information about a process failure.
Definition process.hxx:33
int32_t exitCode
The exit code returned by the process. A value of -1 indicates that no exit code was available.
Definition process.hxx:32
Status status
The process completion status.
Definition process.hxx:31
Status
The final status of the process.
Definition process.hxx:21
@ Crashed
The process ended unexpectedly (e.g. an unrequested signal or fault), not via terminate()/kill().
@ FailedToStart
The process could not be started.
@ Success
The process ran to completion and exited with code 0.
@ NonZeroExit
The process ran to completion but exited with a non-zero code.
@ Error
An unexpected error occurred while managing the process.
@ Killed
The process was stopped forcibly, via kill().
@ Terminated
The process was asked to stop gracefully, via terminate(), and did.