1//===-- OptionGroupArchitecture.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_OptionGroupArchitecture_h_
11#define liblldb_OptionGroupArchitecture_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/Core/ArchSpec.h"
19
20namespace lldb_private {
21
22//-------------------------------------------------------------------------
23// OptionGroupArchitecture
24//-------------------------------------------------------------------------
25
26class OptionGroupArchitecture : public OptionGroup
27{
28public:
29
30    OptionGroupArchitecture ();
31
32    virtual
33    ~OptionGroupArchitecture ();
34
35
36    virtual uint32_t
37    GetNumDefinitions ();
38
39    virtual const OptionDefinition*
40    GetDefinitions ();
41
42    virtual Error
43    SetOptionValue (CommandInterpreter &interpreter,
44                    uint32_t option_idx,
45                    const char *option_value);
46
47    virtual void
48    OptionParsingStarting (CommandInterpreter &interpreter);
49
50    bool
51    GetArchitecture (Platform *platform, ArchSpec &arch);
52
53    bool
54    ArchitectureWasSpecified () const
55    {
56        return !m_arch_str.empty();
57    }
58    const char *
59    GetArchitectureName ()
60    {
61        if (m_arch_str.empty())
62            return NULL;
63        return m_arch_str.c_str();
64    }
65
66protected:
67
68    std::string m_arch_str; // Save the arch triple in case a platform is specified after the architecture
69};
70
71} // namespace lldb_private
72
73#endif  // liblldb_OptionGroupArchitecture_h_
74