Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site











SourceForge.net Logo

Functions4U Reference. LocalProcess2


 

class LocalProcess2 : public AProcess

 

LocalProcess2 permits to launch and handle new process from a host application.

 

These processes are defined by a classical command line like the used in the command window, although it can add default directory and environment variables.

 

LocalProcess2 is a fork of LocalProcess adding some new abilities like:

Process pauses (suspends) and resumes including all children processes and threads.

Process killing includes all children processes and threads.

Process starting includes default directory.

 

Public Method List


 

bool Start(const char *cmdline, const char *envptr = ((void *)0), const char *dir = ((void *)0))

Starts a new process defined by the command line cmdline, using envptr environment variables and running the process in dir directory.

All text output from process to standard streams stdout and stderr is mixed and can be got using Read() method.

 


 

bool Start2(const char *cmdline, const char *envptr = ((void *)0), const char *dir = ((void *)0))

Starts a new process defined by the command line cmdline, using envptr environment variables and running the process in dir directory.

All text output from process to standard streams stdout and stderr is separated and can be got using Read2() method.

 


 

bool Start(const char *cmd, const Vector<String>& arg, const char *envptr = ((void *)0), const char *dir = ((void *)0))

Starts a new process defined by the command cmd with arguments list arg, using envptr environment variables and running the process in dir directory.

All text output from process to standard streams stdout and stderr is mixed and can be got using Read() method.

 


 

bool Start2(const char *cmd, const Vector<String>& arg, const char *envptr = ((void *)0), const char *dir = ((void *)0))

Starts a new process defined by the command cmd with arguments list arg, using envptr environment variables and running the process in dir directory.

All text output from process to standard streams stdout and stderr is separated and can be got using Read2() method.

 


 

void Kill()

Kills a process and all children processes and threads.

 


 

bool IsRunning()

Returns true if process is still running.

 


 

void Write(String s)

Sends a text string s to process.

In a command window, this text would be entered using the keyboard.

 


 

bool Read(String& res)

Reads text res from process. This process should have to be started using Start() function.

In a command window, this text would be output to the screen.

 


 

bool Read2(String& reso, String& rese)

Reads text reso from stdout and rese from stderr. This process should have to be started using Start2() function.

In a command window, this text would be output to the screen.

 


 

String GetExitMessage()

Returns the string defined by the operating system to describe the error code.

 


 

int GetExitCode()

Returns the process exit code.

 


 

void Pause()

Pauses/freezes/suspends process and all children processes and threads.

If process is already paused, it resumes it.

Only defined in Windows.

 


 

bool IsPaused()

Returns true if process is paused.

Only defined in Windows.

 

Do you want to contribute?