1 //===-- OptionGroupFormat.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_OptionGroupFormat_h_
11 #define liblldb_OptionGroupFormat_h_
15 // Other libraries and framework includes
17 #include "lldb/Interpreter/Options.h"
18 #include "lldb/Interpreter/OptionValueFormat.h"
19 #include "lldb/Interpreter/OptionValueSInt64.h"
20 #include "lldb/Interpreter/OptionValueUInt64.h"
22 namespace lldb_private {
24 //-------------------------------------------------------------------------
26 //-------------------------------------------------------------------------
28 class OptionGroupFormat : public OptionGroup
31 static const uint32_t OPTION_GROUP_FORMAT = LLDB_OPT_SET_1;
32 static const uint32_t OPTION_GROUP_GDB_FMT = LLDB_OPT_SET_2;
33 static const uint32_t OPTION_GROUP_SIZE = LLDB_OPT_SET_3;
34 static const uint32_t OPTION_GROUP_COUNT = LLDB_OPT_SET_4;
36 OptionGroupFormat (lldb::Format default_format,
37 uint64_t default_byte_size = UINT64_MAX, // Pass UINT64_MAX to disable the "--size" option
38 uint64_t default_count = UINT64_MAX); // Pass UINT64_MAX to disable the "--count" option
40 ~OptionGroupFormat() override;
43 GetNumDefinitions() override;
45 const OptionDefinition*
46 GetDefinitions() override;
49 SetOptionValue(CommandInterpreter &interpreter,
51 const char *option_value) override;
54 OptionParsingStarting(CommandInterpreter &interpreter) override;
59 return m_format.GetCurrentValue();
68 const OptionValueFormat &
69 GetFormatValue() const
80 const OptionValueUInt64 &
81 GetByteSizeValue() const
92 const OptionValueUInt64 &
101 return m_has_gdb_format;
105 AnyOptionWasSet () const
107 return m_format.OptionWasSet() ||
108 m_byte_size.OptionWasSet() ||
109 m_count.OptionWasSet();
114 ParserGDBFormatLetter (CommandInterpreter &interpreter,
116 lldb::Format &format,
117 uint32_t &byte_size);
119 OptionValueFormat m_format;
120 OptionValueUInt64 m_byte_size;
121 OptionValueUInt64 m_count;
122 char m_prev_gdb_format;
123 char m_prev_gdb_size;
124 bool m_has_gdb_format;
127 } // namespace lldb_private
129 #endif // liblldb_OptionGroupFormat_h_