#include "cmd-hist.h"
Public Member Functions | |
virtual | ~command_history (void) |
Static Public Member Functions | |
static void | add (const std::string &) |
static void | append (const std::string &=std::string()) |
static int | base (void) |
static void | clean_up_and_save (const std::string &=std::string(), int=-1) |
static int | current_number (void) |
static std::string | file (void) |
static std::string | get_entry (int) |
static int | goto_mark (void) |
static std::string | histcontrol (void) |
static void | ignore_entries (bool=true) |
static bool | ignoring_entries (void) |
static void | initialize (bool, const std::string &, int, const std::string &) |
static bool | is_initialized (void) |
static int | is_stifled (void) |
static int | length (void) |
static string_vector | list (int=-1, bool=false) |
static int | max_input_history (void) |
static void | process_histcontrol (const std::string &) |
static void | read (bool=true) |
static void | read (const std::string &, bool=true) |
static void | read_range (int=-1, int=-1, bool=true) |
static void | read_range (const std::string &, int=-1, int=-1, bool=true) |
static void | remove (int) |
static void | replace_entry (int, const std::string &) |
static void | set_file (const std::string &) |
static void | set_mark (int n) |
static void | set_size (int) |
static int | size (void) |
static void | stifle (int) |
static void | truncate_file (const std::string &=std::string(), int=-1) |
static int | unstifle (void) |
static int | where (void) |
static void | write (const std::string &=std::string()) |
Protected Member Functions | |
command_history (void) | |
virtual void | do_add (const std::string &) |
virtual void | do_append (const std::string &) |
virtual int | do_base (void) const |
virtual void | do_clean_up_and_save (const std::string &, int) |
virtual int | do_current_number (void) const |
virtual std::string | do_file (void) |
virtual std::string | do_get_entry (int) const |
virtual int | do_goto_mark (void) |
virtual std::string | do_histcontrol (void) const |
virtual void | do_ignore_entries (bool) |
virtual bool | do_ignoring_entries (void) const |
virtual void | do_initialize (bool, const std::string &, int, const std::string &) |
virtual bool | do_is_initialized (void) const |
virtual int | do_is_stifled (void) const |
virtual int | do_length (void) const |
virtual string_vector | do_list (int, bool) const |
virtual int | do_max_input_history (void) const |
virtual void | do_process_histcontrol (const std::string &) |
virtual void | do_read (const std::string &, bool) |
virtual void | do_read_range (const std::string &, int, int, bool) |
virtual void | do_remove (int) |
virtual void | do_replace_entry (int, const std::string &) |
virtual void | do_set_file (const std::string &) |
virtual void | do_set_mark (int) |
virtual void | do_set_size (int) |
virtual int | do_size (void) const |
virtual void | do_stifle (int) |
virtual void | do_truncate_file (const std::string &, int) const |
virtual int | do_unstifle (void) |
virtual int | do_where (void) const |
virtual void | do_write (const std::string &) const |
void | error (const std::string &) const |
void | error (int) const |
Protected Attributes | |
int | history_control |
bool | ignoring_additions |
bool | initialized |
int | lines_in_file |
int | lines_this_session |
std::string | xfile |
int | xsize |
Private Member Functions | |
command_history (const command_history &) | |
command_history & | operator= (const command_history &) |
Static Private Member Functions | |
static void | cleanup_instance (void) |
static bool | instance_ok (void) |
static void | make_command_history (void) |
Static Private Attributes | |
static command_history * | instance = 0 |
Definition at line 30 of file cmd-hist.h.
command_history::command_history | ( | void | ) | [inline, protected] |
Definition at line 36 of file cmd-hist.h.
Referenced by make_command_history().
virtual command_history::~command_history | ( | void | ) | [inline, virtual] |
Definition at line 42 of file cmd-hist.h.
command_history::command_history | ( | const command_history & | ) | [private] |
void command_history::add | ( | const std::string & | s | ) | [static] |
Definition at line 577 of file cmd-hist.cc.
References do_add(), instance, and instance_ok().
Referenced by edit_history_add_hist(), get_user_input(), instance_ok(), octave_gets(), and octave_history_write_timestamp().
void command_history::append | ( | const std::string & | f = std::string () |
) | [static] |
Definition at line 695 of file cmd-hist.cc.
References do_append(), instance, and instance_ok().
Referenced by do_history().
int command_history::base | ( | void | ) | [static] |
Definition at line 612 of file cmd-hist.cc.
References do_base(), instance, and instance_ok().
void command_history::clean_up_and_save | ( | const std::string & | f = std::string () , |
|
int | n = -1 | |||
) | [static] |
Definition at line 730 of file cmd-hist.cc.
References do_clean_up_and_save(), instance, and instance_ok().
Referenced by do_octave_atexit().
static void command_history::cleanup_instance | ( | void | ) | [inline, static, private] |
Definition at line 129 of file cmd-hist.h.
Referenced by instance_ok().
int command_history::current_number | ( | void | ) | [static] |
Definition at line 619 of file cmd-hist.cc.
References do_current_number(), instance, and instance_ok().
Referenced by command_editor::do_decode_prompt_string().
void command_history::do_add | ( | const std::string & | ) | [protected, virtual] |
Definition at line 801 of file cmd-hist.cc.
Referenced by add().
void command_history::do_append | ( | const std::string & | f_arg | ) | [protected, virtual] |
Definition at line 898 of file cmd-hist.cc.
References do_where(), error(), initialized, lines_this_session, and xfile.
Referenced by append().
int command_history::do_base | ( | void | ) | const [protected, virtual] |
Definition at line 829 of file cmd-hist.cc.
Referenced by base(), and do_current_number().
void command_history::do_clean_up_and_save | ( | const std::string & | f_arg, | |
int | ||||
) | [protected, virtual] |
Definition at line 953 of file cmd-hist.cc.
References error(), initialized, and xfile.
Referenced by clean_up_and_save().
int command_history::do_current_number | ( | void | ) | const [protected, virtual] |
Definition at line 835 of file cmd-hist.cc.
References do_base(), do_where(), and xsize.
Referenced by current_number().
std::string command_history::do_file | ( | void | ) | [protected, virtual] |
std::string command_history::do_get_entry | ( | int | ) | const [protected, virtual] |
Definition at line 942 of file cmd-hist.cc.
Referenced by get_entry().
int command_history::do_goto_mark | ( | void | ) | [protected, virtual] |
Definition at line 863 of file cmd-hist.cc.
Referenced by goto_mark().
virtual std::string command_history::do_histcontrol | ( | void | ) | const [inline, protected, virtual] |
Definition at line 143 of file cmd-hist.h.
Referenced by histcontrol().
void command_history::do_ignore_entries | ( | bool | flag | ) | [protected, virtual] |
Definition at line 789 of file cmd-hist.cc.
References ignoring_additions.
Referenced by ignore_entries().
bool command_history::do_ignoring_entries | ( | void | ) | const [protected, virtual] |
Definition at line 795 of file cmd-hist.cc.
References ignoring_additions.
Referenced by ignoring_entries().
void command_history::do_initialize | ( | bool | read_history_file, | |
const std::string & | f_arg, | |||
int | sz, | |||
const std::string & | control_arg | |||
) | [protected, virtual] |
Definition at line 744 of file cmd-hist.cc.
References initialized, process_histcontrol(), read(), set_file(), and set_size().
Referenced by initialize().
bool command_history::do_is_initialized | ( | void | ) | const [protected, virtual] |
int command_history::do_is_stifled | ( | void | ) | const [protected, virtual] |
Definition at line 852 of file cmd-hist.cc.
Referenced by is_stifled().
int command_history::do_length | ( | void | ) | const [protected, virtual] |
Definition at line 817 of file cmd-hist.cc.
Referenced by length().
string_vector command_history::do_list | ( | int | , | |
bool | ||||
) | const [protected, virtual] |
Definition at line 936 of file cmd-hist.cc.
Referenced by list().
int command_history::do_max_input_history | ( | void | ) | const [protected, virtual] |
Definition at line 823 of file cmd-hist.cc.
Referenced by max_input_history().
void command_history::do_process_histcontrol | ( | const std::string & | ) | [protected, virtual] |
Definition at line 737 of file cmd-hist.cc.
Referenced by process_histcontrol().
void command_history::do_read | ( | const std::string & | f, | |
bool | ||||
) | [protected, virtual] |
void command_history::do_remove | ( | int | ) | [protected, virtual] |
Definition at line 806 of file cmd-hist.cc.
Referenced by remove().
void command_history::do_replace_entry | ( | int | , | |
const std::string & | ||||
) | [protected, virtual] |
Definition at line 948 of file cmd-hist.cc.
Referenced by replace_entry().
void command_history::do_set_file | ( | const std::string & | f | ) | [protected, virtual] |
void command_history::do_set_mark | ( | int | ) | [protected, virtual] |
Definition at line 858 of file cmd-hist.cc.
Referenced by set_mark().
void command_history::do_set_size | ( | int | n | ) | [protected, virtual] |
int command_history::do_size | ( | void | ) | const [protected, virtual] |
void command_history::do_stifle | ( | int | ) | [protected, virtual] |
Definition at line 841 of file cmd-hist.cc.
Referenced by stifle().
void command_history::do_truncate_file | ( | const std::string & | f_arg, | |
int | ||||
) | const [protected, virtual] |
Definition at line 921 of file cmd-hist.cc.
References error(), initialized, and xfile.
Referenced by truncate_file().
int command_history::do_unstifle | ( | void | ) | [protected, virtual] |
Definition at line 846 of file cmd-hist.cc.
Referenced by unstifle().
int command_history::do_where | ( | void | ) | const [protected, virtual] |
Definition at line 811 of file cmd-hist.cc.
Referenced by do_append(), do_current_number(), and where().
void command_history::do_write | ( | const std::string & | f_arg | ) | const [protected, virtual] |
Definition at line 883 of file cmd-hist.cc.
References error(), initialized, and xfile.
Referenced by write().
void command_history::error | ( | int | err_num | ) | const [protected] |
Definition at line 968 of file cmd-hist.cc.
Referenced by do_append(), do_clean_up_and_save(), do_read(), do_read_range(), do_truncate_file(), and do_write().
void command_history::error | ( | const std::string & | s | ) | const [protected] |
Definition at line 974 of file cmd-hist.cc.
std::string command_history::file | ( | void | ) | [static] |
Definition at line 528 of file cmd-hist.cc.
References do_file(), instance, and instance_ok().
Referenced by DEFUN(), do_history(), read(), and read_range().
std::string command_history::get_entry | ( | int | n | ) | [static] |
Definition at line 716 of file cmd-hist.cc.
References do_get_entry(), instance, and instance_ok().
Referenced by edit_history_repl_hist().
int command_history::goto_mark | ( | void | ) | [static] |
Definition at line 654 of file cmd-hist.cc.
References do_goto_mark(), instance, and instance_ok().
std::string command_history::histcontrol | ( | void | ) | [static] |
Definition at line 542 of file cmd-hist.cc.
References do_histcontrol(), instance, and instance_ok().
Referenced by DEFUN().
void command_history::ignore_entries | ( | bool | flag = true |
) | [static] |
Definition at line 563 of file cmd-hist.cc.
References do_ignore_entries(), instance, and instance_ok().
Referenced by DEFUN(), and do_keyboard().
bool command_history::ignoring_entries | ( | void | ) | [static] |
Definition at line 570 of file cmd-hist.cc.
References do_ignoring_entries(), instance, and instance_ok().
Referenced by DEFUN(), do_keyboard(), and do_octave_atexit().
void command_history::initialize | ( | bool | read_history_file, | |
const std::string & | f_arg, | |||
int | sz, | |||
const std::string & | control_arg | |||
) | [static] |
Definition at line 500 of file cmd-hist.cc.
References do_initialize(), instance, and instance_ok().
Referenced by initialize_history().
bool command_history::instance_ok | ( | void | ) | [static, private] |
Definition at line 466 of file cmd-hist.cc.
References add(), cleanup_instance(), instance, and make_command_history().
Referenced by add(), append(), base(), clean_up_and_save(), current_number(), file(), get_entry(), goto_mark(), histcontrol(), ignore_entries(), ignoring_entries(), initialize(), is_stifled(), length(), list(), max_input_history(), process_histcontrol(), read(), read_range(), remove(), replace_entry(), set_file(), set_mark(), set_size(), size(), stifle(), truncate_file(), unstifle(), where(), and write().
bool command_history::is_initialized | ( | void | ) | [static] |
Definition at line 509 of file cmd-hist.cc.
References do_is_initialized(), and instance.
int command_history::is_stifled | ( | void | ) | [static] |
Definition at line 640 of file cmd-hist.cc.
References do_is_stifled(), instance, and instance_ok().
int command_history::length | ( | void | ) | [static] |
Definition at line 598 of file cmd-hist.cc.
References do_length(), instance, and instance_ok().
string_vector command_history::list | ( | int | limit = -1 , |
|
bool | number_lines = false | |||
) | [static] |
Definition at line 709 of file cmd-hist.cc.
References do_list(), instance, and instance_ok().
Referenced by do_history(), edit_history_repl_hist(), and mk_tmp_hist_file().
void command_history::make_command_history | ( | void | ) | [static, private] |
Definition at line 490 of file cmd-hist.cc.
References command_history(), and instance.
Referenced by instance_ok().
int command_history::max_input_history | ( | void | ) | [static] |
Definition at line 605 of file cmd-hist.cc.
References do_max_input_history(), instance, and instance_ok().
command_history& command_history::operator= | ( | const command_history & | ) | [private] |
void command_history::process_histcontrol | ( | const std::string & | control_arg | ) | [static] |
Definition at line 535 of file cmd-hist.cc.
References do_process_histcontrol(), instance, and instance_ok().
Referenced by DEFUN(), and do_initialize().
void command_history::read | ( | const std::string & | f, | |
bool | must_exist = true | |||
) | [static] |
Definition at line 667 of file cmd-hist.cc.
References do_read(), instance, and instance_ok().
void command_history::read | ( | bool | must_exist = true |
) | [static] |
Definition at line 661 of file cmd-hist.cc.
References file().
Referenced by do_history(), and do_initialize().
void command_history::read_range | ( | const std::string & | f, | |
int | from = -1 , |
|||
int | to = -1 , |
|||
bool | must_exist = true | |||
) | [static] |
Definition at line 680 of file cmd-hist.cc.
References do_read_range(), instance, and instance_ok().
void command_history::remove | ( | int | n | ) | [static] |
Definition at line 584 of file cmd-hist.cc.
References do_remove(), instance, and instance_ok().
Referenced by mk_tmp_hist_file().
void command_history::replace_entry | ( | int | which, | |
const std::string & | line | |||
) | [static] |
Definition at line 723 of file cmd-hist.cc.
References do_replace_entry(), instance, and instance_ok().
Referenced by edit_history_repl_hist().
void command_history::set_file | ( | const std::string & | f_arg | ) | [static] |
Definition at line 517 of file cmd-hist.cc.
References do_set_file(), instance, instance_ok(), and file_ops::tilde_expand().
Referenced by DEFUN(), do_history(), and do_initialize().
void command_history::set_mark | ( | int | n | ) | [static] |
Definition at line 647 of file cmd-hist.cc.
References do_set_mark(), instance, and instance_ok().
void command_history::set_size | ( | int | n | ) | [static] |
Definition at line 549 of file cmd-hist.cc.
References do_set_size(), instance, and instance_ok().
Referenced by DEFUN(), and do_initialize().
int command_history::size | ( | void | ) | [static] |
Definition at line 556 of file cmd-hist.cc.
References do_size(), instance, and instance_ok().
Referenced by DEFUN().
void command_history::stifle | ( | int | n | ) | [static] |
Definition at line 626 of file cmd-hist.cc.
References do_stifle(), instance, and instance_ok().
void command_history::truncate_file | ( | const std::string & | f = std::string () , |
|
int | n = -1 | |||
) | [static] |
Definition at line 702 of file cmd-hist.cc.
References do_truncate_file(), instance, and instance_ok().
int command_history::unstifle | ( | void | ) | [static] |
Definition at line 633 of file cmd-hist.cc.
References do_unstifle(), instance, and instance_ok().
int command_history::where | ( | void | ) | [static] |
Definition at line 591 of file cmd-hist.cc.
References do_where(), instance, and instance_ok().
void command_history::write | ( | const std::string & | f = std::string () |
) | [static] |
Definition at line 688 of file cmd-hist.cc.
References do_write(), instance, and instance_ok().
Referenced by do_history().
int command_history::history_control [protected] |
Definition at line 211 of file cmd-hist.h.
bool command_history::ignoring_additions [protected] |
Definition at line 208 of file cmd-hist.h.
Referenced by do_ignore_entries(), and do_ignoring_entries().
bool command_history::initialized [protected] |
Definition at line 205 of file cmd-hist.h.
Referenced by do_append(), do_clean_up_and_save(), do_initialize(), do_is_initialized(), do_truncate_file(), and do_write().
command_history * command_history::instance = 0 [static, private] |
Definition at line 127 of file cmd-hist.h.
Referenced by add(), append(), base(), clean_up_and_save(), current_number(), file(), get_entry(), goto_mark(), histcontrol(), ignore_entries(), ignoring_entries(), initialize(), instance_ok(), is_initialized(), is_stifled(), length(), list(), make_command_history(), max_input_history(), process_histcontrol(), read(), read_range(), remove(), replace_entry(), set_file(), set_mark(), set_size(), size(), stifle(), truncate_file(), unstifle(), where(), and write().
int command_history::lines_in_file [protected] |
Definition at line 214 of file cmd-hist.h.
int command_history::lines_this_session [protected] |
Definition at line 217 of file cmd-hist.h.
Referenced by do_append().
std::string command_history::xfile [protected] |
Definition at line 220 of file cmd-hist.h.
Referenced by do_append(), do_clean_up_and_save(), do_file(), do_set_file(), do_truncate_file(), and do_write().
int command_history::xsize [protected] |
Definition at line 223 of file cmd-hist.h.
Referenced by do_current_number(), do_set_size(), and do_size().