OptionGroupBoolean.h revision 73844aa19a7360b662e2be710fc3c969d6c86606
1//===-- OptionGroupBoolean.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_OptionGroupBoolean_h_
11#define liblldb_OptionGroupBoolean_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/Interpreter/OptionValueBoolean.h"
19
20namespace lldb_private {
21    //-------------------------------------------------------------------------
22    // OptionGroupBoolean
23    //-------------------------------------------------------------------------
24
25    class OptionGroupBoolean : public OptionGroup
26    {
27    public:
28
29        OptionGroupBoolean (uint32_t usage_mask,
30                            bool required,
31                            const char *long_option,
32                            char short_option,
33                            uint32_t completion_type,
34                            lldb::CommandArgumentType argument_type,
35                            const char *usage_text,
36                            bool default_value);
37
38        virtual
39        ~OptionGroupBoolean ();
40
41
42        virtual uint32_t
43        GetNumDefinitions ()
44        {
45            return 1;
46        }
47
48        virtual const OptionDefinition*
49        GetDefinitions ()
50        {
51            return &m_option_definition;
52        }
53
54        virtual Error
55        SetOptionValue (CommandInterpreter &interpreter,
56                        uint32_t option_idx,
57                        const char *option_value);
58
59        virtual void
60        OptionParsingStarting (CommandInterpreter &interpreter);
61
62        OptionValueBoolean &
63        GetOptionValue ()
64        {
65            return m_value;
66        }
67
68        const OptionValueBoolean &
69        GetOptionValue () const
70        {
71            return m_value;
72        }
73
74    protected:
75        OptionValueBoolean m_value;
76        OptionDefinition m_option_definition;
77
78    };
79
80} // namespace lldb_private
81
82#endif  // liblldb_OptionGroupBoolean_h_
83