VCF::ProcessWithRedirectedIO Class Reference
This class represents a process that has it's IO redirected so that when there is new data available an event is fired to any registered event handlers.
More...
#include <vcf/FoundationKit/ProcessWithRedirectedIO.h>
Inheritance diagram for VCF::ProcessWithRedirectedIO:
List of all members.
Detailed Description
This class represents a process that has it's IO redirected so that when there is new data available an event is fired to any registered event handlers.
Currently only output is captured and redirected. You can register an event handler with the addOutputReadyHandler() method. To start the process either call createProcess() or construct the process and pass in a filename/commandline to the constructor.
Constructor & Destructor Documentation
| VCF::ProcessWithRedirectedIO::ProcessWithRedirectedIO |
( |
|
) |
|
|
| VCF::ProcessWithRedirectedIO::ProcessWithRedirectedIO |
( |
const String & |
processName, |
|
|
const String & |
arguments |
|
) |
|
|
| virtual VCF::ProcessWithRedirectedIO::~ProcessWithRedirectedIO |
( |
|
) |
[virtual] |
|
Member Function Documentation
| void VCF::ProcessWithRedirectedIO::addOutputReadyHandler |
( |
EventHandler * |
eventHandler |
) |
[inline] |
|
|
|
adds a new output ready handler.
Please note (for at least Win32 implementations, when data is a ready and the the new event is fired, this will happen in the context of a different thread than the one in which the ProcessWithRedirectedIO was created in. - Deprecated:
- use the OutputReady delegate directly.
|
| bool VCF::ProcessWithRedirectedIO::createProcess |
( |
const String & |
processName, |
|
|
const String & |
arguments |
|
) |
|
|
|
|
creates/runs the process
- Parameters:
-
| String | the name of the process to run. createProcess() will block till the process is finished running. |
| arguments | the arguments, or command line, to pass to the process |
- Returns:
- bool indicates wether the process creation was successful. If the process was successful then it returns true. If not then it returns false.
|
| int VCF::ProcessWithRedirectedIO::getID |
( |
|
) |
|
|
|
|
Returns the ID of the process.
|
| String VCF::ProcessWithRedirectedIO::getName |
( |
|
) |
|
|
|
|
returns the name of the process including any commandline supplied.
|
|
|
returns the current peer instance.
Should NEVER be NULL as the constructors should throw exceptions if a NULL peer is returned from the SystemToolkit |
| int VCF::ProcessWithRedirectedIO::getThreadID |
( |
|
) |
|
|
|
|
returns the processes's main thread ID
|
| void VCF::ProcessWithRedirectedIO::removeOutputReadyHandler |
( |
EventHandler * |
eventHandler |
) |
[inline] |
|
| uint32 VCF::ProcessWithRedirectedIO::terminate |
( |
|
) |
|
|
Member Data Documentation
|
|
- Event Delegate:
- OutputReady fires an OutputReadyEvent. This is fired by the framework, specifically the ProcessIORedirectionPeer, whenever data has become available and read to read. The peer will allocate the data in the form of a string (it's assumed to be text format).
- Note:
- Please note that when data is a ready and the the new event is fired, at least in the Win32 implementation, this event will be fired in the context of a different thread than the one in which the ProcessWithRedirectedIO was created in.
event class: OutputReadyEvent
event type:
|
The documentation for this class was generated from the following file: