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 190 of file IOHandler.h.
|
strong |
Enumerator | |
---|---|
None | |
LLDBCommand | |
Expression |
Definition at line 192 of file IOHandler.h.
|
inline |
Definition at line 194 of file IOHandler.h.
|
virtualdefault |
|
inlinevirtual |
Reimplemented in lldb_private::REPL, CommandObjectBreakpointCommandAdd, CommandObjectCommandsAddRegex, CommandObjectCommandsScriptAdd, CommandObjectTargetStopHookAdd, CommandObjectTypeSummaryAdd, CommandObjectTypeSynthAdd, CommandObjectWatchpointCommandAdd, and IOHandlerLuaInterpreter.
Definition at line 199 of file IOHandler.h.
Referenced by lldb_private::IOHandlerEditline::Activate().
|
virtual |
Reimplemented in lldb_private::IOHandlerConfirm, and lldb_private::REPL.
Definition at line 209 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 201 of file IOHandler.h.
Referenced by lldb_private::IOHandlerEditline::Deactivate().
|
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 233 of file IOHandler.h.
|
inlinevirtual |
Reimplemented in lldb_private::REPL.
Definition at line 275 of file IOHandler.h.
Referenced by lldb_private::IOHandlerEditline::GetCommandPrefix().
|
inlinevirtual |
Reimplemented in lldb_private::IOHandlerDelegateMultiline, lldb_private::REPL, and lldb_private::CommandInterpreter.
Definition at line 273 of file IOHandler.h.
Referenced by lldb_private::IOHandlerEditline::GetControlSequence().
|
inlinevirtual |
Reimplemented in lldb_private::REPL.
Definition at line 209 of file IOHandler.h.
Referenced by lldb_private::IOHandlerEditline::IOHandlerEditline().
|
inlinevirtual |
Reimplemented in lldb_private::REPL.
Definition at line 277 of file IOHandler.h.
Referenced by lldb_private::IOHandlerEditline::GetHelpPrologue().
|
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 lldb_private::IOHandlerConfirm, CommandObjectCommandsAddRegex, CommandObjectCommandsScriptAdd, CommandObjectTypeSummaryAdd, CommandObjectTypeSynthAdd, IOHandlerLuaInterpreter, lldb_private::REPL, lldb_private::CommandInterpreter, CommandObjectBreakpointCommandAdd, lldb_private::CommandObjectExpression, CommandObjectTargetStopHookAdd, and CommandObjectWatchpointCommandAdd.
Referenced by lldb_private::IOHandlerEditline::Run().
|
inlinevirtual |
Reimplemented in lldb_private::REPL.
Definition at line 249 of file IOHandler.h.
Referenced by lldb_private::IOHandlerEditline::Run().
|
inlinevirtual |
Reimplemented in lldb_private::REPL, and lldb_private::CommandInterpreter.
Definition at line 283 of file IOHandler.h.
Referenced by lldb_private::IOHandlerEditline::Interrupt().
|
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 lldb_private::IOHandlerDelegateMultiline, lldb_private::REPL, lldb_private::CommandObjectExpression, and IOHandlerLuaInterpreter.
Definition at line 266 of file IOHandler.h.
Referenced by lldb_private::IOHandlerEditline::GetLines().
|
virtual |
Definition at line 202 of file IOHandler.cpp.
References lldb_private::CommandInterpreter::GetAutoSuggestionForCommand(), lldb_private::Debugger::GetCommandInterpreter(), and lldb_private::IOHandler::GetDebugger().
|
protected |
Definition at line 286 of file IOHandler.h.
Referenced by IOHandlerComplete().