23 #if !defined (octave_cmd_hist_h)
24 #define octave_cmd_hist_h 1
37 :
initialized (false), ignoring_additions (false), history_control (0),
38 lines_in_file (0), lines_this_session (0), xfile (), xsize (-1) { }
44 static void initialize (
bool,
const std::string&,
int,
const std::string&);
46 static bool is_initialized (
void);
48 static void set_file (
const std::string&);
50 static std::string file (
void);
52 static void process_histcontrol (
const std::string&);
54 static std::string histcontrol (
void);
56 static void set_size (
int);
58 static int size (
void);
60 static void ignore_entries (
bool =
true);
62 static bool ignoring_entries (
void);
64 static bool add (
const std::string&);
66 static void remove (
int);
68 static void clear (
void);
70 static int where (
void);
74 static int max_input_history (
void);
76 static int base (
void);
78 static int current_number (
void);
80 static void stifle (
int);
82 static int unstifle (
void);
84 static int is_stifled (
void);
86 static void set_mark (
int n);
91 static int goto_mark (
void);
93 static void read (
bool =
true);
95 static void read (
const std::string&,
bool =
true);
97 static void read_range (
int = -1,
int = -1,
bool =
true);
99 static void read_range (
const std::string&,
int = -1,
int = -1,
102 static void write (
const std::string& = std::string ());
104 static void append (
const std::string& = std::string ());
106 static void truncate_file (
const std::string& = std::string (),
int = -1);
110 static std::string get_entry (
int);
112 static void replace_entry (
int,
const std::string&);
114 static void clean_up_and_save (
const std::string& = std::string (),
int = -1);
124 static bool instance_ok (
void);
126 static void make_command_history (
void);
139 virtual void do_set_file (
const std::string&);
141 virtual std::string do_file (
void);
143 virtual void do_process_histcontrol (
const std::string&);
147 virtual void do_initialize (
bool,
const std::string&,
int,
150 virtual bool do_is_initialized (
void)
const;
152 virtual void do_set_size (
int);
154 virtual int do_size (
void)
const;
156 virtual void do_ignore_entries (
bool);
158 virtual bool do_ignoring_entries (
void)
const;
160 virtual bool do_add (
const std::string&);
162 virtual void do_remove (
int);
164 virtual void do_clear (
void);
166 virtual int do_where (
void)
const;
168 virtual int do_length (
void)
const;
170 virtual int do_max_input_history (
void)
const;
172 virtual int do_base (
void)
const;
174 virtual int do_current_number (
void)
const;
176 virtual void do_stifle (
int);
178 virtual int do_unstifle (
void);
180 virtual int do_is_stifled (
void)
const;
182 virtual void do_set_mark (
int);
184 virtual int do_goto_mark (
void);
186 virtual void do_read (
const std::string&,
bool);
188 virtual void do_read_range (
const std::string&,
int,
int,
bool);
190 virtual void do_write (
const std::string&)
const;
192 virtual void do_append (
const std::string&);
194 virtual void do_truncate_file (
const std::string&,
int)
const;
198 virtual std::string do_get_entry (
int)
const;
200 virtual void do_replace_entry (
int,
const std::string&);
202 virtual void do_clean_up_and_save (
const std::string&,
int);
204 void error (
int,
const std::string& msg =
"")
const;
206 void error (
const std::string&)
const;