blob: 255fc3bb911f880e89772c27ef7972d80f79054f [file] [log] [blame]
Greg Claytonb1888f22011-03-19 01:12:21 +00001//===-- 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"
Greg Clayton143fcc32011-04-13 00:18:08 +000018#include "lldb/Interpreter/Options.h"
Greg Claytonb1888f22011-03-19 01:12:21 +000019
20namespace lldb_private {
21
22//-------------------------------------------------------------------------
23// CommandObjectPlatform
24//-------------------------------------------------------------------------
25
26class CommandObjectPlatform : public CommandObjectMultiword
27{
28public:
Greg Claytonb1888f22011-03-19 01:12:21 +000029 CommandObjectPlatform(CommandInterpreter &interpreter);
30
31 virtual
32 ~CommandObjectPlatform();
33
Greg Clayton143fcc32011-04-13 00:18:08 +000034 private:
Greg Claytonb1888f22011-03-19 01:12:21 +000035 DISALLOW_COPY_AND_ASSIGN (CommandObjectPlatform);
36};
37
Greg Clayton143fcc32011-04-13 00:18:08 +000038
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//-------------------------------------------------------------------------
47class PlatformOptionGroup : public OptionGroup
48{
49public:
50
51 PlatformOptionGroup (bool include_platform_option) :
52 m_include_platform_option (include_platform_option),
53 platform_sp (),
54 os_version_major (UINT32_MAX),
55 os_version_minor (UINT32_MAX),
56 os_version_update (UINT32_MAX)
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 const char *platform_name,
79 bool select,
80 Error& error);
81
82 virtual void
83 OptionParsingStarting (CommandInterpreter &interpreter);
84
85 // Instance variables to hold the values for command options.
86
87 lldb::PlatformSP platform_sp;
88 uint32_t os_version_major;
89 uint32_t os_version_minor;
90 uint32_t os_version_update;
91protected:
92 bool m_include_platform_option;
93};
94
95
96
Greg Claytonb1888f22011-03-19 01:12:21 +000097} // namespace lldb_private
98
99#endif // liblldb_CommandObjectPlatform_h_