Debian Codegraph @

DebugAdapterClient/RunInTerminalHelper.hpp

raw
1 #ifndef RUNINTERMINALHELPER_HPP
2 #define RUNINTERMINALHELPER_HPP
3
4 #include "asyncprocess.h"
5 #include "clModuleLogger.hpp"
6 #include "cl_command_event.h"
7 #include "codelite_events.h"
8 #include "processreaderthread.h"
9
10 #include <vector>
11 #include <wx/event.h>
12
13 class RunInTerminalHelper : public wxEvtHandler
14 {
15 IProcess* m_process = nullptr;
16 clModuleLogger& LOG;
17 int m_processId = wxNOT_FOUND;
18
19 protected:
20 void OnProcessTerminated(clProcessEvent& event);
21 void OnDebugEnded(clDebugEvent& event);
22
23 public:
24 RunInTerminalHelper(clModuleLogger& log);
25 virtual ~RunInTerminalHelper();
26
27 /**
28 * @brief run process, return its process id
29 */
30 int RunProcess(const std::vector<wxString>& command, const wxString& wd, const clEnvList_t& env);
31 void Terminate();
32 int GetProcessId() const { return m_processId; }
33 };
34
35 #endif // RUNINTERMINALHELPER_HPP