GProcess Class Reference

A process wrapper class. More...

#include <GProcess.h>

List of all members.

Public Member Functions

OsProcess Handle ()
OsProcessId GetId ()
int ExitValue ()
bool Terminate ()
 Stops the process right now, use with care.
bool IsRunning ()
bool Run (char *Exe, char *Args, char *Dir, bool Wait, GStream *In=0, GStream *Out=0, int Priority=0)
 Starts a new process.


Detailed Description

A process wrapper class.

Member Function Documentation

int GProcess::ExitValue (  ) 

Returns:
the value the process exited with

OsProcessId GProcess::GetId (  ) 

Returns:
the process ID [Win32]

OsProcess GProcess::Handle (  ) 

Returns:
the process handle

bool GProcess::IsRunning (  ) 

Returns:
true if still running, else false.

Referenced by Run().

bool GProcess::Run ( char *  Exe,
char *  Args,
char *  Dir,
bool  Wait,
GStream In = 0,
GStream Out = 0,
int  Priority = 0 
)

Starts a new process.

Parameters:
Exe  The path to the executable to run
Args  The arguments to pass to the program
Dir  The current directory to start the program in
Wait  If true, calling Run will block until the process exits, else Run will exit after starting the process.

The parameters In and Out are only used if Wait=true

In  A stream to supply input to the process. Only used if Wait=true.
Out  A stream to capture output from the process. Only used if Wait=true.
Priority  The priority to run the process at. -2 = idle -1 = low 0 = normal 1 = high 2 = realtime(ish)

References GArray< Type >::Add(), GStream::GetSize(), IsRunning(), GArray< Type >::Length(), LGI_OS_WIN9X, LGI_PATH_SEPARATOR, LgiSleep, GStringPipe::NewStr(), GStringPipe::Push(), GStream::Read(), and GStream::Write().

Referenced by SystemFunctions::Execute(), GApp::GetFileMimeType(), LgiGetExeFile(), LgiGetSystemPath(), and GSymLookup::Lookup().


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

Generated on Wed Dec 1 15:41:03 2010 for Lgi by  doxygen 1.5.7.1