Provides the capability to start processes in a variety of ways to run other applications. More...
#include <launch_process.h>


Public Types | |
| enum | launch_flags { HIDE_APP_WINDOW = 0x1, AWAIT_APP_EXIT = 0x2, RETURN_IMMEDIATELY = 0x4, AWAIT_VIA_POLLING = 0x8, SHELL_EXECUTE = 0x10 } |
Public Member Functions | |
| DEFINE_CLASS_NAME ("launch_process") | |
| virtual | ~launch_process () |
Static Public Member Functions | |
| static basis::un_int | run (const basis::astring &app_name, const basis::astring &command_line, int flag, basis::un_int &child_id) |
| starts an application using the "app_name" as the executable to run. | |
| static char_star_array | break_line (basis::astring &app, const basis::astring ¶meters) |
| prepares an "app" to launch with the "parameters" (via exec). | |
Provides the capability to start processes in a variety of ways to run other applications.
Definition at line 44 of file launch_process.h.
Definition at line 51 of file launch_process.h.
| virtual processes::launch_process::~launch_process | ( | ) | [inline, virtual] |
Definition at line 49 of file launch_process.h.
| char_star_array processes::launch_process::break_line | ( | basis::astring & | app, | |
| const basis::astring & | parameters | |||
| ) | [static] |
prepares an "app" to launch with the "parameters" (via exec).
this breaks the strings for an application named "app" and its "parameters" into an array of char * that is appropriate for the execv function.
Definition at line 118 of file launch_process.cpp.
References basis::astring::end(), FUNCDEF, basis::array< contents >::last(), basis::astring::length(), LOG, NIL, basis::astring::stuff(), basis::astring::substring(), and basis::astring::zap().
Referenced by run().
| processes::launch_process::DEFINE_CLASS_NAME | ( | "launch_process" | ) |
| basis::un_int processes::launch_process::run | ( | const basis::astring & | app_name, | |
| const basis::astring & | command_line, | |||
| int | flag, | |||
| basis::un_int & | child_id | |||
| ) | [static] |
starts an application using the "app_name" as the executable to run.
the "command_line" is the set of parameters to be passed to the app. the return value is OS specific but can be identified using system_error_text(). usually a zero return means success and non-zero codes are errors. the "flag" is an XORed value from the process launch flags that dictates how the app is to be started. in practice, only the HIDE_APP_WINDOW flag can be combined with other values. if either AWAIT flag is used, then the return value will be the launched process's own exit value. the thread or process_id of the launched process is stored in "child_id" if appropriate.
Definition at line 163 of file launch_process.cpp.
References processes::__our_kids(), processes::__process_synchronizer(), AWAIT_APP_EXIT, AWAIT_VIA_POLLING, break_line(), basis::astring::end(), execv, FUNCDEF, HIDE_APP_WINDOW, basis::astring::insert(), LOG, NIL, basis::array< contents >::observe(), RETURN_IMMEDIATELY, basis::astring::s(), and SHELL_EXECUTE.
1.6.3