GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
cmd-hist.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1996-2017 John W. Eaton
4 
5 This file is part of Octave.
6 
7 Octave is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <http://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if defined (HAVE_CONFIG_H)
24 # include "config.h"
25 #endif
26 
27 #include <cstring>
28 
29 #include <fstream>
30 #include <iostream>
31 #include <sstream>
32 #include <string>
33 
34 #include "cmd-edit.h"
35 #include "cmd-hist.h"
36 #include "file-ops.h"
37 #include "lo-error.h"
38 #include "singleton-cleanup.h"
39 #include "str-vec.h"
40 
41 #if defined (USE_READLINE)
42 #include <cstdlib>
43 
44 #include "oct-rl-hist.h"
45 
46 #include "file-stat.h"
47 #endif
48 
49 namespace octave
50 {
51  command_history *command_history::instance = 0;
52 
53 #if defined (USE_READLINE)
54 
55  class
56  gnu_history : public command_history
57  {
58  public:
59 
60  gnu_history (void)
61  : command_history (), mark (0) { }
62 
63  ~gnu_history (void) { }
64 
65  void do_process_histcontrol (const std::string&);
66 
67  std::string do_histcontrol (void) const;
68 
69  bool do_add (const std::string&);
70 
71  void do_remove (int);
72 
73  void do_clear (void);
74 
75  int do_where (void) const;
76 
77  int do_length (void) const;
78 
79  int do_max_input_history (void) const;
80 
81  int do_base (void) const;
82 
83  int do_current_number (void) const;
84 
85  void do_stifle (int);
86 
87  int do_unstifle (void);
88 
89  int do_is_stifled (void) const;
90 
91  void do_set_mark (int);
92 
93  int do_goto_mark (void);
94 
95  void do_read (const std::string&, bool);
96 
97  void do_read_range (const std::string&, int, int, bool);
98 
99  void do_write (const std::string&) const;
100 
101  void do_append (const std::string&);
102 
103  void do_truncate_file (const std::string&, int) const;
104 
105  string_vector do_list (int, bool) const;
106 
107  std::string do_get_entry (int) const;
108 
109  void do_replace_entry (int, const std::string&);
110 
111  void do_clean_up_and_save (const std::string&, int);
112 
113  private:
114 
115  int mark;
116  };
117 
118  void
119  gnu_history::do_process_histcontrol (const std::string& control_arg)
120  {
121  history_control = 0;
122 
123  size_t len = control_arg.length ();
124  size_t beg = 0;
125 
126  while (beg < len)
127  {
128  if (control_arg[beg] == ':')
129  beg++;
130  else
131  {
132  size_t end = control_arg.find (":", beg);
133 
134  if (end == std::string::npos)
135  end = len;
136 
137  std::string tmp = control_arg.substr (beg, end-beg);
138 
139  if (tmp == "erasedups")
140  history_control |= HC_ERASEDUPS;
141  else if (tmp == "ignoreboth")
142  history_control |= (HC_IGNDUPS | HC_IGNSPACE);
143  else if (tmp == "ignoredups")
144  history_control |= HC_IGNDUPS;
145  else if (tmp == "ignorespace")
146  history_control |= HC_IGNSPACE;
147  else
149  ("Octave:history-control",
150  "unknown histcontrol directive %s", tmp.c_str ());
151 
152  if (end != std::string::npos)
153  beg = end + 1;
154  }
155  }
156  }
157 
159  gnu_history::do_histcontrol (void) const
160  {
161  // FIXME: instead of reconstructing this value, should we just save
162  // the string we were given when constructing the command_history object?
163 
165 
166  if (history_control & HC_IGNSPACE)
167  retval.append ("ignorespace");
168 
169  if (history_control & HC_IGNDUPS)
170  {
171  if (retval.length () > 0)
172  retval.append (":");
173 
174  retval.append ("ignoredups");
175  }
176 
177  if (history_control & HC_ERASEDUPS)
178  {
179  if (retval.length () > 0)
180  retval.append (":");
181 
182  retval.append ("erasedups");
183  }
184 
185  return retval;
186  }
187 
188  bool
189  gnu_history::do_add (const std::string& s)
190  {
191  if (! do_ignoring_entries ())
192  {
193  if (s.empty ()
194  || (s.length () == 1 && (s[0] == '\r' || s[0] == '\n')))
195  return false;
196 
197  // Strip newline before adding to list
198  std::string stmp = s;
199  int stmp_len = stmp.length ();
200  if (stmp[stmp_len - 1] == '\n')
201  stmp.resize (stmp_len - 1);
202 
203  int added = ::octave_add_history (stmp.c_str (), history_control);
204  lines_this_session += added;
205  return (added > 0) ? true : false;
206  }
207  return false;
208  }
209 
210  void
211  gnu_history::do_remove (int n)
212  {
214  }
215 
216  void
217  gnu_history::do_clear (void)
218  {
220  }
221 
222  int
223  gnu_history::do_where (void) const
224  {
226  }
227 
228  int
229  gnu_history::do_length (void) const
230  {
232  }
233 
234  int
235  gnu_history::do_max_input_history (void) const
236  {
238  }
239 
240  int
241  gnu_history::do_base (void) const
242  {
244  }
245 
246  int
247  gnu_history::do_current_number (void) const
248  {
249  return (xsize > 0) ? do_base () + do_where () : -1;
250  }
251 
252  void
253  gnu_history::do_stifle (int n)
254  {
256  }
257 
258  int
259  gnu_history::do_unstifle (void)
260  {
262  }
263 
264  int
265  gnu_history::do_is_stifled (void) const
266  {
268  }
269 
270  void
271  gnu_history::do_set_mark (int n)
272  {
273  mark = n;
274  }
275 
276  int
277  gnu_history::do_goto_mark (void)
278  {
279  if (mark)
280  {
281  char *line = ::octave_history_goto_mark (mark);
282 
283  if (line)
284  {
286 
288  }
289  }
290 
291  mark = 0;
292 
293  // FIXME: for operate_and_get_next.
295 
296  return 0;
297  }
298 
299  void
300  gnu_history::do_read (const std::string& f, bool must_exist)
301  {
302  if (! f.empty ())
303  {
304  int status = ::octave_read_history (f.c_str ());
305 
306  if (status != 0 && must_exist)
307  {
308  std::string msg = "reading file '" + f + "'";
309 
310  error (status, msg);
311  }
312  else
313  {
314  lines_in_file = do_where ();
315 
317  }
318  }
319  else
320  error ("gnu_history::read: missing filename");
321  }
322 
323  void
324  gnu_history::do_read_range (const std::string& f, int from, int to,
325  bool must_exist)
326  {
327  if (from < 0)
328  from = lines_in_file;
329 
330  if (! f.empty ())
331  {
332  int status = ::octave_read_history_range (f.c_str (), from, to);
333 
334  if (status != 0 && must_exist)
335  {
336  std::ostringstream buf;
337  buf << "reading lines " << from << " to " << to
338  << " from file '" << f << "'";
339 
340  error (status, buf.str ());
341  }
342  else
343  {
344  lines_in_file = do_where ();
345 
347  }
348  }
349  else
350  error ("gnu_history::read_range: missing filename");
351  }
352 
353  void
354  gnu_history::do_write (const std::string& f_arg) const
355  {
356  if (initialized)
357  {
358  std::string f = f_arg;
359 
360  if (f.empty ())
361  f = xfile;
362 
363  if (! f.empty ())
364  {
365  int status = ::octave_write_history (f.c_str ());
366 
367  if (status != 0)
368  {
369  std::string msg = "writing file '" + f + "'";
370 
371  error (status, msg);
372  }
373  }
374  else
375  error ("gnu_history::write: missing filename");
376  }
377  }
378 
379  void
380  gnu_history::do_append (const std::string& f_arg)
381  {
382  if (initialized)
383  {
384  if (lines_this_session)
385  {
386  if (lines_this_session < do_where ())
387  {
388  // Create file if it doesn't already exist.
389 
390  std::string f = f_arg;
391 
392  if (f.empty ())
393  f = xfile;
394 
395  if (! f.empty ())
396  {
398 
399  if (! fs)
400  {
401  std::fstream tmp (f, std::ios::out);
402  tmp.close ();
403  }
404 
405  int status
406  = ::octave_append_history (lines_this_session, f.c_str ());
407 
408  if (status != 0)
409  {
410  std::string msg = "appending to file '" + f_arg + "'";
411 
412  error (status, msg);
413  }
414  else
415  lines_in_file += lines_this_session;
416 
417  lines_this_session = 0;
418  }
419  else
420  error ("gnu_history::append: missing filename");
421  }
422  }
423  }
424  }
425 
426  void
427  gnu_history::do_truncate_file (const std::string& f_arg, int n) const
428  {
429  if (initialized)
430  {
431  std::string f = f_arg;
432 
433  if (f.empty ())
434  f = xfile;
435 
436  if (! f.empty ())
437  ::octave_history_truncate_file (f.c_str (), n);
438  else
439  error ("gnu_history::truncate_file: missing filename");
440  }
441  }
442 
444  gnu_history::do_list (int limit, bool number_lines) const
445  {
447 
448  if (limit)
449  retval = ::octave_history_list (limit, number_lines);
450 
451  return retval;
452  }
453 
455  gnu_history::do_get_entry (int n) const
456  {
458 
459  char *line = ::octave_history_get (do_base () + n);
460 
461  if (line)
462  retval = line;
463 
464  return retval;
465  }
466 
467  void
468  gnu_history::do_replace_entry (int which, const std::string& line)
469  {
470  ::octave_replace_history_entry (which, line.c_str ());
471  }
472 
473  void
474  gnu_history::do_clean_up_and_save (const std::string& f_arg, int n)
475  {
476  if (initialized)
477  {
478  std::string f = f_arg;
479 
480  if (f.empty ())
481  f = xfile;
482 
483  if (! f.empty ())
484  {
485  if (n < 0)
486  n = xsize;
487 
488  stifle (n);
489 
490  do_write (f.c_str ());
491  }
492  else
493  error ("gnu_history::clean_up_and_save: missing filename");
494  }
495  }
496 
497 #endif
498 
499  bool
501  {
502  bool retval = true;
503 
504  if (! instance)
505  {
507 
508  if (instance)
510  }
511 
512  if (! instance)
513  (*current_liboctave_error_handler)
514  ("unable to create command history object!");
515 
516  return retval;
517  }
518 
519  void
521  {
522 #if defined (USE_READLINE)
523  instance = new gnu_history ();
524 #else
525  instance = new command_history ();
526 #endif
527  }
528 
529  void
530  command_history::initialize (bool read_history_file,
531  const std::string& f_arg, int sz,
532  const std::string & control_arg)
533  {
534  if (instance_ok ())
535  instance->do_initialize (read_history_file, f_arg, sz, control_arg);
536  }
537 
538  bool
540  {
541  // We just want to check the status of an existing instance, not
542  // create one.
543  return instance && instance->do_is_initialized ();
544  }
545 
546  void
548  {
549  if (instance_ok ())
550  {
552 
553  instance->do_set_file (f);
554  }
555  }
556 
559  {
560  return (instance_ok ())
561  ? instance->do_file () : "";
562  }
563 
564  void
566  {
567  if (instance_ok ())
568  instance->do_process_histcontrol (control_arg);
569  }
570 
573  {
574  return (instance_ok ())
575  ? instance->do_histcontrol () : "";
576  }
577 
578  void
580  {
581  if (instance_ok ())
582  instance->do_set_size (n);
583  }
584 
585  int
587  {
588  return (instance_ok ())
589  ? instance->do_size () : 0;
590  }
591 
592  void
594  {
595  if (instance_ok ())
596  instance->do_ignore_entries (flag);
597  }
598 
599  bool
601  {
602  return (instance_ok ())
603  ? instance->do_ignoring_entries () : false;
604  }
605 
606  bool
608  {
609  if (instance_ok ())
610  return instance->do_add (s);
611  return false;
612  }
613 
614  void
616  {
617  if (instance_ok ())
618  instance->do_remove (n);
619  }
620 
621  void
623  {
624  if (instance_ok ())
625  instance->do_clear ();
626  }
627 
628  int
630  {
631  return (instance_ok ())
632  ? instance->do_where () : 0;
633  }
634 
635  int
637  {
638  return (instance_ok ())
639  ? instance->do_length () : 0;
640  }
641 
642  int
644  {
645  return (instance_ok ())
646  ? instance->do_max_input_history () : 0;
647  }
648 
649  int
651  {
652  return (instance_ok ())
653  ? instance->do_base () : 0;
654  }
655 
656  int
658  {
659  return (instance_ok ())
660  ? instance->do_current_number () : 0;
661  }
662 
663  void
665  {
666  if (instance_ok ())
667  instance->do_stifle (n);
668  }
669 
670  int
672  {
673  return (instance_ok ())
674  ? instance->do_unstifle () : 0;
675  }
676 
677  int
679  {
680  return (instance_ok ())
681  ? instance->do_is_stifled () : 0;
682  }
683 
684  void
686  {
687  if (instance_ok ())
688  instance->do_set_mark (n);
689  }
690 
691  int
693  {
694  return (instance_ok ())
695  ? instance->do_goto_mark () : 0;
696  }
697 
698  void
699  command_history::read (bool must_exist)
700  {
701  read (file (), must_exist);
702  }
703 
704  void
705  command_history::read (const std::string& f, bool must_exist)
706  {
707  if (instance_ok ())
708  instance->do_read (f, must_exist);
709  }
710 
711  void
712  command_history::read_range (int from, int to, bool must_exist)
713  {
714  read_range (file (), from, to, must_exist);
715  }
716 
717  void
718  command_history::read_range (const std::string& f, int from, int to,
719  bool must_exist)
720  {
721  if (instance_ok ())
722  instance->do_read_range (f, from, to, must_exist);
723  }
724 
725  void
727  {
728  if (instance_ok ())
729  instance->do_write (f);
730  }
731 
732  void
734  {
735  if (instance_ok ())
736  instance->do_append (f);
737  }
738 
739  void
741  {
742  if (instance_ok ())
743  instance->do_truncate_file (f, n);
744  }
745 
747  command_history::list (int limit, bool number_lines)
748  {
749  return (instance_ok ())
750  ? instance->do_list (limit, number_lines) : string_vector ();
751  }
752 
755  {
756  return (instance_ok ())
757  ? instance->do_get_entry (n) : "";
758  }
759 
760  void
762  {
763  if (instance_ok ())
764  instance->do_replace_entry (which, line);
765  }
766 
767  void
769  {
770  if (instance_ok ())
772  }
773 
774  void
776  { }
777 
778  void
779  command_history::do_initialize (bool read_history_file,
780  const std::string& f_arg, int sz,
781  const std::string & control_arg)
782  {
786 
787  if (read_history_file)
788  command_history::read (false);
789 
790  initialized = true;
791  }
792 
793  bool
795  {
796  return initialized;
797  }
798 
799  void
801  {
802  xfile = f;
803  }
804 
807  {
808  return xfile;
809  }
810 
811  void
813  {
814  xsize = n;
815  }
816 
817  int
819  {
820  return xsize;
821  }
822 
823  void
825  {
826  ignoring_additions = flag;
827  }
828 
829  bool
831  {
832  return ignoring_additions;
833  }
834 
835  bool
837  {
838  return false;
839  }
840 
841  void
843  { }
844 
845  void
847  { }
848 
849  int
851  {
852  return 0;
853  }
854 
855  int
857  {
858  return 0;
859  }
860 
861  int
863  {
864  return 0;
865  }
866 
867  int
869  {
870  return 0;
871  }
872 
873  int
875  {
876  return (xsize > 0) ? do_base () + do_where () : -1;
877  }
878 
879  void
881  { }
882 
883  int
885  {
886  return -1;
887  }
888 
889  int
891  {
892  return 0;
893  }
894 
895  void
897  { }
898 
899  int
901  {
902  return 0;
903  }
904 
905  void
907  {
908  if (f.empty ())
909  error ("command_history::read: missing filename");
910  }
911 
912  void
913  command_history::do_read_range (const std::string& f, int, int, bool)
914  {
915  if (f.empty ())
916  error ("command_history::read_range: missing filename");
917  }
918 
919  void
921  {
922  if (initialized)
923  {
924  std::string f = f_arg;
925 
926  if (f.empty ())
927  f = xfile;
928 
929  if (f.empty ())
930  error ("command_history::write: missing filename");
931  }
932  }
933 
934  void
936  {
937  if (initialized)
938  {
939  if (lines_this_session)
940  {
941  if (lines_this_session < do_where ())
942  {
943  // Create file if it doesn't already exist.
944 
945  std::string f = f_arg;
946 
947  if (f.empty ())
948  f = xfile;
949 
950  if (f.empty ())
951  error ("command_history::append: missing filename");
952  }
953  }
954  }
955  }
956 
957  void
959  {
960  if (initialized)
961  {
962  std::string f = f_arg;
963 
964  if (f.empty ())
965  f = xfile;
966 
967  if (f.empty ())
968  error ("command_history::truncate_file: missing filename");
969  }
970  }
971 
973  command_history::do_list (int, bool) const
974  {
975  return string_vector ();
976  }
977 
980  {
981  return "";
982  }
983 
984  void
986  { }
987 
988  void
990  {
991  if (initialized)
992  {
993  std::string f = f_arg;
994 
995  if (f.empty ())
996  f = xfile;
997 
998  if (f.empty ())
999  error ("command_history::clean_up_and_save: missing filename");
1000  }
1001  }
1002 
1003  void
1004  command_history::error (int err_num, const std::string& msg) const
1005  {
1006  if (msg.empty ())
1007  (*current_liboctave_error_handler) ("%s", std::strerror (err_num));
1008  else
1009  (*current_liboctave_error_handler) ("%s: %s", msg.c_str (),
1010  std::strerror (err_num));
1011  }
1012 
1013  void
1015  {
1016  (*current_liboctave_error_handler) ("%s", s.c_str ());
1017  }
1018 }
static void write(const std::string &="")
Definition: cmd-hist.cc:726
static std::string histcontrol(void)
Definition: cmd-hist.cc:572
static void cleanup_instance(void)
Definition: cmd-hist.h:135
static int length(void)
Definition: cmd-hist.cc:636
virtual void do_clear(void)
Definition: cmd-hist.cc:846
void octave_replace_history_entry(int, const char *)
Octave interface to the compression and uncompression libraries.
Definition: aepbalance.cc:47
static void read(bool=true)
Definition: cmd-hist.cc:699
virtual int do_unstifle(void)
Definition: cmd-hist.cc:884
static int current_number(void)
Definition: cmd-hist.cc:657
static int is_stifled(void)
Definition: cmd-hist.cc:678
virtual void do_append(const std::string &)
Definition: cmd-hist.cc:935
virtual bool do_is_initialized(void) const
Definition: cmd-hist.cc:794
static void clear(void)
Definition: cmd-hist.cc:622
void octave_stifle_history(int)
static int goto_mark(void)
Definition: cmd-hist.cc:692
virtual int do_goto_mark(void)
Definition: cmd-hist.cc:900
char * octave_history_get(int n)
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE const F77_DBLE * f
int octave_history_is_stifled(void)
static int base(void)
Definition: cmd-hist.cc:650
virtual int do_is_stifled(void) const
Definition: cmd-hist.cc:890
virtual int do_base(void) const
Definition: cmd-hist.cc:868
OCTAVE_NORETURN liboctave_error_handler current_liboctave_error_handler
Definition: lo-error.c:38
virtual void do_read_range(const std::string &, int, int, bool)
Definition: cmd-hist.cc:913
static void set_size(int)
Definition: cmd-hist.cc:579
int octave_add_history(const char *, int)
void error(const char *fmt,...)
Definition: error.cc:570
int octave_history_truncate_file(const char *, int)
static std::string get_entry(int)
Definition: cmd-hist.cc:754
int octave_max_input_history(void)
static void ignore_entries(bool=true)
Definition: cmd-hist.cc:593
int octave_append_history(int, const char *)
static bool add(const std::string &)
Definition: cmd-hist.cc:607
void error(int, const std::string &msg="") const
Definition: cmd-hist.cc:1004
void octave_remove_history(int)
static command_history * instance
Definition: cmd-hist.h:133
s
Definition: file-io.cc:2682
static bool is_initialized(void)
Definition: cmd-hist.cc:539
static void clean_up_and_save(const std::string &="", int=-1)
Definition: cmd-hist.cc:768
static int max_input_history(void)
Definition: cmd-hist.cc:643
static std::string tilde_expand(const std::string &)
Definition: file-ops.cc:301
liboctave_warning_with_id_handler current_liboctave_warning_with_id_handler
Definition: lo-error.c:50
static void make_command_history(void)
Definition: cmd-hist.cc:520
char * octave_history_goto_mark(int n)
virtual int do_where(void) const
Definition: cmd-hist.cc:850
virtual void do_replace_entry(int, const std::string &)
Definition: cmd-hist.cc:985
virtual int do_max_input_history(void) const
Definition: cmd-hist.cc:862
int octave_history_length(void)
static void truncate_file(const std::string &="", int=-1)
Definition: cmd-hist.cc:740
static void insert_text(const std::string &text)
Definition: cmd-edit.cc:1459
virtual std::string do_histcontrol(void) const
Definition: cmd-hist.h:149
static string_vector list(int=-1, bool=false)
Definition: cmd-hist.cc:747
virtual std::string do_file(void)
Definition: cmd-hist.cc:806
int octave_history_base(void)
static int unstifle(void)
Definition: cmd-hist.cc:671
static void add(fptr f)
static void remove_startup_hook(startup_hook_fcn f)
Definition: cmd-edit.cc:1504
static void clear_undo_list(void)
Definition: cmd-edit.cc:1486
virtual void do_set_mark(int)
Definition: cmd-hist.cc:896
virtual int do_size(void) const
Definition: cmd-hist.cc:818
virtual void do_remove(int)
Definition: cmd-hist.cc:842
virtual bool do_add(const std::string &)
Definition: cmd-hist.cc:836
virtual void do_process_histcontrol(const std::string &)
Definition: cmd-hist.cc:775
double tmp
Definition: data.cc:6300
octave_value retval
Definition: data.cc:6294
static void read_range(int=-1, int=-1, bool=true)
Definition: cmd-hist.cc:712
virtual int do_length(void) const
Definition: cmd-hist.cc:856
virtual void do_stifle(int)
Definition: cmd-hist.cc:880
sz
Definition: data.cc:5342
int octave_read_history(const char *)
int octave_where_history(void)
static void initialize(bool, const std::string &, int, const std::string &)
Definition: cmd-hist.cc:530
may be zero for pure relative error test tem the relative tolerance must be greater than or equal to
Definition: Quad-opts.cc:233
static void set_mark(int n)
Definition: cmd-hist.cc:685
char ** octave_history_list(int, int)
void octave_using_history(void)
virtual void do_ignore_entries(bool)
Definition: cmd-hist.cc:824
virtual bool do_ignoring_entries(void) const
Definition: cmd-hist.cc:830
int octave_read_history_range(const char *, int, int)
static void set_file(const std::string &)
Definition: cmd-hist.cc:547
static void stifle(int)
Definition: cmd-hist.cc:664
virtual void do_set_file(const std::string &)
Definition: cmd-hist.cc:800
virtual std::string do_get_entry(int) const
Definition: cmd-hist.cc:979
virtual void do_write(const std::string &) const
Definition: cmd-hist.cc:920
static int where(void)
Definition: cmd-hist.cc:629
static bool ignoring_entries(void)
Definition: cmd-hist.cc:600
octave::sys::file_stat fs(filename)
static bool instance_ok(void)
Definition: cmd-hist.cc:500
virtual void do_truncate_file(const std::string &, int) const
Definition: cmd-hist.cc:958
virtual int do_current_number(void) const
Definition: cmd-hist.cc:874
int octave_write_history(const char *)
virtual void do_clean_up_and_save(const std::string &, int)
Definition: cmd-hist.cc:989
static int size(void)
Definition: cmd-hist.cc:586
virtual string_vector do_list(int, bool) const
Definition: cmd-hist.cc:973
void octave_clear_history(void)
static void append(const std::string &="")
Definition: cmd-hist.cc:733
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
Definition: utils.cc:854
virtual void do_read(const std::string &, bool)
Definition: cmd-hist.cc:906
virtual void do_set_size(int)
Definition: cmd-hist.cc:812
static void remove(int)
Definition: cmd-hist.cc:615
static std::string file(void)
Definition: cmd-hist.cc:558
virtual void do_initialize(bool, const std::string &, int, const std::string &)
Definition: cmd-hist.cc:779
int octave_unstifle_history(void)
static void replace_entry(int, const std::string &)
Definition: cmd-hist.cc:761
static void process_histcontrol(const std::string &)
Definition: cmd-hist.cc:565