comparison liboctave/cmd-edit.h @ 3504:5eef8a2294bd

[project @ 2000-02-01 10:06:51 by jwe]
author jwe
date Tue, 01 Feb 2000 10:07:26 +0000
parents aaaa20d31a5f
children 957d7d6ab0e0
comparison
equal deleted inserted replaced
3503:d14c483b3c12 3504:5eef8a2294bd
37 37
38 public: 38 public:
39 39
40 typedef int (*fcn) (...); 40 typedef int (*fcn) (...);
41 41
42 typedef string (*completion_fcn) (const string&, int); 42 typedef std::string (*completion_fcn) (const std::string&, int);
43 43
44 virtual ~command_editor (void) { } 44 virtual ~command_editor (void) { }
45 45
46 static void set_name (const string& n); 46 static void set_name (const std::string& n);
47 47
48 static string readline (const string& prompt); 48 static std::string readline (const std::string& prompt);
49 49
50 static string readline (const string& prompt, bool& eof); 50 static std::string readline (const std::string& prompt, bool& eof);
51 51
52 static void set_input_stream (FILE *f); 52 static void set_input_stream (FILE *f);
53 53
54 static FILE *get_input_stream (void); 54 static FILE *get_input_stream (void);
55 55
63 63
64 static void clear_screen (void); 64 static void clear_screen (void);
65 65
66 static void resize_terminal (void); 66 static void resize_terminal (void);
67 67
68 static string decode_prompt_string (const string& s); 68 static std::string decode_prompt_string (const std::string& s);
69 69
70 static void restore_terminal_state (void); 70 static void restore_terminal_state (void);
71 71
72 static void blink_matching_paren (bool flag); 72 static void blink_matching_paren (bool flag);
73 73
74 static void set_basic_quote_characters (const string& s); 74 static void set_basic_quote_characters (const std::string& s);
75 75
76 static void set_completion_append_character (char c); 76 static void set_completion_append_character (char c);
77 77
78 static void set_completion_function (completion_fcn f); 78 static void set_completion_function (completion_fcn f);
79 79
80 static completion_fcn get_completion_function (void); 80 static completion_fcn get_completion_function (void);
81 81
82 static void insert_text (const string& text); 82 static void insert_text (const std::string& text);
83 83
84 static void newline (void); 84 static void newline (void);
85 85
86 static void clear_undo_list (void); 86 static void clear_undo_list (void);
87 87
91 91
92 static void set_event_hook (fcn f); 92 static void set_event_hook (fcn f);
93 93
94 static void restore_event_hook (void); 94 static void restore_event_hook (void);
95 95
96 static void read_init_file (const string& file = string ()); 96 static void read_init_file (const std::string& file = std::string ());
97 97
98 static int current_command_number (void); 98 static int current_command_number (void);
99 99
100 static void reset_current_command_number (int n); 100 static void reset_current_command_number (int n);
101 101
120 120
121 // To use something other than the GNU readline library, derive a new 121 // To use something other than the GNU readline library, derive a new
122 // class from command_editor, overload these functions as 122 // class from command_editor, overload these functions as
123 // necessary, and make instance point to the new class. 123 // necessary, and make instance point to the new class.
124 124
125 virtual void do_set_name (const string&) { } 125 virtual void do_set_name (const std::string&) { }
126 126
127 string do_readline (const string& prompt) 127 std::string do_readline (const std::string& prompt)
128 { 128 {
129 bool eof; 129 bool eof;
130 130
131 return do_readline (prompt, eof); 131 return do_readline (prompt, eof);
132 } 132 }
133 133
134 virtual string do_readline (const string&, bool&) = 0; 134 virtual std::string do_readline (const std::string&, bool&) = 0;
135 135
136 virtual void do_set_input_stream (FILE *) = 0; 136 virtual void do_set_input_stream (FILE *) = 0;
137 137
138 virtual FILE *do_get_input_stream (void) = 0; 138 virtual FILE *do_get_input_stream (void) = 0;
139 139
147 147
148 virtual void do_clear_screen (void) { } 148 virtual void do_clear_screen (void) { }
149 149
150 virtual void do_resize_terminal (void) { } 150 virtual void do_resize_terminal (void) { }
151 151
152 virtual string do_decode_prompt_string (const string&); 152 virtual std::string do_decode_prompt_string (const std::string&);
153 153
154 virtual string newline_chars (void) { return "\n"; } 154 virtual std::string newline_chars (void) { return "\n"; }
155 155
156 virtual void do_restore_terminal_state (void) { } 156 virtual void do_restore_terminal_state (void) { }
157 157
158 virtual void do_blink_matching_paren (bool) { } 158 virtual void do_blink_matching_paren (bool) { }
159 159
160 virtual void do_set_basic_quote_characters (const string&) { } 160 virtual void do_set_basic_quote_characters (const std::string&) { }
161 161
162 virtual void do_set_completion_append_character (char) { } 162 virtual void do_set_completion_append_character (char) { }
163 163
164 virtual void do_set_completion_function (completion_fcn) { } 164 virtual void do_set_completion_function (completion_fcn) { }
165 165
166 virtual completion_fcn do_get_completion_function (void) const { return 0; } 166 virtual completion_fcn do_get_completion_function (void) const { return 0; }
167 167
168 virtual void do_insert_text (const string&) = 0; 168 virtual void do_insert_text (const std::string&) = 0;
169 169
170 virtual void do_newline (void) = 0; 170 virtual void do_newline (void) = 0;
171 171
172 virtual void do_clear_undo_list (void) { } 172 virtual void do_clear_undo_list (void) { }
173 173
177 177
178 virtual void do_set_event_hook (fcn) { } 178 virtual void do_set_event_hook (fcn) { }
179 179
180 virtual void do_restore_event_hook (void) { } 180 virtual void do_restore_event_hook (void) { }
181 181
182 virtual void do_read_init_file (const string&) { } 182 virtual void do_read_init_file (const std::string&) { }
183 183
184 int read_octal (const string& s); 184 int read_octal (const std::string& s);
185 185
186 void error (int); 186 void error (int);
187 187
188 void error (const string&); 188 void error (const std::string&);
189 189
190 // The current command number. 190 // The current command number.
191 int command_number; 191 int command_number;
192 }; 192 };
193 193