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