OpenShot Audio Library | OpenShotAudio 0.3.2
|
#include <juce_ChildProcess.h>
Public Types | |
enum | StreamFlags { wantStdOut = 1 , wantStdErr = 2 } |
Public Member Functions | |
ChildProcess () | |
~ChildProcess () | |
bool | start (const String &command, int streamFlags=wantStdOut|wantStdErr) |
bool | start (const StringArray &arguments, int streamFlags=wantStdOut|wantStdErr) |
bool | isRunning () const |
int | readProcessOutput (void *destBuffer, int numBytesToRead) |
String | readAllProcessOutput () |
bool | waitForProcessToFinish (int timeoutMs) const |
uint32 | getExitCode () const |
bool | kill () |
Launches and monitors a child process.
This class lets you launch an executable, and read its output. You can also use it to check whether the child process has finished.
Definition at line 35 of file juce_ChildProcess.h.
These flags are used by the start() methods.
Definition at line 50 of file juce_ChildProcess.h.
juce::ChildProcess::ChildProcess | ( | ) |
Creates a process object. To actually launch the process, use start().
Definition at line 26 of file juce_ChildProcess.cpp.
juce::ChildProcess::~ChildProcess | ( | ) |
Destructor. Note that deleting this object won't terminate the child process.
Definition at line 27 of file juce_ChildProcess.cpp.
uint32 juce::ChildProcess::getExitCode | ( | ) | const |
If the process has finished, this returns its exit code.
Definition at line 44 of file juce_ChildProcess.cpp.
bool juce::ChildProcess::isRunning | ( | ) | const |
Returns true if the child process is alive.
Definition at line 29 of file juce_ChildProcess.cpp.
Referenced by waitForProcessToFinish().
bool juce::ChildProcess::kill | ( | ) |
Attempts to kill the child process. Returns true if it succeeded. Trying to read from the process after calling this may result in undefined behaviour.
Definition at line 39 of file juce_ChildProcess.cpp.
String juce::ChildProcess::readAllProcessOutput | ( | ) |
Blocks until the process has finished, and then returns its complete output as a string.
Definition at line 65 of file juce_ChildProcess.cpp.
Attempts to read some output from the child process. This will attempt to read up to the given number of bytes of data from the process. It returns the number of bytes that were actually read.
Definition at line 34 of file juce_ChildProcess.cpp.
Referenced by readAllProcessOutput().
Attempts to launch a child process command.
The command should be the name of the executable file, followed by any arguments that are required. If the process has already been launched, this will launch it again. If a problem occurs, the method will return false. The streamFlags is a combinations of values to indicate which of the child's output streams should be read and returned by readProcessOutput().
bool juce::ChildProcess::start | ( | const StringArray & | arguments, |
int | streamFlags = wantStdOut|wantStdErr |
||
) |
Attempts to launch a child process command.
The first argument should be the name of the executable file, followed by any other arguments that are needed. If the process has already been launched, this will launch it again. If a problem occurs, the method will return false. The streamFlags is a combinations of values to indicate which of the child's output streams should be read and returned by readProcessOutput().
Blocks until the process is no longer running.
Definition at line 49 of file juce_ChildProcess.cpp.