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
41 ~OptionGroupFormat ();
47 virtual const OptionDefinition*
51 SetOptionValue (CommandInterpreter &interpreter,
53 const char *option_value);
56 OptionParsingStarting (CommandInterpreter &interpreter);
61 return m_format.GetCurrentValue();
70 const OptionValueFormat &
71 GetFormatValue() const
82 const OptionValueUInt64 &
83 GetByteSizeValue() const
94 const OptionValueUInt64 &
101 HasGDBFormat () const
103 return m_has_gdb_format;
107 AnyOptionWasSet () const
109 return m_format.OptionWasSet() ||
110 m_byte_size.OptionWasSet() ||
111 m_count.OptionWasSet();
117 ParserGDBFormatLetter (CommandInterpreter &interpreter,
119 lldb::Format &format,
120 uint32_t &byte_size);
122 OptionValueFormat m_format;
123 OptionValueUInt64 m_byte_size;
124 OptionValueUInt64 m_count;
125 char m_prev_gdb_format;
126 char m_prev_gdb_size;
128 bool m_has_gdb_format;
131 } // namespace lldb_private
133 #endif // liblldb_OptionGroupFormat_h_