1 //===-- OptionGroupFile.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_OptionGroupFile_h_ 11 #define liblldb_OptionGroupFile_h_ 12 13 // C Includes 14 // C++ Includes 15 // Other libraries and framework includes 16 // Project includes 17 #include "lldb/Interpreter/Options.h" 18 #include "lldb/Interpreter/OptionValueFileSpec.h" 19 #include "lldb/Interpreter/OptionValueFileSpecList.h" 20 21 namespace lldb_private { 22 23 //------------------------------------------------------------------------- 24 // OptionGroupFile 25 //------------------------------------------------------------------------- 26 27 class OptionGroupFile : public OptionGroup 28 { 29 public: 30 31 OptionGroupFile (uint32_t usage_mask, 32 bool required, 33 const char *long_option, 34 int short_option, 35 uint32_t completion_type, 36 lldb::CommandArgumentType argument_type, 37 const char *usage_text); 38 39 virtual 40 ~OptionGroupFile (); 41 42 43 virtual uint32_t GetNumDefinitions()44 GetNumDefinitions () 45 { 46 return 1; 47 } 48 49 virtual const OptionDefinition* GetDefinitions()50 GetDefinitions () 51 { 52 return &m_option_definition; 53 } 54 55 virtual Error 56 SetOptionValue (CommandInterpreter &interpreter, 57 uint32_t option_idx, 58 const char *option_value); 59 60 virtual void 61 OptionParsingStarting (CommandInterpreter &interpreter); 62 63 OptionValueFileSpec & GetOptionValue()64 GetOptionValue () 65 { 66 return m_file; 67 } 68 69 const OptionValueFileSpec & GetOptionValue()70 GetOptionValue () const 71 { 72 return m_file; 73 } 74 75 protected: 76 OptionValueFileSpec m_file; 77 OptionDefinition m_option_definition; 78 79 }; 80 81 //------------------------------------------------------------------------- 82 // OptionGroupFileList 83 //------------------------------------------------------------------------- 84 85 class OptionGroupFileList : public OptionGroup 86 { 87 public: 88 89 OptionGroupFileList (uint32_t usage_mask, 90 bool required, 91 const char *long_option, 92 int short_option, 93 uint32_t completion_type, 94 lldb::CommandArgumentType argument_type, 95 const char *usage_text); 96 97 virtual 98 ~OptionGroupFileList (); 99 100 101 virtual uint32_t GetNumDefinitions()102 GetNumDefinitions () 103 { 104 return 1; 105 } 106 107 virtual const OptionDefinition* GetDefinitions()108 GetDefinitions () 109 { 110 return &m_option_definition; 111 } 112 113 virtual Error 114 SetOptionValue (CommandInterpreter &interpreter, 115 uint32_t option_idx, 116 const char *option_value); 117 118 virtual void 119 OptionParsingStarting (CommandInterpreter &interpreter); 120 121 122 OptionValueFileSpecList & GetOptionValue()123 GetOptionValue () 124 { 125 return m_file_list; 126 } 127 128 const OptionValueFileSpecList & GetOptionValue()129 GetOptionValue () const 130 { 131 return m_file_list; 132 } 133 134 protected: 135 OptionValueFileSpecList m_file_list; 136 OptionDefinition m_option_definition; 137 138 }; 139 140 } // namespace lldb_private 141 142 #endif // liblldb_OptionGroupFile_h_ 143