1 //===-- SBCommandInterpreterRunOptions.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_API_SBCOMMANDINTERPRETERRUNOPTIONS_H
10 #define LLDB_API_SBCOMMANDINTERPRETERRUNOPTIONS_H
11 
12 #include <memory>
13 
14 #include "lldb/API/SBDefines.h"
15 
16 namespace lldb_private {
17 class CommandInterpreterRunOptions;
18 class CommandInterpreterRunResult;
19 } // namespace lldb_private
20 
21 namespace lldb {
22 
23 class LLDB_API SBCommandInterpreterRunOptions {
24   friend class SBDebugger;
25   friend class SBCommandInterpreter;
26 
27 public:
28   SBCommandInterpreterRunOptions();
29   ~SBCommandInterpreterRunOptions();
30 
31   bool GetStopOnContinue() const;
32 
33   void SetStopOnContinue(bool);
34 
35   bool GetStopOnError() const;
36 
37   void SetStopOnError(bool);
38 
39   bool GetStopOnCrash() const;
40 
41   void SetStopOnCrash(bool);
42 
43   bool GetEchoCommands() const;
44 
45   void SetEchoCommands(bool);
46 
47   bool GetEchoCommentCommands() const;
48 
49   void SetEchoCommentCommands(bool echo);
50 
51   bool GetPrintResults() const;
52 
53   void SetPrintResults(bool);
54 
55   bool GetAddToHistory() const;
56 
57   void SetAddToHistory(bool);
58 
59   bool GetAutoHandleEvents() const;
60 
61   void SetAutoHandleEvents(bool);
62 
63   bool GetSpawnThread() const;
64 
65   void SetSpawnThread(bool);
66 
67 private:
68   lldb_private::CommandInterpreterRunOptions *get() const;
69 
70   lldb_private::CommandInterpreterRunOptions &ref() const;
71 
72   // This is set in the constructor and will always be valid.
73   mutable std::unique_ptr<lldb_private::CommandInterpreterRunOptions>
74       m_opaque_up;
75 };
76 
77 class LLDB_API SBCommandInterpreterRunResult {
78   friend class SBDebugger;
79   friend class SBCommandInterpreter;
80 
81 public:
82   SBCommandInterpreterRunResult();
83   SBCommandInterpreterRunResult(const SBCommandInterpreterRunResult &rhs);
84   ~SBCommandInterpreterRunResult();
85 
86   SBCommandInterpreterRunResult &
87   operator=(const SBCommandInterpreterRunResult &rhs);
88 
89   int GetNumberOfErrors() const;
90   lldb::CommandInterpreterResult GetResult() const;
91 
92 private:
93   SBCommandInterpreterRunResult(
94       const lldb_private::CommandInterpreterRunResult &rhs);
95 
96   // This is set in the constructor and will always be valid.
97   std::unique_ptr<lldb_private::CommandInterpreterRunResult> m_opaque_up;
98 };
99 
100 } // namespace lldb
101 
102 #endif // LLDB_API_SBCOMMANDINTERPRETERRUNOPTIONS_H
103