blob: 0bfb3caff3c17e4725b6bb0361e4591a93675a7e [file] [log] [blame]
Chris Lattner24943d22010-06-08 16:52:24 +00001//===-- CommandObjectSettings.h ---------------------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef liblldb_CommandObjectSettings_h_
11#define liblldb_CommandObjectSettings_h_
12
13// C Includes
14// C++ Includes
15// Other libraries and framework includes
16// Project includes
17#include "lldb/Interpreter/CommandObject.h"
Caroline Tice6e4c5ce2010-09-04 00:03:46 +000018#include "lldb/Interpreter/CommandObjectMultiword.h"
19#include "lldb/Interpreter/Options.h"
20
Chris Lattner24943d22010-06-08 16:52:24 +000021
22namespace lldb_private {
23
24//-------------------------------------------------------------------------
Caroline Tice6e4c5ce2010-09-04 00:03:46 +000025// CommandObjectMultiwordSettings
Chris Lattner24943d22010-06-08 16:52:24 +000026//-------------------------------------------------------------------------
27
Caroline Tice6e4c5ce2010-09-04 00:03:46 +000028class CommandObjectMultiwordSettings : public CommandObjectMultiword
Chris Lattner24943d22010-06-08 16:52:24 +000029{
30public:
31
Caroline Tice6e4c5ce2010-09-04 00:03:46 +000032 CommandObjectMultiwordSettings (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +000033
34 virtual
Caroline Tice6e4c5ce2010-09-04 00:03:46 +000035 ~CommandObjectMultiwordSettings ();
36
37};
38
39//-------------------------------------------------------------------------
40// CommandObjectSettingsSet
41//-------------------------------------------------------------------------
42
43class CommandObjectSettingsSet : public CommandObject
44{
45public:
46 CommandObjectSettingsSet ();
47
48 virtual
49 ~CommandObjectSettingsSet ();
Chris Lattner24943d22010-06-08 16:52:24 +000050
51 virtual bool
Greg Clayton63094e02010-06-23 01:19:29 +000052 Execute (CommandInterpreter &interpreter,
53 Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +000054 CommandReturnObject &result);
55
Caroline Tice6e4c5ce2010-09-04 00:03:46 +000056 virtual Options *
57 GetOptions ();
58
59 class CommandOptions : public Options
60 {
61 public:
62
63 CommandOptions ();
64
65 virtual
66 ~CommandOptions ();
67
68 virtual Error
69 SetOptionValue (int option_idx, const char *option_arg);
70
71 void
72 ResetOptionValues ();
73
74 const lldb::OptionDefinition*
75 GetDefinitions ();
76
77 // Options table: Required for subclasses of Options.
78
79 static lldb::OptionDefinition g_option_table[];
80
81 // Instance variables to hold the values for command options.
82
83 bool m_override;
84 bool m_reset;
85
86 };
87
88 virtual int
89 HandleArgumentCompletion (CommandInterpreter &interpreter,
90 Args &input,
91 int &cursor_index,
92 int &cursor_char_position,
93 OptionElementVector &opt_element_vector,
94 int match_start_point,
95 int max_return_elements,
96 bool &word_complete,
97 StringList &matches);
98
99private:
100 CommandOptions m_options;
101};
102
103//-------------------------------------------------------------------------
104// CommandObjectSettingsShow -- Show current values
105//-------------------------------------------------------------------------
106
107class CommandObjectSettingsShow : public CommandObject
108{
109public:
110 CommandObjectSettingsShow ();
111
112 virtual
113 ~CommandObjectSettingsShow ();
114
115 virtual bool
116 Execute (CommandInterpreter &interpreter,
117 Args& command,
118 CommandReturnObject &result);
119
120
121 virtual int
122 HandleArgumentCompletion (CommandInterpreter &interpreter,
123 Args &input,
124 int &cursor_index,
125 int &cursor_char_position,
126 OptionElementVector &opt_element_vector,
127 int match_start_point,
128 int max_return_elements,
129 bool &word_complete,
130 StringList &matches);
131
132private:
133};
134
135//-------------------------------------------------------------------------
136// CommandObjectSettingsList -- List settable variables
137//-------------------------------------------------------------------------
138
139class CommandObjectSettingsList : public CommandObject
140{
141public:
142 CommandObjectSettingsList ();
143
144 virtual
145 ~CommandObjectSettingsList ();
146
147 virtual bool
148 Execute (CommandInterpreter &interpreter,
149 Args& command,
150 CommandReturnObject &result);
151
152private:
153};
154
155//-------------------------------------------------------------------------
156// CommandObjectSettingsRemove
157//-------------------------------------------------------------------------
158
159class CommandObjectSettingsRemove : public CommandObject
160{
161public:
162 CommandObjectSettingsRemove ();
163
164 virtual
165 ~CommandObjectSettingsRemove ();
166
167 virtual bool
168 Execute (CommandInterpreter &interpreter,
169 Args& command,
170 CommandReturnObject &result);
171
172 virtual int
173 HandleArgumentCompletion (CommandInterpreter &interpreter,
174 Args &input,
175 int &cursor_index,
176 int &cursor_char_position,
177 OptionElementVector &opt_element_vector,
178 int match_start_point,
179 int max_return_elements,
180 bool &word_complete,
181 StringList &matches);
182
183private:
184};
185
186//-------------------------------------------------------------------------
187// CommandObjectSettingsReplace
188//-------------------------------------------------------------------------
189
190class CommandObjectSettingsReplace : public CommandObject
191{
192public:
193 CommandObjectSettingsReplace ();
194
195 virtual
196 ~CommandObjectSettingsReplace ();
197
198 virtual bool
199 Execute (CommandInterpreter &interpreter,
200 Args& command,
201 CommandReturnObject &result);
202
203 virtual int
204 HandleArgumentCompletion (CommandInterpreter &interpreter,
205 Args &input,
206 int &cursor_index,
207 int &cursor_char_position,
208 OptionElementVector &opt_element_vector,
209 int match_start_point,
210 int max_return_elements,
211 bool &word_complete,
212 StringList &matches);
213
214private:
215};
216
217//-------------------------------------------------------------------------
218// CommandObjectSettingsInsertBefore
219//-------------------------------------------------------------------------
220
221class CommandObjectSettingsInsertBefore : public CommandObject
222{
223public:
224 CommandObjectSettingsInsertBefore ();
225
226 virtual
227 ~CommandObjectSettingsInsertBefore ();
228
229 virtual bool
230 Execute (CommandInterpreter &interpreter,
231 Args& command,
232 CommandReturnObject &result);
233
234 virtual int
235 HandleArgumentCompletion (CommandInterpreter &interpreter,
236 Args &input,
237 int &cursor_index,
238 int &cursor_char_position,
239 OptionElementVector &opt_element_vector,
240 int match_start_point,
241 int max_return_elements,
242 bool &word_complete,
243 StringList &matches);
244
245private:
246};
247
248//-------------------------------------------------------------------------
249// CommandObjectSettingInsertAfter
250//-------------------------------------------------------------------------
251
252class CommandObjectSettingsInsertAfter : public CommandObject
253{
254public:
255 CommandObjectSettingsInsertAfter ();
256
257 virtual
258 ~CommandObjectSettingsInsertAfter ();
259
260 virtual bool
261 Execute (CommandInterpreter &interpreter,
262 Args& command,
263 CommandReturnObject &result);
264
265 virtual int
266 HandleArgumentCompletion (CommandInterpreter &interpreter,
267 Args &input,
268 int &cursor_index,
269 int &cursor_char_position,
270 OptionElementVector &opt_element_vector,
271 int match_start_point,
272 int max_return_elements,
273 bool &word_complete,
274 StringList &matches);
275
276private:
277};
278
279//-------------------------------------------------------------------------
280// CommandObjectSettingsAppend
281//-------------------------------------------------------------------------
282
283class CommandObjectSettingsAppend : public CommandObject
284{
285public:
286 CommandObjectSettingsAppend ();
287
288 virtual
289 ~CommandObjectSettingsAppend ();
290
291 virtual bool
292 Execute (CommandInterpreter &interpreter,
293 Args& command,
294 CommandReturnObject &result);
295
296 virtual int
297 HandleArgumentCompletion (CommandInterpreter &interpreter,
298 Args &input,
299 int &cursor_index,
300 int &cursor_char_position,
301 OptionElementVector &opt_element_vector,
302 int match_start_point,
303 int max_return_elements,
304 bool &word_complete,
305 StringList &matches);
306
307private:
308};
309
310//-------------------------------------------------------------------------
311// CommandObjectSettingsClear
312//-------------------------------------------------------------------------
313
314class CommandObjectSettingsClear : public CommandObject
315{
316public:
317 CommandObjectSettingsClear ();
318
319 virtual
320 ~CommandObjectSettingsClear ();
321
322 virtual bool
323 Execute (CommandInterpreter &interpreter,
324 Args& command,
325 CommandReturnObject &result);
326
327 virtual int
328 HandleArgumentCompletion (CommandInterpreter &interpreter,
329 Args &input,
330 int &cursor_index,
331 int &cursor_char_position,
332 OptionElementVector &opt_element_vector,
333 int match_start_point,
334 int max_return_elements,
335 bool &word_complete,
336 StringList &matches);
337
338private:
Chris Lattner24943d22010-06-08 16:52:24 +0000339};
340
341} // namespace lldb_private
342
343#endif // liblldb_CommandObjectSettings_h_