1 //===-- OptionGroupPlatform.h -----------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_OptionGroupPlatform_h_
11 #define liblldb_OptionGroupPlatform_h_
15 // Other libraries and framework includes
17 #include "lldb/Core/ConstString.h"
18 #include "lldb/Interpreter/Options.h"
20 namespace lldb_private {
22 //-------------------------------------------------------------------------
23 // PlatformOptionGroup
25 // Make platform options available to any commands that need the settings.
26 //-------------------------------------------------------------------------
27 class OptionGroupPlatform : public OptionGroup
30 OptionGroupPlatform (bool include_platform_option) :
34 m_os_version_major (UINT32_MAX),
35 m_os_version_minor (UINT32_MAX),
36 m_os_version_update (UINT32_MAX),
37 m_include_platform_option (include_platform_option)
41 ~OptionGroupPlatform() override = default;
44 GetNumDefinitions() override;
46 const OptionDefinition*
47 GetDefinitions() override;
50 SetOptionValue(CommandInterpreter &interpreter,
52 const char *option_value) override;
55 OptionParsingStarting(CommandInterpreter &interpreter) override;
58 CreatePlatformWithOptions (CommandInterpreter &interpreter,
62 ArchSpec &platform_arch) const;
65 PlatformWasSpecified () const
67 return !m_platform_name.empty();
71 SetPlatformName (const char *platform_name)
73 if (platform_name && platform_name[0])
74 m_platform_name.assign (platform_name);
76 m_platform_name.clear();
80 GetSDKRootDirectory () const
86 SetSDKRootDirectory (const ConstString &sdk_root_directory)
88 m_sdk_sysroot = sdk_root_directory;
98 SetSDKBuild (const ConstString &sdk_build)
100 m_sdk_build = sdk_build;
104 PlatformMatches(const lldb::PlatformSP &platform_sp) const;
107 std::string m_platform_name;
108 ConstString m_sdk_sysroot;
109 ConstString m_sdk_build;
110 uint32_t m_os_version_major;
111 uint32_t m_os_version_minor;
112 uint32_t m_os_version_update;
113 bool m_include_platform_option;
116 } // namespace lldb_private
118 #endif // liblldb_OptionGroupPlatform_h_