Execute multiple child processes chaining input / output between them. More...
#include <Process.h>
Public Member Functions | |
| Result | pipe (Process &process, const Span< const StringSpan > cmd) |
| Add a process to the chain, with given arguments. | |
| template<typename Out = Process::StdOut, typename In = Process::StdIn, typename Err = Process::StdErr> | |
| Result | launch (Out &&stdOut=Out(), In &&stdIn=In(), Err &&stdErr=Err()) |
| Launch the entire chain of processes. | |
| Result | waitForExitSync () |
| Waits (blocking) for entire process chain to exit. | |
| template<typename Out = Process::StdOut, typename In = Process::StdIn, typename Err = Process::StdErr> | |
| Result | exec (Out &&stdOut=Out(), In &&stdIn=In(), Err &&stdErr=Err()) |
| Launch the entire chain of processes and waits for the results (calling ProcessChain::waitForExitSync) | |
Public Attributes | |
| Process::Options | options |
Execute multiple child processes chaining input / output between them.
Chains multiple child processes together, so that the output of a process becomes input of another (similar to what happens wit the pipe (|) operator on Posix shells).
SC::PipeDescriptor from File library is used to chain read / write endpoints of different processes together.
Example: Inherit stdout file descriptor
Example: Read stderr and stdout into a string
Example: Read standard output into a string using a Pipe
|
inline |
Launch the entire chain of processes and waits for the results (calling ProcessChain::waitForExitSync)
|
inline |
Launch the entire chain of processes.
Reading from pipes can be done after launching. You can then call ProcessChain::waitForExitSync to block until the child process is fully finished.
| Result SC::ProcessChain::pipe | ( | Process & | process, |
| const Span< const StringSpan > | cmd ) |
| Result SC::ProcessChain::waitForExitSync | ( | ) |
Waits (blocking) for entire process chain to exit.
Can be called only after ProcessChain::launch.