GNU Octave
3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
|
#include "cmd-edit.h"
Public Types | |
typedef int(* | char_is_quoted_fcn )(const std::string &, int) |
typedef std::string(* | completion_fcn )(const std::string &, int) |
typedef std::string(* | dequoting_fcn )(const std::string &, int) |
typedef int(* | event_hook_fcn )(void) |
typedef int(* | pre_input_hook_fcn )(void) |
typedef std::string(* | quoting_fcn )(const std::string &, int, char) |
typedef int(* | startup_hook_fcn )(void) |
typedef void(* | user_accept_line_fcn )(const std::string &) |
Public Member Functions | |
virtual | ~command_editor (void) |
Protected Attributes | |
int | command_number |
std::string | initial_input |
bool | interrupted |
Private Types | |
typedef std::set < event_hook_fcn > ::const_iterator | event_hook_set_const_iterator |
typedef std::set < event_hook_fcn >::iterator | event_hook_set_iterator |
typedef std::set < pre_input_hook_fcn > ::const_iterator | pre_input_hook_set_const_iterator |
typedef std::set < pre_input_hook_fcn > ::iterator | pre_input_hook_set_iterator |
typedef std::set < startup_hook_fcn > ::const_iterator | startup_hook_set_const_iterator |
typedef std::set < startup_hook_fcn >::iterator | startup_hook_set_iterator |
Private Member Functions | |
command_editor (const command_editor &) | |
command_editor & | operator= (const command_editor &) |
Static Private Member Functions | |
static void | cleanup_instance (void) |
static int | event_handler (void) |
static bool | instance_ok (void) |
static void | make_command_editor (void) |
static int | pre_input_handler (void) |
static int | startup_handler (void) |
Static Private Attributes | |
static std::set< event_hook_fcn > | event_hook_set |
static command_editor * | instance = 0 |
static std::set < pre_input_hook_fcn > | pre_input_hook_set |
static std::set< startup_hook_fcn > | startup_hook_set |
Definition at line 33 of file cmd-edit.h.
Definition at line 56 of file cmd-edit.h.
typedef std::string(* command_editor::completion_fcn)(const std::string &, int) |
Definition at line 50 of file cmd-edit.h.
typedef std::string(* command_editor::dequoting_fcn)(const std::string &, int) |
Definition at line 54 of file cmd-edit.h.
Definition at line 48 of file cmd-edit.h.
|
private |
Definition at line 209 of file cmd-edit.h.
|
private |
Definition at line 208 of file cmd-edit.h.
Definition at line 46 of file cmd-edit.h.
|
private |
Definition at line 206 of file cmd-edit.h.
|
private |
Definition at line 205 of file cmd-edit.h.
Definition at line 52 of file cmd-edit.h.
Definition at line 44 of file cmd-edit.h.
|
private |
Definition at line 203 of file cmd-edit.h.
|
private |
Definition at line 202 of file cmd-edit.h.
typedef void(* command_editor::user_accept_line_fcn)(const std::string &) |
Definition at line 58 of file cmd-edit.h.
|
inlineprotected |
Definition at line 39 of file cmd-edit.h.
|
inlinevirtual |
Definition at line 60 of file cmd-edit.h.
|
private |
Definition at line 1310 of file cmd-edit.cc.
References do_accept_line(), instance, and instance_ok().
|
static |
Definition at line 1382 of file cmd-edit.cc.
References event_handler(), event_hook_set, instance, instance_ok(), and set_event_hook().
Referenced by gh_manager::do_enable_event_processing(), gh_manager::do_post_event(), Fadd_input_event_hook(), and octave_link::octave_link().
|
static |
Definition at line 1356 of file cmd-edit.cc.
References instance, instance_ok(), pre_input_handler(), pre_input_hook_set, and set_pre_input_hook().
Referenced by readline().
|
static |
Definition at line 1330 of file cmd-edit.cc.
References instance, instance_ok(), set_startup_hook(), startup_handler(), and startup_hook_set.
Definition at line 1151 of file cmd-edit.cc.
References do_blink_matching_paren(), instance, and instance_ok().
Referenced by octave_execute_interpreter().
Definition at line 214 of file cmd-edit.h.
Referenced by instance_ok().
Definition at line 1102 of file cmd-edit.cc.
References do_clear_screen(), instance, and instance_ok().
Referenced by Fclc().
Definition at line 1323 of file cmd-edit.cc.
References do_clear_undo_list(), instance, and instance_ok().
Definition at line 1123 of file cmd-edit.cc.
References command_number, instance, and instance_ok().
|
static |
Definition at line 1116 of file cmd-edit.cc.
References do_decode_prompt_string(), instance, and instance_ok().
Referenced by octave_base_reader::do_input_echo(), and octave_base_reader::octave_gets().
Implemented in default_command_editor.
Referenced by accept_line().
Definition at line 257 of file cmd-edit.h.
Referenced by blink_matching_paren().
Definition at line 247 of file cmd-edit.h.
Referenced by clear_screen().
Definition at line 310 of file cmd-edit.h.
Referenced by clear_undo_list().
|
protectedvirtual |
Definition at line 1496 of file cmd-edit.cc.
References octave_env::base_pathname(), command_number, command_history::current_number(), octave_env::get_current_directory(), octave_env::get_home_directory(), octave_env::get_host_name(), octave_env::get_program_name(), octave_env::get_user_name(), newline_chars(), octave_rl_prompt_end_ignore(), octave_rl_prompt_start_ignore(), octave_env::polite_directory_format(), read_octal(), and octave_base_tm::strftime().
Referenced by decode_prompt_string().
Definition at line 328 of file cmd-edit.h.
Referenced by filename_completion_desired().
Definition at line 330 of file cmd-edit.h.
Referenced by filename_quoting_desired().
|
protectedpure virtual |
Implemented in default_command_editor.
Referenced by generate_filename_completions().
|
inlineprotectedvirtual |
Definition at line 287 of file cmd-edit.h.
Referenced by get_char_is_quoted_function().
|
inlineprotectedvirtual |
Definition at line 281 of file cmd-edit.h.
Referenced by get_completion_function().
|
protectedpure virtual |
Implemented in default_command_editor.
Referenced by get_current_line().
|
inlineprotectedvirtual |
Definition at line 285 of file cmd-edit.h.
Referenced by get_dequoting_function().
|
protectedpure virtual |
Implemented in default_command_editor.
Referenced by get_input_stream().
|
protectedpure virtual |
Implemented in default_command_editor.
Referenced by get_line_buffer().
|
protectedpure virtual |
Implemented in default_command_editor.
Referenced by get_output_stream().
|
inlineprotectedvirtual |
Definition at line 283 of file cmd-edit.h.
Referenced by get_quoting_function().
|
inlineprotectedvirtual |
Definition at line 290 of file cmd-edit.h.
Referenced by get_user_accept_line_function().
Definition at line 1736 of file cmd-edit.cc.
References do_insert_text(), do_redisplay(), initial_input, and input().
Referenced by insert_initial_input().
|
protectedpure virtual |
Implemented in default_command_editor.
Referenced by do_insert_initial_input(), and insert_text().
Definition at line 332 of file cmd-edit.h.
Referenced by interrupt().
Implemented in default_command_editor.
Referenced by newline().
Definition at line 326 of file cmd-edit.h.
Referenced by re_read_init_file().
|
inlineprotectedvirtual |
Definition at line 324 of file cmd-edit.h.
Referenced by read_init_file().
|
inlineprotected |
Definition at line 224 of file cmd-edit.h.
Referenced by readline().
|
protectedpure virtual |
Implemented in default_command_editor.
Definition at line 241 of file cmd-edit.h.
Referenced by do_insert_initial_input(), and redisplay().
|
protectedpure virtual |
Implemented in default_command_editor.
Referenced by replace_line().
Definition at line 249 of file cmd-edit.h.
Referenced by resize_terminal().
Definition at line 255 of file cmd-edit.h.
Referenced by restore_terminal_state().
|
inlineprotectedvirtual |
Definition at line 263 of file cmd-edit.h.
Referenced by set_basic_quote_characters().
|
inlineprotectedvirtual |
Definition at line 259 of file cmd-edit.h.
Referenced by set_basic_word_break_characters().
|
inlineprotectedvirtual |
Definition at line 277 of file cmd-edit.h.
Referenced by set_char_is_quoted_function().
|
inlineprotectedvirtual |
Definition at line 267 of file cmd-edit.h.
Referenced by set_completer_quote_characters().
|
inlineprotectedvirtual |
Definition at line 261 of file cmd-edit.h.
Referenced by set_completer_word_break_characters().
Definition at line 269 of file cmd-edit.h.
Referenced by set_completion_append_character().
|
inlineprotectedvirtual |
Definition at line 271 of file cmd-edit.h.
Referenced by set_completion_function().
|
inlineprotectedvirtual |
Definition at line 275 of file cmd-edit.h.
Referenced by set_dequoting_function().
|
inlineprotectedvirtual |
Definition at line 265 of file cmd-edit.h.
Referenced by set_filename_quote_characters().
|
protectedpure virtual |
Implemented in default_command_editor.
Referenced by set_input_stream().
|
inlineprotectedvirtual |
Definition at line 222 of file cmd-edit.h.
Referenced by set_name().
|
protectedpure virtual |
Implemented in default_command_editor.
Referenced by set_output_stream().
|
inlineprotectedvirtual |
Definition at line 273 of file cmd-edit.h.
Referenced by set_quoting_function().
|
inlineprotectedvirtual |
Definition at line 279 of file cmd-edit.h.
Referenced by set_user_accept_line_function().
Definition at line 245 of file cmd-edit.h.
Referenced by terminal_cols().
Definition at line 243 of file cmd-edit.h.
Referenced by terminal_rows().
Definition at line 308 of file cmd-edit.h.
Referenced by undo().
Definition at line 1776 of file cmd-edit.cc.
References current_liboctave_error_handler.
|
protected |
Definition at line 1782 of file cmd-edit.cc.
References current_liboctave_error_handler.
Definition at line 1001 of file cmd-edit.cc.
References event_hook_set, f, octave_mutex::lock(), and octave_mutex::unlock().
Referenced by add_event_hook(), and run_event_hooks().
Definition at line 1436 of file cmd-edit.cc.
References do_filename_completion_desired(), instance, and instance_ok().
Definition at line 1443 of file cmd-edit.cc.
References do_filename_quoting_desired(), instance, and instance_ok().
Definition at line 951 of file cmd-edit.cc.
References instance.
Referenced by octave_initialize_interpreter().
|
static |
Definition at line 1270 of file cmd-edit.cc.
References do_generate_filename_completions(), instance, and instance_ok().
Referenced by generate_completion().
|
static |
Definition at line 1256 of file cmd-edit.cc.
References do_get_char_is_quoted_function(), instance, and instance_ok().
|
static |
Definition at line 1235 of file cmd-edit.cc.
References do_get_completion_function(), instance, and instance_ok().
|
static |
Definition at line 1283 of file cmd-edit.cc.
References do_get_current_line(), instance, and instance_ok().
Referenced by main_window::execute_command_callback().
|
static |
Definition at line 1249 of file cmd-edit.cc.
References do_get_dequoting_function(), instance, and instance_ok().
|
static |
Definition at line 1060 of file cmd-edit.cc.
References do_get_input_stream(), instance, and instance_ok().
Referenced by get_input_from_stdin().
|
static |
Definition at line 1277 of file cmd-edit.cc.
References do_get_line_buffer(), instance, and instance_ok().
Referenced by is_completing_dirfns().
|
static |
Definition at line 1074 of file cmd-edit.cc.
References do_get_output_stream(), instance, and instance_ok().
|
static |
Definition at line 1242 of file cmd-edit.cc.
References do_get_quoting_function(), instance, and instance_ok().
|
static |
Definition at line 1263 of file cmd-edit.cc.
References do_get_user_accept_line_function(), instance, and instance_ok().
Definition at line 1137 of file cmd-edit.cc.
References command_number, instance, and instance_ok().
Referenced by main_loop().
Definition at line 965 of file cmd-edit.cc.
References do_insert_initial_input(), instance, and instance_ok().
Referenced by readline().
|
static |
Definition at line 1296 of file cmd-edit.cc.
References do_insert_text(), instance, and instance_ok().
Definition at line 917 of file cmd-edit.cc.
References singleton_cleanup_list::add(), cleanup_instance(), current_liboctave_error_handler, instance, and make_command_editor().
Referenced by accept_line(), add_event_hook(), add_pre_input_hook(), add_startup_hook(), blink_matching_paren(), clear_screen(), clear_undo_list(), current_command_number(), decode_prompt_string(), filename_completion_desired(), filename_quoting_desired(), generate_filename_completions(), get_char_is_quoted_function(), get_completion_function(), get_current_line(), get_dequoting_function(), get_input_stream(), get_line_buffer(), get_output_stream(), get_quoting_function(), get_user_accept_line_function(), increment_current_command_number(), insert_initial_input(), insert_text(), interrupt(), newline(), re_read_init_file(), read_init_file(), readline(), redisplay(), remove_event_hook(), remove_pre_input_hook(), remove_startup_hook(), replace_line(), reset_current_command_number(), resize_terminal(), restore_terminal_state(), set_basic_quote_characters(), set_basic_word_break_characters(), set_char_is_quoted_function(), set_completer_quote_characters(), set_completer_word_break_characters(), set_completion_append_character(), set_completion_function(), set_dequoting_function(), set_filename_quote_characters(), set_initial_input(), set_input_stream(), set_name(), set_output_stream(), set_quoting_function(), set_user_accept_line_function(), terminal_cols(), terminal_rows(), and undo().
Definition at line 1450 of file cmd-edit.cc.
References arg(), do_interrupt(), instance, instance_ok(), and interrupted.
Referenced by main_window::clear_command_window_callback(), main_window::debug_continue_callback(), main_window::debug_quit_callback(), main_window::debug_step_into_callback(), main_window::debug_step_out_callback(), main_window::debug_step_over_callback(), main_window::execute_command_callback(), and get_debug_input().
Definition at line 941 of file cmd-edit.cc.
References gnu_readline(), and instance.
Referenced by instance_ok().
Definition at line 1303 of file cmd-edit.cc.
References do_newline(), instance, and instance_ok().
|
inlineprotectedvirtual |
Definition at line 253 of file cmd-edit.h.
Referenced by do_decode_prompt_string().
|
private |
Definition at line 986 of file cmd-edit.cc.
References f, and pre_input_hook_set.
Referenced by add_pre_input_hook().
Definition at line 1429 of file cmd-edit.cc.
References do_re_read_init_file(), instance, and instance_ok().
Referenced by Freadline_re_read_init_file().
|
static |
Definition at line 1418 of file cmd-edit.cc.
References do_read_init_file(), instance, instance_ok(), and file_ops::tilde_expand().
Referenced by Freadline_read_init_file().
|
protected |
Definition at line 1754 of file cmd-edit.cc.
Referenced by do_decode_prompt_string().
|
static |
Definition at line 1029 of file cmd-edit.cc.
Referenced by gnu_readline().
|
static |
Definition at line 1037 of file cmd-edit.cc.
References add_pre_input_hook(), do_readline(), initial_input, insert_initial_input(), instance, and instance_ok().
Definition at line 1081 of file cmd-edit.cc.
References do_redisplay(), instance, and instance_ok().
Referenced by main_window::command_window_undo_callback(), and main_window::execute_command_callback().
|
static |
Definition at line 1395 of file cmd-edit.cc.
References event_hook_set, instance, instance_ok(), and restore_event_hook().
Referenced by gh_manager::do_enable_event_processing(), gh_manager::do_process_events(), Fremove_input_event_hook(), and internal_input_event_hook_fcn().
|
static |
Definition at line 1367 of file cmd-edit.cc.
References instance, instance_ok(), pre_input_hook_set, and restore_pre_input_hook().
|
static |
Definition at line 1341 of file cmd-edit.cc.
References instance, instance_ok(), restore_startup_hook(), and startup_hook_set.
Definition at line 1289 of file cmd-edit.cc.
References do_replace_line(), instance, and instance_ok().
Referenced by main_window::execute_command_callback().
Definition at line 1130 of file cmd-edit.cc.
References command_number, instance, and instance_ok().
Referenced by octave_execute_interpreter().
Definition at line 1109 of file cmd-edit.cc.
References do_resize_terminal(), instance, and instance_ok().
Referenced by main_window::resize_command_window_callback().
Definition at line 322 of file cmd-edit.h.
Referenced by remove_event_hook().
Definition at line 318 of file cmd-edit.h.
Referenced by remove_pre_input_hook().
Definition at line 314 of file cmd-edit.h.
Referenced by remove_startup_hook().
Definition at line 1144 of file cmd-edit.cc.
References do_restore_terminal_state(), instance, and instance_ok().
Referenced by do_octave_atexit().
|
static |
Definition at line 1172 of file cmd-edit.cc.
References do_set_basic_quote_characters(), instance, and instance_ok().
Referenced by initialize_command_input().
|
static |
Definition at line 1158 of file cmd-edit.cc.
References do_set_basic_word_break_characters(), instance, and instance_ok().
Referenced by initialize_command_input().
|
static |
Definition at line 1221 of file cmd-edit.cc.
References do_set_char_is_quoted_function(), instance, and instance_ok().
|
static |
Definition at line 1186 of file cmd-edit.cc.
References do_set_completer_quote_characters(), instance, and instance_ok().
Referenced by initialize_command_input().
|
static |
Definition at line 1165 of file cmd-edit.cc.
References do_set_completer_word_break_characters(), instance, and instance_ok().
Referenced by initialize_command_input().
Definition at line 1193 of file cmd-edit.cc.
References do_set_completion_append_character(), instance, and instance_ok().
Referenced by generate_completion().
|
static |
Definition at line 1200 of file cmd-edit.cc.
References do_set_completion_function(), instance, and instance_ok().
Referenced by initialize_command_input().
|
static |
Definition at line 1214 of file cmd-edit.cc.
References do_set_dequoting_function(), instance, and instance_ok().
|
inlineprotectedvirtual |
Definition at line 320 of file cmd-edit.h.
Referenced by add_event_hook().
|
static |
Definition at line 1179 of file cmd-edit.cc.
References do_set_filename_quote_characters(), instance, and instance_ok().
Referenced by initialize_command_input().
|
static |
Definition at line 958 of file cmd-edit.cc.
References initial_input, instance, and instance_ok().
Referenced by main_window::execute_command_callback().
|
static |
Definition at line 1053 of file cmd-edit.cc.
References do_set_input_stream(), instance, and instance_ok().
Referenced by get_input_from_stdin().
|
static |
Definition at line 1022 of file cmd-edit.cc.
References do_set_name(), instance, and instance_ok().
Referenced by initialize_command_input().
|
static |
Definition at line 1067 of file cmd-edit.cc.
References do_set_output_stream(), instance, and instance_ok().
|
inlineprotectedvirtual |
Definition at line 316 of file cmd-edit.h.
Referenced by add_pre_input_hook().
|
static |
Definition at line 1207 of file cmd-edit.cc.
References do_set_quoting_function(), instance, and instance_ok().
Referenced by initialize_command_input().
|
inlineprotectedvirtual |
Definition at line 312 of file cmd-edit.h.
Referenced by add_startup_hook().
|
static |
Definition at line 1228 of file cmd-edit.cc.
References do_set_user_accept_line_function(), instance, and instance_ok().
Definition at line 971 of file cmd-edit.cc.
References f, and startup_hook_set.
Referenced by add_startup_hook().
Definition at line 1095 of file cmd-edit.cc.
References do_terminal_cols(), instance, and instance_ok().
Referenced by Fterminal_size(), string_vector::list_in_columns(), more_than_a_screenful(), octave_print_internal(), and octave_print_internal_template().
Definition at line 1088 of file cmd-edit.cc.
References do_terminal_rows(), instance, and instance_ok().
Referenced by Fterminal_size(), and more_than_a_screenful().
Definition at line 1317 of file cmd-edit.cc.
References do_undo(), instance, and instance_ok().
Referenced by main_window::command_window_undo_callback().
|
protected |
Definition at line 343 of file cmd-edit.h.
Referenced by current_command_number(), do_decode_prompt_string(), increment_current_command_number(), and reset_current_command_number().
|
staticprivate |
Definition at line 200 of file cmd-edit.h.
Referenced by add_event_hook(), event_handler(), and remove_event_hook().
|
protected |
Definition at line 347 of file cmd-edit.h.
Referenced by do_insert_initial_input(), readline(), and set_initial_input().
|
staticprivate |
Definition at line 212 of file cmd-edit.h.
Referenced by accept_line(), add_event_hook(), add_pre_input_hook(), add_startup_hook(), blink_matching_paren(), clear_screen(), clear_undo_list(), current_command_number(), decode_prompt_string(), filename_completion_desired(), filename_quoting_desired(), force_default_editor(), generate_filename_completions(), get_char_is_quoted_function(), get_completion_function(), get_current_line(), get_dequoting_function(), get_input_stream(), get_line_buffer(), get_output_stream(), get_quoting_function(), get_user_accept_line_function(), increment_current_command_number(), insert_initial_input(), insert_text(), instance_ok(), interrupt(), make_command_editor(), newline(), re_read_init_file(), read_init_file(), readline(), redisplay(), remove_event_hook(), remove_pre_input_hook(), remove_startup_hook(), replace_line(), reset_current_command_number(), resize_terminal(), restore_terminal_state(), set_basic_quote_characters(), set_basic_word_break_characters(), set_char_is_quoted_function(), set_completer_quote_characters(), set_completer_word_break_characters(), set_completion_append_character(), set_completion_function(), set_dequoting_function(), set_filename_quote_characters(), set_initial_input(), set_input_stream(), set_name(), set_output_stream(), set_quoting_function(), set_user_accept_line_function(), terminal_cols(), terminal_rows(), and undo().
|
protected |
Definition at line 345 of file cmd-edit.h.
Referenced by interrupt().
|
staticprivate |
Definition at line 198 of file cmd-edit.h.
Referenced by add_pre_input_hook(), pre_input_handler(), and remove_pre_input_hook().
|
staticprivate |
Definition at line 196 of file cmd-edit.h.
Referenced by add_startup_hook(), remove_startup_hook(), and startup_handler().