annotate liboctave/util/cmd-hist.h @ 21017:93748bcaec17

maint: Replace emtpy 'std::string ()' calls with "". * Backend.cc, comment-list.h, debug.cc, defaults.in.h, dynamic-ld.h, error.cc, graphics.cc, graphics.in.h, help.cc, hook-fcn.h, load-path.cc, load-path.h, ls-ascii-helper.cc, ls-mat-ascii.cc, ls-mat5.cc, ls-mat5.h, ls-oct-text.cc, oct-iostrm.h, oct-lvalue.h, oct-stream.cc, oct-stream.h, oct-strstrm.h, regexp.cc, schur.cc, sqrtm.cc, strfns.cc, symtab.cc, symtab.h, sysdep.cc, toplev.cc, urlwrite.cc, variables.cc, variables.h, ov-builtin.h, ov-cell.cc, ov-class.cc, ov-classdef.cc, ov-classdef.h, ov-dld-fcn.h, ov-fcn-handle.cc, ov-fcn-inline.cc, ov-fcn-inline.h, ov-fcn.h, ov-lazy-idx.cc, ov-mex-fcn.h, ov-struct.cc, ov-typeinfo.cc, ov-typeinfo.h, ov-usr-fcn.cc, ov-usr-fcn.h, ov.h, ovl.h, octave.cc, lex.h, parse.h, pt-classdef.h, pt-exp.cc, pt-pr-code.h, token.h, version.cc, version.in.h, oct-rand.h, dir-ops.h, file-ops.cc, file-ops.h, file-stat.h, oct-env.cc, oct-group.cc, oct-passwd.cc, oct-syscalls.cc, cmd-edit.cc, cmd-edit.h, cmd-hist.cc, cmd-hist.h, kpse.cc, lo-array-gripes.h, pathsearch.cc, pathsearch.h, str-vec.h, url-transfer.h: Replace emtpy 'std::string ()' calls with "".
author Rik <rik@octave.org>
date Wed, 30 Dec 2015 12:33:33 -0800
parents f7084eae3318
children 1473547f50f5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
1 /*
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
2
19697
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 17996
diff changeset
3 Copyright (C) 1996-2015 John W. Eaton
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
4
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
6
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6108
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6108
diff changeset
10 option) any later version.
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
11
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
15 for more details.
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
16
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6108
diff changeset
18 along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6108
diff changeset
19 <http://www.gnu.org/licenses/>.
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
20
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
21 */
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
22
20791
f7084eae3318 maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents: 20713
diff changeset
23 #if ! defined (octave_cmd_hist_h)
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
24 #define octave_cmd_hist_h 1
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
25
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
26 #include <string>
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
27
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
28 #include "str-vec.h"
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
29
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
30 class
6108
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5307
diff changeset
31 OCTAVE_API
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
32 command_history
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
33 {
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
34 protected:
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
35
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
36 command_history (void)
11486
a1deab9a6e71 bash-like history control
Pascal Dupuis <Pascal.Dupuis@worldonline.be> and John W. Eaton <jwe@octave.org>
parents: 11368
diff changeset
37 : initialized (false), ignoring_additions (false), history_control (0),
a1deab9a6e71 bash-like history control
Pascal Dupuis <Pascal.Dupuis@worldonline.be> and John W. Eaton <jwe@octave.org>
parents: 11368
diff changeset
38 lines_in_file (0), lines_this_session (0), xfile (), xsize (-1) { }
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
39
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
40 public:
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
41
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
42 virtual ~command_history (void) { }
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
43
11486
a1deab9a6e71 bash-like history control
Pascal Dupuis <Pascal.Dupuis@worldonline.be> and John W. Eaton <jwe@octave.org>
parents: 11368
diff changeset
44 static void initialize (bool, const std::string&, int, const std::string&);
11368
944b7e20fc5a improve handling of exceptions for startup files
John W. Eaton <jwe@octave.org>
parents: 10312
diff changeset
45
944b7e20fc5a improve handling of exceptions for startup files
John W. Eaton <jwe@octave.org>
parents: 10312
diff changeset
46 static bool is_initialized (void);
944b7e20fc5a improve handling of exceptions for startup files
John W. Eaton <jwe@octave.org>
parents: 10312
diff changeset
47
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 2926
diff changeset
48 static void set_file (const std::string&);
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
49
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 2926
diff changeset
50 static std::string file (void);
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
51
11486
a1deab9a6e71 bash-like history control
Pascal Dupuis <Pascal.Dupuis@worldonline.be> and John W. Eaton <jwe@octave.org>
parents: 11368
diff changeset
52 static void process_histcontrol (const std::string&);
a1deab9a6e71 bash-like history control
Pascal Dupuis <Pascal.Dupuis@worldonline.be> and John W. Eaton <jwe@octave.org>
parents: 11368
diff changeset
53
a1deab9a6e71 bash-like history control
Pascal Dupuis <Pascal.Dupuis@worldonline.be> and John W. Eaton <jwe@octave.org>
parents: 11368
diff changeset
54 static std::string histcontrol (void);
a1deab9a6e71 bash-like history control
Pascal Dupuis <Pascal.Dupuis@worldonline.be> and John W. Eaton <jwe@octave.org>
parents: 11368
diff changeset
55
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
56 static void set_size (int);
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
57
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
58 static int size (void);
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
59
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
60 static void ignore_entries (bool = true);
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
61
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
62 static bool ignoring_entries (void);
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
63
17219
33ce8c381f2c make history widget respect history_control settings (bug #39728)
Torsten <ttl@justmail.de>
parents: 15397
diff changeset
64 static bool add (const std::string&);
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
65
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
66 static void remove (int);
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
67
15397
231d8d3b8225 provide command_hist::clear_history function
John W. Eaton <jwe@octave.org>
parents: 15271
diff changeset
68 static void clear (void);
231d8d3b8225 provide command_hist::clear_history function
John W. Eaton <jwe@octave.org>
parents: 15271
diff changeset
69
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
70 static int where (void);
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
71
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
72 static int length (void);
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
73
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
74 static int max_input_history (void);
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
75
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
76 static int base (void);
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
77
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
78 static int current_number (void);
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
79
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
80 static void stifle (int);
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
81
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
82 static int unstifle (void);
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
83
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
84 static int is_stifled (void);
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
85
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
86 static void set_mark (int n);
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
87
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
88 // Gag. This declaration has to match the Function typedef in
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
89 // readline.h.
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
90
4802
b3f20980be32 [project @ 2004-02-25 05:14:19 by jwe]
jwe
parents: 3522
diff changeset
91 static int goto_mark (void);
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
92
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
93 static void read (bool = true);
2658
dd71eb0bb414 [project @ 1997-02-03 04:49:57 by jwe]
jwe
parents: 1993
diff changeset
94
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 2926
diff changeset
95 static void read (const std::string&, bool = true);
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
96
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
97 static void read_range (int = -1, int = -1, bool = true);
2658
dd71eb0bb414 [project @ 1997-02-03 04:49:57 by jwe]
jwe
parents: 1993
diff changeset
98
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 2926
diff changeset
99 static void read_range (const std::string&, int = -1, int = -1,
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
100 bool = true);
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
101
21017
93748bcaec17 maint: Replace emtpy 'std::string ()' calls with "".
Rik <rik@octave.org>
parents: 20791
diff changeset
102 static void write (const std::string& = "");
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
103
21017
93748bcaec17 maint: Replace emtpy 'std::string ()' calls with "".
Rik <rik@octave.org>
parents: 20791
diff changeset
104 static void append (const std::string& = "");
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
105
21017
93748bcaec17 maint: Replace emtpy 'std::string ()' calls with "".
Rik <rik@octave.org>
parents: 20791
diff changeset
106 static void truncate_file (const std::string& = "", int = -1);
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
107
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
108 static string_vector list (int = -1, bool = false);
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
109
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 2926
diff changeset
110 static std::string get_entry (int);
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
111
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 2926
diff changeset
112 static void replace_entry (int, const std::string&);
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
113
21017
93748bcaec17 maint: Replace emtpy 'std::string ()' calls with "".
Rik <rik@octave.org>
parents: 20791
diff changeset
114 static void clean_up_and_save (const std::string& = "", int = -1);
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
115
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
116 private:
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
117
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
118 // No copying!
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
119
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
120 command_history (const command_history&);
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
121
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
122 command_history& operator = (const command_history&);
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
123
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
124 static bool instance_ok (void);
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
125
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
126 static void make_command_history (void);
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
127
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
128 // The real thing.
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
129 static command_history *instance;
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
130
13983
7dd7cccf0757 clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents: 12330
diff changeset
131 static void cleanup_instance (void) { delete instance; instance = 0; }
7dd7cccf0757 clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents: 12330
diff changeset
132
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
133 protected:
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
134
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
135 // To use something other than the GNU history library, derive a new
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
136 // class from command_history, overload these functions as
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
137 // necessary, and make instance point to the new class.
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
138
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 2926
diff changeset
139 virtual void do_set_file (const std::string&);
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
140
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 2926
diff changeset
141 virtual std::string do_file (void);
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
142
11486
a1deab9a6e71 bash-like history control
Pascal Dupuis <Pascal.Dupuis@worldonline.be> and John W. Eaton <jwe@octave.org>
parents: 11368
diff changeset
143 virtual void do_process_histcontrol (const std::string&);
a1deab9a6e71 bash-like history control
Pascal Dupuis <Pascal.Dupuis@worldonline.be> and John W. Eaton <jwe@octave.org>
parents: 11368
diff changeset
144
21017
93748bcaec17 maint: Replace emtpy 'std::string ()' calls with "".
Rik <rik@octave.org>
parents: 20791
diff changeset
145 virtual std::string do_histcontrol (void) const { return ""; }
11486
a1deab9a6e71 bash-like history control
Pascal Dupuis <Pascal.Dupuis@worldonline.be> and John W. Eaton <jwe@octave.org>
parents: 11368
diff changeset
146
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
147 virtual void do_initialize (bool, const std::string&, int,
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
148 const std::string&);
11368
944b7e20fc5a improve handling of exceptions for startup files
John W. Eaton <jwe@octave.org>
parents: 10312
diff changeset
149
944b7e20fc5a improve handling of exceptions for startup files
John W. Eaton <jwe@octave.org>
parents: 10312
diff changeset
150 virtual bool do_is_initialized (void) const;
944b7e20fc5a improve handling of exceptions for startup files
John W. Eaton <jwe@octave.org>
parents: 10312
diff changeset
151
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
152 virtual void do_set_size (int);
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
153
11500
7aeb4eb7403f cmd-hist.h, cmd-hist.cc: sprinkle with const
John W. Eaton <jwe@octave.org>
parents: 11486
diff changeset
154 virtual int do_size (void) const;
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
155
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
156 virtual void do_ignore_entries (bool);
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
157
11500
7aeb4eb7403f cmd-hist.h, cmd-hist.cc: sprinkle with const
John W. Eaton <jwe@octave.org>
parents: 11486
diff changeset
158 virtual bool do_ignoring_entries (void) const;
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
159
17219
33ce8c381f2c make history widget respect history_control settings (bug #39728)
Torsten <ttl@justmail.de>
parents: 15397
diff changeset
160 virtual bool do_add (const std::string&);
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
161
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
162 virtual void do_remove (int);
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
163
15397
231d8d3b8225 provide command_hist::clear_history function
John W. Eaton <jwe@octave.org>
parents: 15271
diff changeset
164 virtual void do_clear (void);
231d8d3b8225 provide command_hist::clear_history function
John W. Eaton <jwe@octave.org>
parents: 15271
diff changeset
165
11500
7aeb4eb7403f cmd-hist.h, cmd-hist.cc: sprinkle with const
John W. Eaton <jwe@octave.org>
parents: 11486
diff changeset
166 virtual int do_where (void) const;
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
167
11500
7aeb4eb7403f cmd-hist.h, cmd-hist.cc: sprinkle with const
John W. Eaton <jwe@octave.org>
parents: 11486
diff changeset
168 virtual int do_length (void) const;
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
169
11500
7aeb4eb7403f cmd-hist.h, cmd-hist.cc: sprinkle with const
John W. Eaton <jwe@octave.org>
parents: 11486
diff changeset
170 virtual int do_max_input_history (void) const;
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
171
11500
7aeb4eb7403f cmd-hist.h, cmd-hist.cc: sprinkle with const
John W. Eaton <jwe@octave.org>
parents: 11486
diff changeset
172 virtual int do_base (void) const;
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
173
11500
7aeb4eb7403f cmd-hist.h, cmd-hist.cc: sprinkle with const
John W. Eaton <jwe@octave.org>
parents: 11486
diff changeset
174 virtual int do_current_number (void) const;
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
175
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
176 virtual void do_stifle (int);
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
177
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
178 virtual int do_unstifle (void);
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
179
11500
7aeb4eb7403f cmd-hist.h, cmd-hist.cc: sprinkle with const
John W. Eaton <jwe@octave.org>
parents: 11486
diff changeset
180 virtual int do_is_stifled (void) const;
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
181
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
182 virtual void do_set_mark (int);
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
183
4802
b3f20980be32 [project @ 2004-02-25 05:14:19 by jwe]
jwe
parents: 3522
diff changeset
184 virtual int do_goto_mark (void);
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
185
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 2926
diff changeset
186 virtual void do_read (const std::string&, bool);
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
187
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 2926
diff changeset
188 virtual void do_read_range (const std::string&, int, int, bool);
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
189
11500
7aeb4eb7403f cmd-hist.h, cmd-hist.cc: sprinkle with const
John W. Eaton <jwe@octave.org>
parents: 11486
diff changeset
190 virtual void do_write (const std::string&) const;
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
191
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 2926
diff changeset
192 virtual void do_append (const std::string&);
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
193
11500
7aeb4eb7403f cmd-hist.h, cmd-hist.cc: sprinkle with const
John W. Eaton <jwe@octave.org>
parents: 11486
diff changeset
194 virtual void do_truncate_file (const std::string&, int) const;
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
195
11500
7aeb4eb7403f cmd-hist.h, cmd-hist.cc: sprinkle with const
John W. Eaton <jwe@octave.org>
parents: 11486
diff changeset
196 virtual string_vector do_list (int, bool) const;
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
197
11500
7aeb4eb7403f cmd-hist.h, cmd-hist.cc: sprinkle with const
John W. Eaton <jwe@octave.org>
parents: 11486
diff changeset
198 virtual std::string do_get_entry (int) const;
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
199
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 2926
diff changeset
200 virtual void do_replace_entry (int, const std::string&);
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
201
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 2926
diff changeset
202 virtual void do_clean_up_and_save (const std::string&, int);
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
203
17996
260b44c0ed69 improve messages when reading or writing history fails (bug #40443)
John W. Eaton <jwe@octave.org>
parents: 17769
diff changeset
204 void error (int, const std::string& msg = "") const;
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
205
11500
7aeb4eb7403f cmd-hist.h, cmd-hist.cc: sprinkle with const
John W. Eaton <jwe@octave.org>
parents: 11486
diff changeset
206 void error (const std::string&) const;
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
207
20713
2469d78a1d8b Consistently use 'filename' rather than 'file name' throughout code base.
Rik <rik@octave.org>
parents: 19697
diff changeset
208 // TRUE means we have initialized the history filename and number of
11368
944b7e20fc5a improve handling of exceptions for startup files
John W. Eaton <jwe@octave.org>
parents: 10312
diff changeset
209 // lines to save.
944b7e20fc5a improve handling of exceptions for startup files
John W. Eaton <jwe@octave.org>
parents: 10312
diff changeset
210 bool initialized;
944b7e20fc5a improve handling of exceptions for startup files
John W. Eaton <jwe@octave.org>
parents: 10312
diff changeset
211
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
212 // TRUE means we are ignoring new additions.
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
213 bool ignoring_additions;
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
214
11486
a1deab9a6e71 bash-like history control
Pascal Dupuis <Pascal.Dupuis@worldonline.be> and John W. Eaton <jwe@octave.org>
parents: 11368
diff changeset
215 // Bitmask for history control options. See oct-rl-hist.h.
a1deab9a6e71 bash-like history control
Pascal Dupuis <Pascal.Dupuis@worldonline.be> and John W. Eaton <jwe@octave.org>
parents: 11368
diff changeset
216 int history_control;
a1deab9a6e71 bash-like history control
Pascal Dupuis <Pascal.Dupuis@worldonline.be> and John W. Eaton <jwe@octave.org>
parents: 11368
diff changeset
217
a1deab9a6e71 bash-like history control
Pascal Dupuis <Pascal.Dupuis@worldonline.be> and John W. Eaton <jwe@octave.org>
parents: 11368
diff changeset
218 // The number of history lines we read from the history file.
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
219 int lines_in_file;
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
220
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
221 // The number of history lines we've saved so far.
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
222 int lines_this_session;
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
223
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
224 // The default history file.
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 2926
diff changeset
225 std::string xfile;
1797
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
226
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
227 // The number of lines of history to save.
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
228 int xsize;
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
229 };
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
230
28aefb5a7dec [project @ 1996-01-29 05:05:57 by jwe]
jwe
parents:
diff changeset
231 #endif