Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 1 | //===-- 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 Tice | 6e4c5ce | 2010-09-04 00:03:46 +0000 | [diff] [blame] | 18 | #include "lldb/Interpreter/CommandObjectMultiword.h" |
| 19 | #include "lldb/Interpreter/Options.h" |
| 20 | |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 21 | |
| 22 | namespace lldb_private { |
| 23 | |
| 24 | //------------------------------------------------------------------------- |
Caroline Tice | 6e4c5ce | 2010-09-04 00:03:46 +0000 | [diff] [blame] | 25 | // CommandObjectMultiwordSettings |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 26 | //------------------------------------------------------------------------- |
| 27 | |
Caroline Tice | 6e4c5ce | 2010-09-04 00:03:46 +0000 | [diff] [blame] | 28 | class CommandObjectMultiwordSettings : public CommandObjectMultiword |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 29 | { |
| 30 | public: |
| 31 | |
Caroline Tice | 6e4c5ce | 2010-09-04 00:03:46 +0000 | [diff] [blame] | 32 | CommandObjectMultiwordSettings (CommandInterpreter &interpreter); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 33 | |
| 34 | virtual |
Caroline Tice | 6e4c5ce | 2010-09-04 00:03:46 +0000 | [diff] [blame] | 35 | ~CommandObjectMultiwordSettings (); |
| 36 | |
| 37 | }; |
| 38 | |
| 39 | //------------------------------------------------------------------------- |
| 40 | // CommandObjectSettingsSet |
| 41 | //------------------------------------------------------------------------- |
| 42 | |
| 43 | class CommandObjectSettingsSet : public CommandObject |
| 44 | { |
| 45 | public: |
| 46 | CommandObjectSettingsSet (); |
| 47 | |
| 48 | virtual |
| 49 | ~CommandObjectSettingsSet (); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 50 | |
| 51 | virtual bool |
Greg Clayton | 63094e0 | 2010-06-23 01:19:29 +0000 | [diff] [blame] | 52 | Execute (CommandInterpreter &interpreter, |
| 53 | Args& command, |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 54 | CommandReturnObject &result); |
| 55 | |
Caroline Tice | 6e4c5ce | 2010-09-04 00:03:46 +0000 | [diff] [blame] | 56 | 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 | |
| 99 | private: |
| 100 | CommandOptions m_options; |
| 101 | }; |
| 102 | |
| 103 | //------------------------------------------------------------------------- |
| 104 | // CommandObjectSettingsShow -- Show current values |
| 105 | //------------------------------------------------------------------------- |
| 106 | |
| 107 | class CommandObjectSettingsShow : public CommandObject |
| 108 | { |
| 109 | public: |
| 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 | |
| 132 | private: |
| 133 | }; |
| 134 | |
| 135 | //------------------------------------------------------------------------- |
| 136 | // CommandObjectSettingsList -- List settable variables |
| 137 | //------------------------------------------------------------------------- |
| 138 | |
| 139 | class CommandObjectSettingsList : public CommandObject |
| 140 | { |
| 141 | public: |
| 142 | CommandObjectSettingsList (); |
| 143 | |
| 144 | virtual |
| 145 | ~CommandObjectSettingsList (); |
| 146 | |
| 147 | virtual bool |
| 148 | Execute (CommandInterpreter &interpreter, |
| 149 | Args& command, |
| 150 | CommandReturnObject &result); |
| 151 | |
| 152 | private: |
| 153 | }; |
| 154 | |
| 155 | //------------------------------------------------------------------------- |
| 156 | // CommandObjectSettingsRemove |
| 157 | //------------------------------------------------------------------------- |
| 158 | |
| 159 | class CommandObjectSettingsRemove : public CommandObject |
| 160 | { |
| 161 | public: |
| 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 | |
| 183 | private: |
| 184 | }; |
| 185 | |
| 186 | //------------------------------------------------------------------------- |
| 187 | // CommandObjectSettingsReplace |
| 188 | //------------------------------------------------------------------------- |
| 189 | |
| 190 | class CommandObjectSettingsReplace : public CommandObject |
| 191 | { |
| 192 | public: |
| 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 | |
| 214 | private: |
| 215 | }; |
| 216 | |
| 217 | //------------------------------------------------------------------------- |
| 218 | // CommandObjectSettingsInsertBefore |
| 219 | //------------------------------------------------------------------------- |
| 220 | |
| 221 | class CommandObjectSettingsInsertBefore : public CommandObject |
| 222 | { |
| 223 | public: |
| 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 | |
| 245 | private: |
| 246 | }; |
| 247 | |
| 248 | //------------------------------------------------------------------------- |
| 249 | // CommandObjectSettingInsertAfter |
| 250 | //------------------------------------------------------------------------- |
| 251 | |
| 252 | class CommandObjectSettingsInsertAfter : public CommandObject |
| 253 | { |
| 254 | public: |
| 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 | |
| 276 | private: |
| 277 | }; |
| 278 | |
| 279 | //------------------------------------------------------------------------- |
| 280 | // CommandObjectSettingsAppend |
| 281 | //------------------------------------------------------------------------- |
| 282 | |
| 283 | class CommandObjectSettingsAppend : public CommandObject |
| 284 | { |
| 285 | public: |
| 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 | |
| 307 | private: |
| 308 | }; |
| 309 | |
| 310 | //------------------------------------------------------------------------- |
| 311 | // CommandObjectSettingsClear |
| 312 | //------------------------------------------------------------------------- |
| 313 | |
| 314 | class CommandObjectSettingsClear : public CommandObject |
| 315 | { |
| 316 | public: |
| 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 | |
| 338 | private: |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 339 | }; |
| 340 | |
| 341 | } // namespace lldb_private |
| 342 | |
| 343 | #endif // liblldb_CommandObjectSettings_h_ |