26 #if ! defined (octave_cmd_hist_h)
27 #define octave_cmd_hist_h 1
29 #include "octave-config.h"
44 : m_initialized (false), m_ignoring_additions (false),
45 m_history_control (0), m_lines_in_file (0),
46 m_lines_this_session (0), m_file (), m_size (-1)
55 static
void initialize (
bool, const std::
string&,
int, const std::
string&);
57 static
bool is_initialized ();
59 static
void set_file (const std::
string&);
61 static std::
string file ();
63 static
void process_histcontrol (const std::
string&);
65 static std::
string histcontrol ();
67 static
void set_size (
int);
71 static
void ignore_entries (
bool = true);
73 static
bool ignoring_entries ();
75 static
bool add (const std::
string&);
77 static
void remove (
int);
85 static
int max_input_history ();
89 static
int current_number ();
91 static
void stifle (
int);
93 static
int unstifle ();
95 static
int is_stifled ();
97 static
void set_mark (
int n);
102 static
int goto_mark ();
104 static
void read (
bool = true);
106 static
void read (const std::
string&,
bool = true);
108 static
void read_range (
int = -1,
int = -1,
bool = true);
110 static
void read_range (const std::
string&,
int = -1,
int = -1,
113 static
void write (const std::
string& = "");
115 static
void append (const std::
string& = "");
117 static
void truncate_file (const std::
string& = "",
int = -1);
121 static std::
string get_entry (
int);
123 static
void replace_entry (
int, const std::
string&);
125 static
void clean_up_and_save (const std::
string& = "",
int = -1);
129 static
bool instance_ok ();
131 static
void make_command_history ();
136 static
void cleanup_instance ()
139 s_instance =
nullptr;
148 virtual void do_set_file (
const std::string&);
150 virtual std::string do_file ();
152 virtual void do_process_histcontrol (
const std::string&);
156 virtual void do_initialize (
bool,
const std::string&,
int,
159 virtual bool do_is_initialized ()
const;
161 virtual void do_set_size (
int);
163 virtual int do_size ()
const;
165 virtual void do_ignore_entries (
bool);
167 virtual bool do_ignoring_entries ()
const;
169 virtual bool do_add (
const std::string&);
171 virtual void do_remove (
int);
173 virtual void do_clear ();
175 virtual int do_where ()
const;
177 virtual int do_length ()
const;
179 virtual int do_max_input_history ()
const;
181 virtual int do_base ()
const;
183 virtual int do_current_number ()
const;
185 virtual void do_stifle (
int);
187 virtual int do_unstifle ();
189 virtual int do_is_stifled ()
const;
191 virtual void do_set_mark (
int);
193 virtual int do_goto_mark ();
195 virtual void do_read (
const std::string&,
bool);
197 virtual void do_read_range (
const std::string&,
int,
int,
bool);
199 virtual void do_write (
const std::string&)
const;
201 virtual void do_append (
const std::string&);
203 virtual void do_truncate_file (
const std::string&,
int)
const;
207 virtual std::string do_get_entry (
int)
const;
209 virtual void do_replace_entry (
int,
const std::string&);
211 virtual void do_clean_up_and_save (
const std::string&,
int);
213 void error (
int,
const std::string& msg =
"")
const;
215 void error (
const std::string&)
const;
240 OCTAVE_END_NAMESPACE(
octave)
bool m_ignoring_additions
virtual std::string do_histcontrol() const
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
void() error(const char *fmt,...)