ProcLib 0.0.1.0
A cross-platform process runner.
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
pl::ProcessResult Struct Reference

Describes the outcome of launching and running a process. More...

#include <process.hxx>

Public Types

enum class  Status {
  Success , NonZeroExit , FailedToStart , Terminated ,
  Killed , Crashed , Error
}
 The final status of the process. More...
 

Public Member Functions

auto succeeded () const -> bool
 

Public Attributes

Status status = Status::Error
 The process completion status.
 
int32_t exitCode = -1
 The exit code returned by the process. A value of -1 indicates that no exit code was available.
 
std::string message
 Additional information about a process failure.
 

Detailed Description

Describes the outcome of launching and running a process.

Member Enumeration Documentation

◆ Status

enum class pl::ProcessResult::Status
strong

The final status of the process.

Enumerator
Success 

The process ran to completion and exited with code 0.

NonZeroExit 

The process ran to completion but exited with a non-zero code.

FailedToStart 

The process could not be started.

Terminated 

The process was asked to stop gracefully, via terminate(), and did.

Killed 

The process was stopped forcibly, via kill().

Crashed 

The process ended unexpectedly (e.g. an unrequested signal or fault), not via terminate()/kill().

Error 

An unexpected error occurred while managing the process.

Member Function Documentation

◆ succeeded()

auto pl::ProcessResult::succeeded ( ) const -> bool
inline

Determines whether the process completed successfully.

Returns
true if the process exited successfully; otherwise false.

Member Data Documentation

◆ exitCode

int32_t pl::ProcessResult::exitCode = -1

The exit code returned by the process. A value of -1 indicates that no exit code was available.

◆ message

std::string pl::ProcessResult::message

Additional information about a process failure.

◆ status

Status pl::ProcessResult::status = Status::Error

The process completion status.


The documentation for this struct was generated from the following file: