1 //===-- CommandObjectScript.h -----------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLDB_SOURCE_INTERPRETER_COMMANDOBJECTSCRIPT_H
10 #define LLDB_SOURCE_INTERPRETER_COMMANDOBJECTSCRIPT_H
11 
12 #include "lldb/Interpreter/CommandObject.h"
13 
14 namespace lldb_private {
15 
16 class CommandObjectScript : public CommandObjectRaw {
17 public:
18   CommandObjectScript(CommandInterpreter &interpreter);
19   ~CommandObjectScript() override;
GetOptions()20   Options *GetOptions() override { return &m_options; }
21 
22   class CommandOptions : public Options {
23   public:
CommandOptions()24     CommandOptions() : Options() {}
25     ~CommandOptions() override = default;
26     Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg,
27                           ExecutionContext *execution_context) override;
28     void OptionParsingStarting(ExecutionContext *execution_context) override;
29     llvm::ArrayRef<OptionDefinition> GetDefinitions() override;
30     lldb::ScriptLanguage language = lldb::eScriptLanguageNone;
31   };
32 
33 protected:
34   bool DoExecute(llvm::StringRef command, CommandReturnObject &result) override;
35 
36 private:
37   CommandOptions m_options;
38 };
39 
40 } // namespace lldb_private
41 
42 #endif // LLDB_SOURCE_INTERPRETER_COMMANDOBJECTSCRIPT_H
43