blob: 00199158666d24697d47812d77e4343b742ed985 [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) :
Greg Clayton5e342f52011-04-13 22:47:15 +000052 platform_name (),
Greg Clayton143fcc32011-04-13 00:18:08 +000053 os_version_major (UINT32_MAX),
54 os_version_minor (UINT32_MAX),
Greg Clayton5e342f52011-04-13 22:47:15 +000055 os_version_update (UINT32_MAX),
56 m_include_platform_option (include_platform_option)
Greg Clayton143fcc32011-04-13 00:18:08 +000057 {
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
Greg Clayton5e342f52011-04-13 22:47:15 +000077 CreatePlatformWithOptions (CommandInterpreter &interpreter,
78 bool select,
79 Error &error);
Greg Clayton143fcc32011-04-13 00:18:08 +000080
81 virtual void
82 OptionParsingStarting (CommandInterpreter &interpreter);
83
84 // Instance variables to hold the values for command options.
85
Greg Clayton5e342f52011-04-13 22:47:15 +000086 std::string platform_name;
Greg Clayton143fcc32011-04-13 00:18:08 +000087 uint32_t os_version_major;
88 uint32_t os_version_minor;
89 uint32_t os_version_update;
90protected:
91 bool m_include_platform_option;
92};
93
94
95
Greg Claytonb1888f22011-03-19 01:12:21 +000096} // namespace lldb_private
97
98#endif // liblldb_CommandObjectPlatform_h_