bob.hpp
Loading...
Searching...
No Matches
bob::CmdFuture Struct Reference

Represents a command that being executed in the background. More...

#include <bob.hpp>

Public Member Functions

int await (string *output=nullptr)
 Blocks until the command completes and returns the exit code.
 
bool poll (string *output=nullptr)
 
bool kill ()
 Kills the command if it is still running.
 

Public Attributes

pid_t cpid
 Process ID of the child process.
 
bool done
 Indicates whether the command has completed.
 
int exit_code
 Exit code of the command. Only valid after the command has completed.
 
int output_fd
 File descriptor for reading the command's output (stdout and stderr).
 
bool silent = false
 If true, the command's output will not be printed to stdout while it is running.
 

Detailed Description

Represents a command that being executed in the background.

Member Function Documentation

◆ poll()

bool bob::CmdFuture::poll ( string *  output = nullptr)

Polls the command's output and checks if it has completed. Also captures and prints any output.


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