LLDB mainline
|
A delegate class for use with IOHandler subclasses. More...
#include <IOHandler.h>
Public Types | |
enum class | Completion { None , LLDBCommand , Expression } |
Public Member Functions | |
IOHandlerDelegate (Completion completion=Completion::None) | |
virtual | ~IOHandlerDelegate ()=default |
virtual void | IOHandlerActivated (IOHandler &io_handler, bool interactive) |
virtual void | IOHandlerDeactivated (IOHandler &io_handler) |
virtual std::optional< std::string > | IOHandlerSuggestion (IOHandler &io_handler, llvm::StringRef line) |
virtual void | IOHandlerComplete (IOHandler &io_handler, CompletionRequest &request) |
virtual const char * | IOHandlerGetFixIndentationCharacters () |
virtual int | IOHandlerFixIndentation (IOHandler &io_handler, const StringList &lines, int cursor_position) |
Called when a new line is created or one of an identified set of indentation characters is typed. | |
virtual void | IOHandlerInputComplete (IOHandler &io_handler, std::string &data)=0 |
Called when a line or lines have been retrieved. | |
virtual void | IOHandlerInputInterrupted (IOHandler &io_handler, std::string &data) |
virtual bool | IOHandlerIsInputComplete (IOHandler &io_handler, StringList &lines) |
Called to determine whether typing enter after the last line in lines should end input. | |
virtual llvm::StringRef | IOHandlerGetControlSequence (char ch) |
virtual const char * | IOHandlerGetCommandPrefix () |
virtual const char * | IOHandlerGetHelpPrologue () |
virtual bool | IOHandlerInterrupt (IOHandler &io_handler) |
Protected Attributes | |
Completion | m_completion |
A delegate class for use with IOHandler subclasses.
The IOHandler delegate is designed to be mixed into classes so they can use an IOHandler subclass to fetch input and notify the object that inherits from this delegate class when a token is received.
Definition at line 184 of file IOHandler.h.
|
strong |
Enumerator | |
---|---|
None | |
LLDBCommand | |
Expression |
Definition at line 186 of file IOHandler.h.
|
inline |
Definition at line 188 of file IOHandler.h.
References m_completion, and None.
Referenced by lldb_private::CommandInterpreter::CommandInterpreter(), lldb_private::CommandObjectExpression::CommandObjectExpression(), lldb_private::CommandInterpreter::GetLLDBCommandsFromIOHandler(), lldb_private::CommandInterpreter::GetPythonCommandsFromIOHandler(), and lldb_private::IOHandlerDelegateMultiline::IOHandlerDelegateMultiline().
|
virtualdefault |
|
inlinevirtual |
Reimplemented in CommandObjectBreakpointCommandAdd, CommandObjectCommandsAddRegex, CommandObjectCommandsScriptAdd, CommandObjectTargetStopHookAdd, CommandObjectTypeSummaryAdd, CommandObjectTypeSynthAdd, CommandObjectWatchpointCommandAdd, IOHandlerLuaInterpreter, and lldb_private::REPL.
Definition at line 193 of file IOHandler.h.
|
virtual |
Reimplemented in lldb_private::IOHandlerConfirm, and lldb_private::REPL.
Definition at line 196 of file IOHandler.cpp.
References lldb::eVariablePathCompletion, Expression, lldb_private::Debugger::GetCommandInterpreter(), lldb_private::IOHandler::GetDebugger(), lldb_private::CommandInterpreter::HandleCompletion(), lldb_private::CommandCompletions::InvokeCommonCompletionCallbacks(), LLDBCommand, m_completion, and None.
|
inlinevirtual |
Definition at line 195 of file IOHandler.h.
|
inlinevirtual |
Called when a new line is created or one of an identified set of indentation characters is typed.
This function determines how much indentation should be added or removed to match the recommended amount for the final line.
[in] | io_handler | The IOHandler that responsible for input. |
[in] | lines | The current input up to the line to be corrected. Lines following the line containing the cursor are not included. |
[in] | cursor_position | The number of characters preceding the cursor on the final line at the time. |
Reimplemented in lldb_private::REPL.
Definition at line 227 of file IOHandler.h.
|
inlinevirtual |
Reimplemented in lldb_private::REPL.
Definition at line 269 of file IOHandler.h.
|
inlinevirtual |
Reimplemented in lldb_private::CommandInterpreter, lldb_private::IOHandlerDelegateMultiline, and lldb_private::REPL.
Definition at line 267 of file IOHandler.h.
|
inlinevirtual |
Reimplemented in lldb_private::REPL.
Definition at line 203 of file IOHandler.h.
Referenced by lldb_private::IOHandlerEditline::IOHandlerEditline().
|
inlinevirtual |
Reimplemented in lldb_private::REPL.
Definition at line 271 of file IOHandler.h.
|
pure virtual |
Called when a line or lines have been retrieved.
This function can handle the current line and possibly call IOHandler::SetIsDone(true) when the IO handler is done like when "quit" is entered as a command, of when an empty line is received. It is up to the delegate to determine when a line should cause a IOHandler to exit.
Implemented in CommandObjectBreakpointCommandAdd, CommandObjectCommandsAddRegex, CommandObjectCommandsScriptAdd, CommandObjectTargetStopHookAdd, CommandObjectTypeSummaryAdd, CommandObjectTypeSynthAdd, CommandObjectWatchpointCommandAdd, IOHandlerLuaInterpreter, lldb_private::CommandInterpreter, lldb_private::CommandObjectExpression, lldb_private::IOHandlerConfirm, and lldb_private::REPL.
|
inlinevirtual |
Reimplemented in lldb_private::REPL.
Definition at line 243 of file IOHandler.h.
|
inlinevirtual |
Reimplemented in lldb_private::CommandInterpreter, and lldb_private::REPL.
Definition at line 277 of file IOHandler.h.
|
inlinevirtual |
Called to determine whether typing enter after the last line in lines should end input.
This function will not be called on IOHandler objects that are getting single lines.
[in] | io_handler | The IOHandler that responsible for updating the lines. |
[in] | lines | The current multi-line content. May be altered to provide alternative input when complete. |
Reimplemented in IOHandlerLuaInterpreter, lldb_private::CommandObjectExpression, lldb_private::IOHandlerDelegateMultiline, and lldb_private::REPL.
Definition at line 260 of file IOHandler.h.
|
virtual |
Definition at line 189 of file IOHandler.cpp.
References lldb_private::CommandInterpreter::GetAutoSuggestionForCommand(), lldb_private::Debugger::GetCommandInterpreter(), and lldb_private::IOHandler::GetDebugger().
|
protected |
Definition at line 280 of file IOHandler.h.
Referenced by IOHandlerComplete(), and IOHandlerDelegate().