1 //===-- CommandObjectPlatform.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_CommandObjectPlatform_h_
11 #define liblldb_CommandObjectPlatform_h_
12 
13 // C Includes
14 // C++ Includes
15 // Other libraries and framework includes
16 // Project includes
17 #include "lldb/Interpreter/CommandObjectMultiword.h"
18 #include "lldb/Interpreter/Options.h"
19 
20 namespace lldb_private {
21 
22 //-------------------------------------------------------------------------
23 // CommandObjectPlatform
24 //-------------------------------------------------------------------------
25 
26 class CommandObjectPlatform : public CommandObjectMultiword
27 {
28 public:
29     CommandObjectPlatform(CommandInterpreter &interpreter);
30 
31     virtual
32     ~CommandObjectPlatform();
33 
34     private:
35     DISALLOW_COPY_AND_ASSIGN (CommandObjectPlatform);
36 };
37 
38 
39 //-------------------------------------------------------------------------
40 // PlatformOptionGroup
41 //
42 // Make platform options available to to any other command in case they
43 // need them. The "file" command needs them, and by exposing them we can
44 // reuse the platform command options for any command, we can keep things
45 // consistent.
46 //-------------------------------------------------------------------------
47 class PlatformOptionGroup : public OptionGroup
48 {
49 public:
50 
51     PlatformOptionGroup (bool include_platform_option) :
52         platform_name (),
53         os_version_major (UINT32_MAX),
54         os_version_minor (UINT32_MAX),
55         os_version_update (UINT32_MAX),
56         m_include_platform_option (include_platform_option)
57     {
58     }
59 
60     virtual
61     ~PlatformOptionGroup ()
62     {
63     }
64 
65     virtual uint32_t
66     GetNumDefinitions ();
67 
68     virtual const OptionDefinition*
69     GetDefinitions ();
70 
71     virtual Error
72     SetOptionValue (CommandInterpreter &interpreter,
73                     uint32_t option_idx,
74                     const char *option_value);
75 
76     lldb::PlatformSP
77     CreatePlatformWithOptions (CommandInterpreter &interpreter,
78                                bool select,
79                                Error &error);
80 
81     virtual void
82     OptionParsingStarting (CommandInterpreter &interpreter);
83 
84     // Instance variables to hold the values for command options.
85 
86     std::string platform_name;
87     uint32_t os_version_major;
88     uint32_t os_version_minor;
89     uint32_t os_version_update;
90 protected:
91     bool m_include_platform_option;
92 };
93 
94 
95 
96 } // namespace lldb_private
97 
98 #endif  // liblldb_CommandObjectPlatform_h_
99