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" 18 #include "lldb/Interpreter/CommandObjectMultiword.h" 19 #include "lldb/Interpreter/Options.h" 20 21 22 namespace lldb_private { 23 24 //------------------------------------------------------------------------- 25 // CommandObjectMultiwordSettings 26 //------------------------------------------------------------------------- 27 28 class CommandObjectMultiwordSettings : public CommandObjectMultiword 29 { 30 public: 31 32 CommandObjectMultiwordSettings (CommandInterpreter &interpreter); 33 34 virtual 35 ~CommandObjectMultiwordSettings (); 36 37 }; 38 39 //------------------------------------------------------------------------- 40 // CommandObjectSettingsSet 41 //------------------------------------------------------------------------- 42 43 class CommandObjectSettingsSet : public CommandObject 44 { 45 public: 46 CommandObjectSettingsSet (CommandInterpreter &interpreter); 47 48 virtual 49 ~CommandObjectSettingsSet (); 50 51 virtual bool 52 Execute (Args& command, 53 CommandReturnObject &result); 54 55 virtual Options * 56 GetOptions (); 57 58 class CommandOptions : public Options 59 { 60 public: 61 62 CommandOptions (CommandInterpreter &interpreter); 63 64 virtual 65 ~CommandOptions (); 66 67 virtual Error 68 SetOptionValue (uint32_t option_idx, const char *option_arg); 69 70 void 71 OptionParsingStarting (); 72 73 const OptionDefinition* 74 GetDefinitions (); 75 76 // Options table: Required for subclasses of Options. 77 78 static OptionDefinition g_option_table[]; 79 80 // Instance variables to hold the values for command options. 81 82 bool m_override; 83 bool m_reset; 84 85 }; 86 87 virtual int 88 HandleArgumentCompletion (Args &input, 89 int &cursor_index, 90 int &cursor_char_position, 91 OptionElementVector &opt_element_vector, 92 int match_start_point, 93 int max_return_elements, 94 bool &word_complete, 95 StringList &matches); 96 97 private: 98 CommandOptions m_options; 99 }; 100 101 //------------------------------------------------------------------------- 102 // CommandObjectSettingsShow -- Show current values 103 //------------------------------------------------------------------------- 104 105 class CommandObjectSettingsShow : public CommandObject 106 { 107 public: 108 CommandObjectSettingsShow (CommandInterpreter &interpreter); 109 110 virtual 111 ~CommandObjectSettingsShow (); 112 113 virtual bool 114 Execute (Args& command, 115 CommandReturnObject &result); 116 117 118 virtual int 119 HandleArgumentCompletion (Args &input, 120 int &cursor_index, 121 int &cursor_char_position, 122 OptionElementVector &opt_element_vector, 123 int match_start_point, 124 int max_return_elements, 125 bool &word_complete, 126 StringList &matches); 127 128 private: 129 }; 130 131 //------------------------------------------------------------------------- 132 // CommandObjectSettingsList -- List settable variables 133 //------------------------------------------------------------------------- 134 135 class CommandObjectSettingsList : public CommandObject 136 { 137 public: 138 CommandObjectSettingsList (CommandInterpreter &interpreter); 139 140 virtual 141 ~CommandObjectSettingsList (); 142 143 virtual bool 144 Execute (Args& command, 145 CommandReturnObject &result); 146 147 virtual int 148 HandleArgumentCompletion (Args &input, 149 int &cursor_index, 150 int &cursor_char_position, 151 OptionElementVector &opt_element_vector, 152 int match_start_point, 153 int max_return_elements, 154 bool &word_complete, 155 StringList &matches); 156 157 private: 158 }; 159 160 //------------------------------------------------------------------------- 161 // CommandObjectSettingsRemove 162 //------------------------------------------------------------------------- 163 164 class CommandObjectSettingsRemove : public CommandObject 165 { 166 public: 167 CommandObjectSettingsRemove (CommandInterpreter &interpreter); 168 169 virtual 170 ~CommandObjectSettingsRemove (); 171 172 virtual bool 173 Execute (Args& command, 174 CommandReturnObject &result); 175 176 virtual int 177 HandleArgumentCompletion (Args &input, 178 int &cursor_index, 179 int &cursor_char_position, 180 OptionElementVector &opt_element_vector, 181 int match_start_point, 182 int max_return_elements, 183 bool &word_complete, 184 StringList &matches); 185 186 private: 187 }; 188 189 //------------------------------------------------------------------------- 190 // CommandObjectSettingsReplace 191 //------------------------------------------------------------------------- 192 193 class CommandObjectSettingsReplace : public CommandObject 194 { 195 public: 196 CommandObjectSettingsReplace (CommandInterpreter &interpreter); 197 198 virtual 199 ~CommandObjectSettingsReplace (); 200 201 virtual bool 202 Execute (Args& command, 203 CommandReturnObject &result); 204 205 virtual int 206 HandleArgumentCompletion (Args &input, 207 int &cursor_index, 208 int &cursor_char_position, 209 OptionElementVector &opt_element_vector, 210 int match_start_point, 211 int max_return_elements, 212 bool &word_complete, 213 StringList &matches); 214 215 private: 216 }; 217 218 //------------------------------------------------------------------------- 219 // CommandObjectSettingsInsertBefore 220 //------------------------------------------------------------------------- 221 222 class CommandObjectSettingsInsertBefore : public CommandObject 223 { 224 public: 225 CommandObjectSettingsInsertBefore (CommandInterpreter &interpreter); 226 227 virtual 228 ~CommandObjectSettingsInsertBefore (); 229 230 virtual bool 231 Execute (Args& command, 232 CommandReturnObject &result); 233 234 virtual int 235 HandleArgumentCompletion (Args &input, 236 int &cursor_index, 237 int &cursor_char_position, 238 OptionElementVector &opt_element_vector, 239 int match_start_point, 240 int max_return_elements, 241 bool &word_complete, 242 StringList &matches); 243 244 private: 245 }; 246 247 //------------------------------------------------------------------------- 248 // CommandObjectSettingInsertAfter 249 //------------------------------------------------------------------------- 250 251 class CommandObjectSettingsInsertAfter : public CommandObject 252 { 253 public: 254 CommandObjectSettingsInsertAfter (CommandInterpreter &interpreter); 255 256 virtual 257 ~CommandObjectSettingsInsertAfter (); 258 259 virtual bool 260 Execute (Args& command, 261 CommandReturnObject &result); 262 263 virtual int 264 HandleArgumentCompletion (Args &input, 265 int &cursor_index, 266 int &cursor_char_position, 267 OptionElementVector &opt_element_vector, 268 int match_start_point, 269 int max_return_elements, 270 bool &word_complete, 271 StringList &matches); 272 273 private: 274 }; 275 276 //------------------------------------------------------------------------- 277 // CommandObjectSettingsAppend 278 //------------------------------------------------------------------------- 279 280 class CommandObjectSettingsAppend : public CommandObject 281 { 282 public: 283 CommandObjectSettingsAppend (CommandInterpreter &interpreter); 284 285 virtual 286 ~CommandObjectSettingsAppend (); 287 288 virtual bool 289 Execute (Args& command, 290 CommandReturnObject &result); 291 292 virtual int 293 HandleArgumentCompletion (Args &input, 294 int &cursor_index, 295 int &cursor_char_position, 296 OptionElementVector &opt_element_vector, 297 int match_start_point, 298 int max_return_elements, 299 bool &word_complete, 300 StringList &matches); 301 302 private: 303 }; 304 305 //------------------------------------------------------------------------- 306 // CommandObjectSettingsClear 307 //------------------------------------------------------------------------- 308 309 class CommandObjectSettingsClear : public CommandObject 310 { 311 public: 312 CommandObjectSettingsClear (CommandInterpreter &interpreter); 313 314 virtual 315 ~CommandObjectSettingsClear (); 316 317 virtual bool 318 Execute (Args& command, 319 CommandReturnObject &result); 320 321 virtual int 322 HandleArgumentCompletion (Args &input, 323 int &cursor_index, 324 int &cursor_char_position, 325 OptionElementVector &opt_element_vector, 326 int match_start_point, 327 int max_return_elements, 328 bool &word_complete, 329 StringList &matches); 330 331 private: 332 }; 333 334 } // namespace lldb_private 335 336 #endif // liblldb_CommandObjectSettings_h_ 337