Updated all commands that use a "--format" / "-f" options to use the new
OptionGroupFormat. Updated OptionGroupFormat to be able to also use the
"--size" and "--count" options. Commands that use a OptionGroupFormat instance
can choose which of the options they want by initializing OptionGroupFormat
accordingly. Clients can either get only the "--format", "--format" + "--size",
or "--format" + "--size" + "--count". This is in preparation for upcoming
chnages where there are alternate ways (GDB format specification) to set a
format.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@142911 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Commands/CommandObjectExpression.h b/source/Commands/CommandObjectExpression.h
index d0feb6d..f22abef 100644
--- a/source/Commands/CommandObjectExpression.h
+++ b/source/Commands/CommandObjectExpression.h
@@ -15,8 +15,7 @@
// Other libraries and framework includes
// Project includes
#include "lldb/Interpreter/CommandObject.h"
-#include "lldb/Interpreter/Options.h"
-#include "lldb/Core/Language.h"
+#include "lldb/Interpreter/OptionGroupFormat.h"
#include "lldb/Target/ExecutionContext.h"
namespace lldb_private {
@@ -25,31 +24,32 @@
{
public:
- class CommandOptions : public Options
+ class CommandOptions : public OptionGroup
{
public:
- CommandOptions (CommandInterpreter &interpreter);
+ CommandOptions ();
virtual
~CommandOptions ();
- virtual Error
- SetOptionValue (uint32_t option_idx, const char *option_arg);
-
- void
- OptionParsingStarting ();
-
- const OptionDefinition*
+ virtual uint32_t
+ GetNumDefinitions ();
+
+ virtual const OptionDefinition*
GetDefinitions ();
+
+ virtual Error
+ SetOptionValue (CommandInterpreter &interpreter,
+ uint32_t option_idx,
+ const char *option_value);
+
+ virtual void
+ OptionParsingStarting (CommandInterpreter &interpreter);
// Options table: Required for subclasses of Options.
static OptionDefinition g_option_table[];
- //Language language;
- lldb::Encoding encoding;
- lldb::Format format;
- bool debug;
bool print_object;
LazyBool use_dynamic;
bool unwind_on_error;
@@ -93,7 +93,9 @@
Stream *error_stream,
CommandReturnObject *result = NULL);
- CommandOptions m_options;
+ OptionGroupOptions m_option_group;
+ OptionGroupFormat m_format_options;
+ CommandOptions m_command_options;
ExecutionContext m_exe_ctx;
uint32_t m_expr_line_count;
std::string m_expr_lines; // Multi-line expression support