OpenShot Library | libopenshot-audio
0.2.0
|
31 return activeProcess !=
nullptr && activeProcess->isRunning();
36 return activeProcess !=
nullptr ? activeProcess->read (dest, numBytes) : 0;
41 return activeProcess ==
nullptr || activeProcess->killProcess();
46 return activeProcess !=
nullptr ? activeProcess->getExitCode() : 0;
77 result.
write (buffer, (
size_t) num);
86 class ChildProcessTests :
public UnitTest
89 ChildProcessTests() :
UnitTest (
"ChildProcess",
"Threads") {}
91 void runTest()
override
93 beginTest (
"Child Processes");
95 #if JUCE_WINDOWS || JUCE_MAC || JUCE_LINUX
99 expect (p.start (
"tasklist"));
101 expect (p.start (
"ls /"));
110 static ChildProcessTests childProcessUnitTests;
bool write(const void *, size_t) override
Writes a block of data to the stream.
ChildProcess()
Creates a process object.
int readProcessOutput(void *destBuffer, int numBytesToRead)
Attempts to read some output from the child process.
uint32 getExitCode() const
If the process has finished, this returns its exit code.
String readAllProcessOutput()
Blocks until the process has finished, and then returns its complete output as a string.
bool isRunning() const
Returns true if the child process is alive.
bool waitForProcessToFinish(int timeoutMs) const
Blocks until the process is no longer running.
Writes data to an internal memory buffer, which grows as required.
static uint32 getMillisecondCounter() noexcept
Returns the number of millisecs since a fixed event (usually system startup).
String toString() const
Attempts to detect the encoding of the data and convert it to a string.
This is a base class for classes that perform a unit test.
bool kill()
Attempts to kill the child process.
~ChildProcess()
Destructor.
static void JUCE_CALLTYPE sleep(int milliseconds)
Suspends the execution of the current thread until the specified timeout period has elapsed (note tha...