GNU Octave
4.0.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.
typedef int(* command_editor::event_hook_fcn)(void) |
Definition at line 48 of file cmd-edit.h.
|
private |
Definition at line 217 of file cmd-edit.h.
|
private |
Definition at line 216 of file cmd-edit.h.
typedef int(* command_editor::pre_input_hook_fcn)(void) |
Definition at line 46 of file cmd-edit.h.
|
private |
Definition at line 214 of file cmd-edit.h.
|
private |
Definition at line 213 of file cmd-edit.h.
Definition at line 52 of file cmd-edit.h.
typedef int(* command_editor::startup_hook_fcn)(void) |
Definition at line 44 of file cmd-edit.h.
|
private |
Definition at line 211 of file cmd-edit.h.
|
private |
Definition at line 210 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 |
|
static |
Definition at line 1368 of file cmd-edit.cc.
References do_accept_line(), instance, and instance_ok().
Referenced by octave_cmd_exec::execute().
|
static |
Definition at line 1440 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 1414 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 1388 of file cmd-edit.cc.
References instance, instance_ok(), set_startup_hook(), startup_handler(), and startup_hook_set.
|
static |
Definition at line 1196 of file cmd-edit.cc.
References do_blink_matching_paren(), instance, and instance_ok().
Referenced by octave_execute_interpreter().
|
inlinestaticprivate |
Definition at line 222 of file cmd-edit.h.
Referenced by instance_ok().
|
static |
Definition at line 1140 of file cmd-edit.cc.
References do_clear_screen(), instance, and instance_ok().
Referenced by main_window::clear_command_window_callback(), and Fclc().
|
static |
Definition at line 1381 of file cmd-edit.cc.
References do_clear_undo_list(), instance, and instance_ok().
|
static |
Definition at line 1168 of file cmd-edit.cc.
References command_number, instance, and instance_ok().
|
static |
Definition at line 1161 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().
|
protectedpure virtual |
Implemented in default_command_editor.
Referenced by accept_line().
|
inlineprotectedvirtual |
Definition at line 267 of file cmd-edit.h.
Referenced by blink_matching_paren().
|
inlineprotectedvirtual |
Definition at line 255 of file cmd-edit.h.
Referenced by clear_screen().
|
inlineprotectedvirtual |
Definition at line 324 of file cmd-edit.h.
Referenced by clear_undo_list().
|
protectedvirtual |
Definition at line 1561 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 269 of file cmd-edit.h.
Referenced by erase_empty_line().
Definition at line 342 of file cmd-edit.h.
Referenced by filename_completion_desired().
Definition at line 344 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 299 of file cmd-edit.h.
Referenced by get_char_is_quoted_function().
|
inlineprotectedvirtual |
Definition at line 293 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 297 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 295 of file cmd-edit.h.
Referenced by get_quoting_function().
|
inlineprotectedvirtual |
Definition at line 302 of file cmd-edit.h.
Referenced by get_user_accept_line_function().
|
protected |
Definition at line 1801 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().
|
inlineprotectedvirtual |
Definition at line 348 of file cmd-edit.h.
Referenced by interrupt().
|
protectedpure virtual |
Implemented in default_command_editor.
Referenced by kill_full_line().
|
protectedpure virtual |
Implemented in default_command_editor.
Referenced by newline().
Definition at line 346 of file cmd-edit.h.
Referenced by prefer_env_winsize().
|
inlineprotectedvirtual |
Definition at line 340 of file cmd-edit.h.
Referenced by re_read_init_file().
|
inlineprotectedvirtual |
Definition at line 338 of file cmd-edit.h.
Referenced by read_init_file().
|
inlineprotected |
Definition at line 232 of file cmd-edit.h.
Referenced by readline().
|
protectedpure virtual |
Implemented in default_command_editor.
|
inlineprotectedvirtual |
Definition at line 249 of file cmd-edit.h.
Referenced by do_insert_initial_input(), and redisplay().
|
protectedpure virtual |
Implemented in default_command_editor.
Referenced by replace_line().
|
inlineprotectedvirtual |
Definition at line 257 of file cmd-edit.h.
Referenced by resize_terminal().
|
inlineprotectedvirtual |
Definition at line 265 of file cmd-edit.h.
Referenced by restore_terminal_state().
|
inlineprotectedvirtual |
Definition at line 275 of file cmd-edit.h.
Referenced by set_basic_quote_characters().
|
inlineprotectedvirtual |
Definition at line 271 of file cmd-edit.h.
Referenced by set_basic_word_break_characters().
|
inlineprotectedvirtual |
Definition at line 289 of file cmd-edit.h.
Referenced by set_char_is_quoted_function().
|
inlineprotectedvirtual |
Definition at line 279 of file cmd-edit.h.
Referenced by set_completer_quote_characters().
|
inlineprotectedvirtual |
Definition at line 273 of file cmd-edit.h.
Referenced by set_completer_word_break_characters().
|
inlineprotectedvirtual |
Definition at line 281 of file cmd-edit.h.
Referenced by set_completion_append_character().
|
inlineprotectedvirtual |
Definition at line 283 of file cmd-edit.h.
Referenced by set_completion_function().
|
inlineprotectedvirtual |
Definition at line 287 of file cmd-edit.h.
Referenced by set_dequoting_function().
|
inlineprotectedvirtual |
Definition at line 277 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 230 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 285 of file cmd-edit.h.
Referenced by set_quoting_function().
Definition at line 259 of file cmd-edit.h.
Referenced by set_screen_size().
|
inlineprotectedvirtual |
Definition at line 291 of file cmd-edit.h.
Referenced by set_user_accept_line_function().
|
inlineprotectedvirtual |
Definition at line 253 of file cmd-edit.h.
Referenced by terminal_cols().
|
inlineprotectedvirtual |
Definition at line 251 of file cmd-edit.h.
Referenced by terminal_rows().
|
inlineprotectedvirtual |
Definition at line 322 of file cmd-edit.h.
Referenced by undo().
Definition at line 1203 of file cmd-edit.cc.
References do_erase_empty_line(), instance, and instance_ok().
Referenced by get_debug_input().
|
protected |
Definition at line 1841 of file cmd-edit.cc.
References current_liboctave_error_handler.
|
protected |
Definition at line 1847 of file cmd-edit.cc.
References current_liboctave_error_handler.
|
staticprivate |
Definition at line 1039 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 1494 of file cmd-edit.cc.
References do_filename_completion_desired(), instance, and instance_ok().
Definition at line 1501 of file cmd-edit.cc.
References do_filename_quoting_desired(), instance, and instance_ok().
|
static |
Definition at line 989 of file cmd-edit.cc.
References instance.
Referenced by octave_initialize_interpreter().
|
static |
Definition at line 1321 of file cmd-edit.cc.
References do_generate_filename_completions(), instance, and instance_ok().
Referenced by generate_completion().
|
static |
Definition at line 1307 of file cmd-edit.cc.
References do_get_char_is_quoted_function(), instance, and instance_ok().
|
static |
Definition at line 1286 of file cmd-edit.cc.
References do_get_completion_function(), instance, and instance_ok().
|
static |
Definition at line 1334 of file cmd-edit.cc.
References do_get_current_line(), instance, and instance_ok().
Referenced by octave_cmd_exec::execute(), and octave_cmd_eval::execute().
|
static |
Definition at line 1300 of file cmd-edit.cc.
References do_get_dequoting_function(), instance, and instance_ok().
|
static |
Definition at line 1098 of file cmd-edit.cc.
References do_get_input_stream(), instance, and instance_ok().
Referenced by get_input_from_stdin(), and parse_fcn_file().
|
static |
Definition at line 1328 of file cmd-edit.cc.
References do_get_line_buffer(), instance, and instance_ok().
Referenced by is_completing_dirfns().
|
static |
Definition at line 1112 of file cmd-edit.cc.
References do_get_output_stream(), instance, and instance_ok().
|
static |
Definition at line 1293 of file cmd-edit.cc.
References do_get_quoting_function(), instance, and instance_ok().
|
static |
Definition at line 1314 of file cmd-edit.cc.
References do_get_user_accept_line_function(), instance, and instance_ok().
|
static |
Definition at line 1182 of file cmd-edit.cc.
References command_number, instance, and instance_ok().
Referenced by main_loop().
|
static |
Definition at line 1003 of file cmd-edit.cc.
References do_insert_initial_input(), instance, and instance_ok().
Referenced by readline().
|
static |
Definition at line 1354 of file cmd-edit.cc.
References do_insert_text(), instance, and instance_ok().
|
staticprivate |
Definition at line 955 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(), erase_empty_line(), 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(), kill_full_line(), newline(), prefer_env_winsize(), 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_screen_size(), set_user_accept_line_function(), terminal_cols(), terminal_rows(), and undo().
Definition at line 1515 of file cmd-edit.cc.
References arg(), do_interrupt(), instance, instance_ok(), and interrupted.
Referenced by octave_cmd_eval::execute(), main_window::execute_debug_callback(), and get_debug_input().
|
static |
Definition at line 1347 of file cmd-edit.cc.
References do_kill_full_line(), instance, and instance_ok().
Referenced by main_window::clear_command_window_callback().
|
staticprivate |
Definition at line 979 of file cmd-edit.cc.
References gnu_readline(), and instance.
Referenced by instance_ok().
|
static |
Definition at line 1361 of file cmd-edit.cc.
References do_newline(), instance, and instance_ok().
|
inlineprotectedvirtual |
Definition at line 263 of file cmd-edit.h.
Referenced by do_decode_prompt_string().
|
private |
|
staticprivate |
Definition at line 1024 of file cmd-edit.cc.
References f, and pre_input_hook_set.
Referenced by add_pre_input_hook().
Definition at line 1508 of file cmd-edit.cc.
References do_prefer_env_winsize(), instance, and instance_ok().
|
static |
Definition at line 1487 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 1476 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 1819 of file cmd-edit.cc.
Referenced by do_decode_prompt_string().
|
static |
Definition at line 1067 of file cmd-edit.cc.
Referenced by gnu_readline().
|
static |
Definition at line 1075 of file cmd-edit.cc.
References add_pre_input_hook(), do_readline(), initial_input, insert_initial_input(), instance, and instance_ok().
|
static |
Definition at line 1119 of file cmd-edit.cc.
References do_redisplay(), instance, and instance_ok().
Referenced by main_window::command_window_undo_callback(), octave_cmd_exec::execute(), and octave_cmd_eval::execute().
|
static |
Definition at line 1453 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 1425 of file cmd-edit.cc.
References instance, instance_ok(), pre_input_hook_set, and restore_pre_input_hook().
|
static |
Definition at line 1399 of file cmd-edit.cc.
References instance, instance_ok(), restore_startup_hook(), and startup_hook_set.
|
static |
Definition at line 1340 of file cmd-edit.cc.
References do_replace_line(), instance, and instance_ok().
Referenced by octave_cmd_exec::execute(), and octave_cmd_eval::execute().
|
static |
Definition at line 1175 of file cmd-edit.cc.
References command_number, instance, and instance_ok().
Referenced by octave_execute_interpreter().
|
static |
Definition at line 1147 of file cmd-edit.cc.
References do_resize_terminal(), instance, and instance_ok().
Referenced by main_window::resize_command_window_callback().
|
inlineprotectedvirtual |
Definition at line 336 of file cmd-edit.h.
Referenced by remove_event_hook().
|
inlineprotectedvirtual |
Definition at line 332 of file cmd-edit.h.
Referenced by remove_pre_input_hook().
|
inlineprotectedvirtual |
Definition at line 328 of file cmd-edit.h.
Referenced by remove_startup_hook().
|
static |
Definition at line 1189 of file cmd-edit.cc.
References do_restore_terminal_state(), instance, and instance_ok().
Referenced by do_octave_atexit().
|
static |
|
static |
Definition at line 1223 of file cmd-edit.cc.
References do_set_basic_quote_characters(), instance, and instance_ok().
Referenced by initialize_command_input().
|
static |
Definition at line 1209 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 1272 of file cmd-edit.cc.
References do_set_char_is_quoted_function(), instance, and instance_ok().
|
static |
Definition at line 1237 of file cmd-edit.cc.
References do_set_completer_quote_characters(), instance, and instance_ok().
Referenced by initialize_command_input().
|
static |
Definition at line 1216 of file cmd-edit.cc.
References do_set_completer_word_break_characters(), instance, and instance_ok().
Referenced by initialize_command_input().
|
static |
Definition at line 1244 of file cmd-edit.cc.
References do_set_completion_append_character(), instance, and instance_ok().
Referenced by generate_completion().
|
static |
Definition at line 1251 of file cmd-edit.cc.
References do_set_completion_function(), instance, and instance_ok().
Referenced by initialize_command_input().
|
static |
Definition at line 1265 of file cmd-edit.cc.
References do_set_dequoting_function(), instance, and instance_ok().
|
inlineprotectedvirtual |
Definition at line 334 of file cmd-edit.h.
Referenced by add_event_hook().
|
static |
Definition at line 1230 of file cmd-edit.cc.
References do_set_filename_quote_characters(), instance, and instance_ok().
Referenced by initialize_command_input().
|
static |
Definition at line 996 of file cmd-edit.cc.
References initial_input, instance, and instance_ok().
Referenced by octave_cmd_exec::execute(), and octave_cmd_eval::execute().
|
static |
Definition at line 1091 of file cmd-edit.cc.
References do_set_input_stream(), instance, and instance_ok().
Referenced by get_input_from_stdin(), and parse_fcn_file().
|
static |
Definition at line 1060 of file cmd-edit.cc.
References do_set_name(), instance, and instance_ok().
Referenced by initialize_command_input().
|
static |
Definition at line 1105 of file cmd-edit.cc.
References do_set_output_stream(), instance, and instance_ok().
|
inlineprotectedvirtual |
Definition at line 330 of file cmd-edit.h.
Referenced by add_pre_input_hook().
|
static |
Definition at line 1258 of file cmd-edit.cc.
References do_set_quoting_function(), instance, and instance_ok().
Referenced by initialize_command_input().
Definition at line 1154 of file cmd-edit.cc.
References do_set_screen_size(), instance, and instance_ok().
Referenced by main_window::set_screen_size_callback().
|
inlineprotectedvirtual |
Definition at line 326 of file cmd-edit.h.
Referenced by add_startup_hook().
|
static |
Definition at line 1279 of file cmd-edit.cc.
References do_set_user_accept_line_function(), instance, and instance_ok().
|
staticprivate |
Definition at line 1009 of file cmd-edit.cc.
References f, and startup_hook_set.
Referenced by add_startup_hook().
|
static |
Definition at line 1133 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().
|
static |
Definition at line 1126 of file cmd-edit.cc.
References do_terminal_rows(), instance, and instance_ok().
Referenced by Fterminal_size(), and more_than_a_screenful().
|
static |
Definition at line 1375 of file cmd-edit.cc.
References do_undo(), instance, and instance_ok().
Referenced by main_window::command_window_undo_callback().
|
protected |
Definition at line 359 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 208 of file cmd-edit.h.
Referenced by add_event_hook(), event_handler(), and remove_event_hook().
|
protected |
Definition at line 363 of file cmd-edit.h.
Referenced by do_insert_initial_input(), readline(), and set_initial_input().
|
staticprivate |
Definition at line 220 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(), erase_empty_line(), 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(), kill_full_line(), make_command_editor(), newline(), prefer_env_winsize(), 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_screen_size(), set_user_accept_line_function(), terminal_cols(), terminal_rows(), and undo().
|
protected |
Definition at line 361 of file cmd-edit.h.
Referenced by interrupt().
|
staticprivate |
Definition at line 206 of file cmd-edit.h.
Referenced by add_pre_input_hook(), pre_input_handler(), and remove_pre_input_hook().
|
staticprivate |
Definition at line 204 of file cmd-edit.h.
Referenced by add_startup_hook(), remove_startup_hook(), and startup_handler().