Execute multiple child processes chaining input / output between them. More...
#include <Process.h>
Public Member Functions | |
Result | pipe (Process &process, const Span< const StringView > cmd) |
Add a process to the chain, with given arguments. | |
Result | launch (const Process::StdOut &stdOut=Process::StdOut::Inherit{}, const Process::StdIn &stdIn=Process::StdIn::Inherit{}, const Process::StdErr &stdErr=Process::StdErr::Inherit{}) |
Launch the entire chain of processes. | |
Result | waitForExitSync () |
Waits (blocking) for entire process chain to exit. | |
Result | exec (const Process::StdOut &stdOut=Process::StdOut::Inherit{}, const Process::StdIn &stdIn=Process::StdIn::Inherit{}, const Process::StdErr &stdErr=Process::StdErr::Inherit{}) |
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
|
inlinenodiscard |
Launch the entire chain of processes and waits for the results (calling ProcessChain::waitForExitSync)
|
nodiscard |
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.
|
nodiscard |
|
nodiscard |
Waits (blocking) for entire process chain to exit.
Can be called only after ProcessChain::launch.