blob: 4a4e1c35cf3179df086eae6d53d8c6d8a94e41bd [file] [log] [blame]
Chris Lattner30fdc8d2010-06-08 16:52:24 +00001//===-- CommandObjectArgs.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_CommandObjectArgs_h_
11#define liblldb_CommandObjectArgs_h_
12
13// C Includes
14// C++ Includes
15// Other libraries and framework includes
16// Project includes
17#include "lldb/Interpreter/CommandObject.h"
Jim Ingham40af72e2010-06-15 19:49:27 +000018#include "lldb/Interpreter/Options.h"
Chris Lattner30fdc8d2010-06-08 16:52:24 +000019
20namespace lldb_private {
21
Jim Ingham5a988412012-06-08 21:56:10 +000022 class CommandObjectArgs : public CommandObjectParsed
Chris Lattner30fdc8d2010-06-08 16:52:24 +000023 {
24 public:
25
26 class CommandOptions : public Options
27 {
28 public:
29
Greg Claytoneb0103f2011-04-07 22:46:35 +000030 CommandOptions (CommandInterpreter &interpreter);
Chris Lattner30fdc8d2010-06-08 16:52:24 +000031
Pavel Labath1fb7e202015-09-02 09:33:09 +000032 ~CommandOptions() override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +000033
Pavel Labath1fb7e202015-09-02 09:33:09 +000034 Error
35 SetOptionValue(uint32_t option_idx, const char *option_arg) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +000036
37 void
Pavel Labath1fb7e202015-09-02 09:33:09 +000038 OptionParsingStarting() override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +000039
Greg Claytone0d378b2011-03-24 21:19:54 +000040 const OptionDefinition*
Pavel Labath1fb7e202015-09-02 09:33:09 +000041 GetDefinitions() override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +000042
43 // Options table: Required for subclasses of Options.
44
Greg Claytone0d378b2011-03-24 21:19:54 +000045 static OptionDefinition g_option_table[];
Chris Lattner30fdc8d2010-06-08 16:52:24 +000046 };
47
Greg Claytona7015092010-09-18 01:14:36 +000048 CommandObjectArgs (CommandInterpreter &interpreter);
Chris Lattner30fdc8d2010-06-08 16:52:24 +000049
Pavel Labath1fb7e202015-09-02 09:33:09 +000050 ~CommandObjectArgs() override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +000051
Chris Lattner30fdc8d2010-06-08 16:52:24 +000052 Options *
Pavel Labath1fb7e202015-09-02 09:33:09 +000053 GetOptions() override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +000054
Chris Lattner30fdc8d2010-06-08 16:52:24 +000055 protected:
56
57 CommandOptions m_options;
Jim Ingham5a988412012-06-08 21:56:10 +000058
Pavel Labath1fb7e202015-09-02 09:33:09 +000059 bool
60 DoExecute(Args& command,
61 CommandReturnObject &result) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +000062 };
63
64} // namespace lldb_private
65
Pavel Labath1fb7e202015-09-02 09:33:09 +000066#endif // liblldb_CommandObjectArgs_h_