PixelLightAPI  .
Public Member Functions
PLCore::Process Class Reference

Class for running and controlling an external process. More...

#include <Process.h>

List of all members.

Public Member Functions

 Process ()
 Constructor.
PLCORE_API ~Process ()
 Destructor.
PLCORE_API void Execute (const String &sCommand, const String &sArguments)
 Starts a process.
PLCORE_API void ExecuteRedirectIO (const String &sCommand, const String &sArguments)
 Starts a process with redirected input/output.
PLCORE_API void ExecuteRedirectIO (const String &sCommand, const String &sArguments, const Pipe &cPipeIn, const Pipe &cPipeOut, const Pipe &cPipeErr)
 Starts a process with redirected input/output.
PLCORE_API void ExecuteRedirectIO (const String &sCommand, const String &sArguments, handle hPipeIn, handle hPipeOut, handle hPipeErr)
 Starts a process with redirected input/output.
PLCORE_API bool IsRunning () const
 Returns if the process is running.
PLCORE_API void Terminate ()
 Terminates the process.
FileGetInput ()
 Get input stream.
FileGetOutput ()
 Get output stream.
FileGetError ()
 Get error stream.
const PipeGetPipeInput () const
 Get input pipe.
const PipeGetPipeOutput () const
 Get output pipe.
const PipeGetPipeError () const
 Get error pipe.

Detailed Description

Class for running and controlling an external process.


Constructor & Destructor Documentation

PLCORE_API PLCore::Process::~Process ( )

Destructor.


Member Function Documentation

PLCORE_API void PLCore::Process::Execute ( const String sCommand,
const String sArguments 
)

Starts a process.

Parameters:
[in]sCommandCommand to run
[in]sArgumentsArguments for the command
PLCORE_API void PLCore::Process::ExecuteRedirectIO ( const String sCommand,
const String sArguments 
)

Starts a process with redirected input/output.

Parameters:
[in]sCommandCommand to run
[in]sArgumentsArguments for the command
Remarks:
This function creates unnamed pipes to redirect input and output. To access theses pipes, use the appropriate functions like GetInput(), GetOutput() a.s.o. If you want to specify the pipes by yourself, see the other two variations of ExecuteRedirectIO().
PLCORE_API void PLCore::Process::ExecuteRedirectIO ( const String sCommand,
const String sArguments,
const Pipe cPipeIn,
const Pipe cPipeOut,
const Pipe cPipeErr 
)

Starts a process with redirected input/output.

Parameters:
[in]sCommandCommand to run
[in]sArgumentsArguments for the command
[in]cPipeInPipe for input
[in]cPipeOutPipe for output
[in]cPipeErrPipe for error
PLCORE_API void PLCore::Process::ExecuteRedirectIO ( const String sCommand,
const String sArguments,
handle  hPipeIn,
handle  hPipeOut,
handle  hPipeErr 
)

Starts a process with redirected input/output.

Parameters:
[in]sCommandCommand to run
[in]sArgumentsArguments for the command
[in]hPipeInSystem handle for the input pipe
[in]hPipeOutSystem handle for the output pipe
[in]hPipeErrSystem handle for the error pipe
Note:
  • On Linux, the handle is a file handle of type int
  • On Windows, the handle is a file handle of type HANDLE
PLCORE_API bool PLCore::Process::IsRunning ( ) const

Returns if the process is running.

Returns:
'true' if running, else 'false'
PLCORE_API void PLCore::Process::Terminate ( )

Terminates the process.

Get input stream.

Returns:
Input file for the process

Get output stream.

Returns:
Output file for the process

Get error stream.

Returns:
Error file for the process
const Pipe & PLCore::Process::GetPipeInput ( ) const [inline]

Get input pipe.

Returns:
Input pipe for the process
const Pipe & PLCore::Process::GetPipeOutput ( ) const [inline]

Get output pipe.

Returns:
Output pipe for the process
const Pipe & PLCore::Process::GetPipeError ( ) const [inline]

Get error pipe.

Returns:
Error pipe for the process

The documentation for this class was generated from the following files:


PixelLight PixelLight 0.9.10-R1
Copyright (C) 2002-2011 by The PixelLight Team
Last modified Fri Dec 23 2011 15:51:16
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported