blob: 13b51442d0b3411275913d410423924b071095b9 [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
Caroline Tice41ae2172010-09-15 06:56:39 +0000152 virtual int
153 HandleArgumentCompletion (CommandInterpreter &interpreter,
154 Args &input,
155 int &cursor_index,
156 int &cursor_char_position,
157 OptionElementVector &opt_element_vector,
158 int match_start_point,
159 int max_return_elements,
160 bool &word_complete,
161 StringList &matches);
162
Caroline Tice6e4c5ce2010-09-04 00:03:46 +0000163private:
164};
165
166//-------------------------------------------------------------------------
167// CommandObjectSettingsRemove
168//-------------------------------------------------------------------------
169
170class CommandObjectSettingsRemove : public CommandObject
171{
172public:
173 CommandObjectSettingsRemove ();
174
175 virtual
176 ~CommandObjectSettingsRemove ();
177
178 virtual bool
179 Execute (CommandInterpreter &interpreter,
180 Args& command,
181 CommandReturnObject &result);
182
183 virtual int
184 HandleArgumentCompletion (CommandInterpreter &interpreter,
185 Args &input,
186 int &cursor_index,
187 int &cursor_char_position,
188 OptionElementVector &opt_element_vector,
189 int match_start_point,
190 int max_return_elements,
191 bool &word_complete,
192 StringList &matches);
193
194private:
195};
196
197//-------------------------------------------------------------------------
198// CommandObjectSettingsReplace
199//-------------------------------------------------------------------------
200
201class CommandObjectSettingsReplace : public CommandObject
202{
203public:
204 CommandObjectSettingsReplace ();
205
206 virtual
207 ~CommandObjectSettingsReplace ();
208
209 virtual bool
210 Execute (CommandInterpreter &interpreter,
211 Args& command,
212 CommandReturnObject &result);
213
214 virtual int
215 HandleArgumentCompletion (CommandInterpreter &interpreter,
216 Args &input,
217 int &cursor_index,
218 int &cursor_char_position,
219 OptionElementVector &opt_element_vector,
220 int match_start_point,
221 int max_return_elements,
222 bool &word_complete,
223 StringList &matches);
224
225private:
226};
227
228//-------------------------------------------------------------------------
229// CommandObjectSettingsInsertBefore
230//-------------------------------------------------------------------------
231
232class CommandObjectSettingsInsertBefore : public CommandObject
233{
234public:
235 CommandObjectSettingsInsertBefore ();
236
237 virtual
238 ~CommandObjectSettingsInsertBefore ();
239
240 virtual bool
241 Execute (CommandInterpreter &interpreter,
242 Args& command,
243 CommandReturnObject &result);
244
245 virtual int
246 HandleArgumentCompletion (CommandInterpreter &interpreter,
247 Args &input,
248 int &cursor_index,
249 int &cursor_char_position,
250 OptionElementVector &opt_element_vector,
251 int match_start_point,
252 int max_return_elements,
253 bool &word_complete,
254 StringList &matches);
255
256private:
257};
258
259//-------------------------------------------------------------------------
260// CommandObjectSettingInsertAfter
261//-------------------------------------------------------------------------
262
263class CommandObjectSettingsInsertAfter : public CommandObject
264{
265public:
266 CommandObjectSettingsInsertAfter ();
267
268 virtual
269 ~CommandObjectSettingsInsertAfter ();
270
271 virtual bool
272 Execute (CommandInterpreter &interpreter,
273 Args& command,
274 CommandReturnObject &result);
275
276 virtual int
277 HandleArgumentCompletion (CommandInterpreter &interpreter,
278 Args &input,
279 int &cursor_index,
280 int &cursor_char_position,
281 OptionElementVector &opt_element_vector,
282 int match_start_point,
283 int max_return_elements,
284 bool &word_complete,
285 StringList &matches);
286
287private:
288};
289
290//-------------------------------------------------------------------------
291// CommandObjectSettingsAppend
292//-------------------------------------------------------------------------
293
294class CommandObjectSettingsAppend : public CommandObject
295{
296public:
297 CommandObjectSettingsAppend ();
298
299 virtual
300 ~CommandObjectSettingsAppend ();
301
302 virtual bool
303 Execute (CommandInterpreter &interpreter,
304 Args& command,
305 CommandReturnObject &result);
306
307 virtual int
308 HandleArgumentCompletion (CommandInterpreter &interpreter,
309 Args &input,
310 int &cursor_index,
311 int &cursor_char_position,
312 OptionElementVector &opt_element_vector,
313 int match_start_point,
314 int max_return_elements,
315 bool &word_complete,
316 StringList &matches);
317
318private:
319};
320
321//-------------------------------------------------------------------------
322// CommandObjectSettingsClear
323//-------------------------------------------------------------------------
324
325class CommandObjectSettingsClear : public CommandObject
326{
327public:
328 CommandObjectSettingsClear ();
329
330 virtual
331 ~CommandObjectSettingsClear ();
332
333 virtual bool
334 Execute (CommandInterpreter &interpreter,
335 Args& command,
336 CommandReturnObject &result);
337
338 virtual int
339 HandleArgumentCompletion (CommandInterpreter &interpreter,
340 Args &input,
341 int &cursor_index,
342 int &cursor_char_position,
343 OptionElementVector &opt_element_vector,
344 int match_start_point,
345 int max_return_elements,
346 bool &word_complete,
347 StringList &matches);
348
349private:
Chris Lattner24943d22010-06-08 16:52:24 +0000350};
351
352} // namespace lldb_private
353
354#endif // liblldb_CommandObjectSettings_h_