INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES

indexing

title: "External process"
project: "Visual Eiffel Library"
revision: "$Revision: 1.1 $"
copyright: "Copyright (C) 1996-2005 Object Tools Group"
license: "http://visual-eiffel.com/license"
cluster: pool
class EXTERNAL_PROCESS
inherit

WAPI_PROCESS_AND_THREAD_FUNCTIONS
end

WAPI_CONSOLE_FUNCTIONS
end

WAPI_HANDLE_AND_OBJECT_FUNCTIONS
end

WAPI_WAIT_CONST
end

WAPI_SYNCHRONIZATION_FUNCTIONS
end

WAPI_STARTUP_FLAGS
end

WAPI_PROCESS_CREATION_FLAGS
end

WAPI_FILES_AND_DIRS_ACCESS_RIGHTS
end

WAPI_PROCESS_AND_THREAD_ACCESS_MASKS
end

WAPI_EXIT_CODE_CONST
end

WAPI_STD_HANDLES
end

WAPI_SHOWWINDOW_COMMANDS
end
creation

make,
make_shell,
make_with_arguments
feature {NONE}-- Creation

make (command_name: STRING)
-- Specify 'command', corresponding to the new process
-- The arguments are included in the `command'
require
non_void_command_name: command_name /= void
non_empty_command_name: not command_name.is_empty
ensure
non_void_command: command /= void
non_empty_command: not command.is_empty
command_cloned: command /= command_name
not_is_running: not is_running
command_set: equal (command, command_name)
is_console_default: is_console_default
show_window_default: show_window_command = sw_showdefault

make_with_arguments (program_name: STRING; arguments: ARRAY [STRING])
-- Specify `program_name', corresponding to the new process
-- and `arguments' to be passed to it
require
non_void_program_name: program_name /= void
non_empty_program_name: not program_name.is_empty
ensure
non_void_command: command /= void
non_empty_command: not command.is_empty

make_shell (command_name: STRING)
-- Specify 'command', corresponding to the new process
-- that should be run in the default shell
require
non_void_command_name: command_name /= void
non_empty_command_name: not command_name.is_empty
ensure
non_void_command: command /= void
non_empty_command: not command.is_empty
command_cloned: command /= command_name
not_is_running: not is_running
is_console_default: is_console_default
show_window_default: show_window_command = sw_showdefault
feature -- Status report

command: STRING

is_running: BOOLEAN
-- Is process running?

exit_code: INTEGER
-- The OS-dependent exit code of the process
require
not_is_running: not is_running
feature -- Actions

execute
-- Create new process and wait until it finishes
ensure
not_is_running: not is_running

start
-- Create new process and do not wait until it finishes

start_io (input_stream: PROCESS_INPUT_STREAM; output_stream: PROCESS_OUTPUT_STREAM; error_stream: PROCESS_OUTPUT_STREAM)
-- Create new process and do not wait until it finishes; use specified
-- streams for process input, output and error
require
valid_input: input_stream /= void implies input_stream.is_open
valid_output: output_stream /= void implies output_stream.is_open
valid_error: error_stream /= void implies error_stream.is_open

wait
-- Wait until running process finishes
ensure
not_is_running: not is_running
feature -- Removal

dispose
-- Close all OS handles
feature -- Win32 specific: status report

is_console_new: BOOLEAN

is_console_default: BOOLEAN

is_console_none: BOOLEAN

show_window_command: INTEGER
feature -- Win32 specific: status setting

allocate_new_console
ensure
is_console_new

allocate_default_console
ensure
is_console_default

allocate_no_console
ensure
is_console_none

show_window (sw_command: INTEGER)
ensure
show_window_command = sw_command
invariant

non_void_command: command /= void
non_empty_command: not command.is_empty
consistent_console_status: (is_console_new implies not (is_console_default or is_console_none)) and (is_console_default implies not (is_console_new or is_console_none)) and (is_console_none implies not (is_console_new or is_console_default))
end -- class EXTERNAL_PROCESS

INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES