LLDB  mainline
Public Member Functions | Protected Attributes | List of all members
lldb_private::IOHandlerConfirm Class Reference

#include <IOHandler.h>

Inheritance diagram for lldb_private::IOHandlerConfirm:
Inheritance graph
[legend]
Collaboration diagram for lldb_private::IOHandlerConfirm:
Collaboration graph
[legend]

Public Member Functions

 IOHandlerConfirm (Debugger &debugger, llvm::StringRef prompt, bool default_response)
 
 ~IOHandlerConfirm () override
 
bool GetResponse () const
 
int IOHandlerComplete (IOHandler &io_handler, const char *current_line, const char *cursor, const char *last_char, int skip_first_n_matches, int max_matches, StringList &matches, StringList &descriptions) override
 
void IOHandlerInputComplete (IOHandler &io_handler, std::string &data) override
 Called when a line or lines have been retrieved. More...
 
- Public Member Functions inherited from lldb_private::IOHandlerDelegate
 IOHandlerDelegate (Completion completion=Completion::None)
 
virtual ~IOHandlerDelegate ()=default
 
virtual void IOHandlerActivated (IOHandler &io_handler, bool interactive)
 
virtual void IOHandlerDeactivated (IOHandler &io_handler)
 
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. More...
 
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. More...
 
virtual ConstString IOHandlerGetControlSequence (char ch)
 
virtual const char * IOHandlerGetCommandPrefix ()
 
virtual const char * IOHandlerGetHelpPrologue ()
 
virtual bool IOHandlerInterrupt (IOHandler &io_handler)
 
- Public Member Functions inherited from lldb_private::IOHandlerEditline
 IOHandlerEditline (Debugger &debugger, IOHandler::Type type, const char *editline_name, llvm::StringRef prompt, llvm::StringRef continuation_prompt, bool multi_line, bool color_prompts, uint32_t line_number_start, IOHandlerDelegate &delegate, repro::DataRecorder *data_recorder)
 
 IOHandlerEditline (Debugger &debugger, IOHandler::Type type, const lldb::StreamFileSP &input_sp, const lldb::StreamFileSP &output_sp, const lldb::StreamFileSP &error_sp, uint32_t flags, const char *editline_name, llvm::StringRef prompt, llvm::StringRef continuation_prompt, bool multi_line, bool color_prompts, uint32_t line_number_start, IOHandlerDelegate &delegate, repro::DataRecorder *data_recorder)
 
 IOHandlerEditline (Debugger &, IOHandler::Type, const char *, const char *, const char *, bool, bool, uint32_t, IOHandlerDelegate &)=delete
 
 IOHandlerEditline (Debugger &, IOHandler::Type, const lldb::StreamFileSP &, const lldb::StreamFileSP &, const lldb::StreamFileSP &, uint32_t, const char *, const char *, const char *, bool, bool, uint32_t, IOHandlerDelegate &)=delete
 
 ~IOHandlerEditline () override
 
void Run () override
 
void Cancel () override
 
bool Interrupt () override
 
void GotEOF () override
 
void Activate () override
 
void Deactivate () override
 
ConstString GetControlSequence (char ch) override
 
const char * GetCommandPrefix () override
 
const char * GetHelpPrologue () override
 
const char * GetPrompt () override
 
bool SetPrompt (llvm::StringRef prompt) override
 
bool SetPrompt (const char *prompt)=delete
 
const char * GetContinuationPrompt ()
 
void SetContinuationPrompt (llvm::StringRef prompt)
 
void SetContinuationPrompt (const char *)=delete
 
bool GetLine (std::string &line, bool &interrupted)
 
bool GetLines (StringList &lines, bool &interrupted)
 
void SetBaseLineNumber (uint32_t line)
 
bool GetInterruptExits ()
 
void SetInterruptExits (bool b)
 
const StringListGetCurrentLines () const
 
uint32_t GetCurrentLineIndex () const
 
void PrintAsync (Stream *stream, const char *s, size_t len) override
 
- Public Member Functions inherited from lldb_private::IOHandler
 IOHandler (Debugger &debugger, IOHandler::Type type)
 
 IOHandler (Debugger &debugger, IOHandler::Type type, const lldb::StreamFileSP &input_sp, const lldb::StreamFileSP &output_sp, const lldb::StreamFileSP &error_sp, uint32_t flags, repro::DataRecorder *data_recorder)
 
virtual ~IOHandler ()
 
virtual bool IsActive ()
 
virtual void SetIsDone (bool b)
 
virtual bool GetIsDone ()
 
Type GetType () const
 
bool SetPrompt (const char *)=delete
 
int GetInputFD ()
 
int GetOutputFD ()
 
int GetErrorFD ()
 
FILE * GetInputFILE ()
 
FILE * GetOutputFILE ()
 
FILE * GetErrorFILE ()
 
lldb::StreamFileSP & GetInputStreamFile ()
 
lldb::StreamFileSP & GetOutputStreamFile ()
 
lldb::StreamFileSP & GetErrorStreamFile ()
 
DebuggerGetDebugger ()
 
void * GetUserData ()
 
void SetUserData (void *user_data)
 
FlagsGetFlags ()
 
const FlagsGetFlags () const
 
bool GetIsInteractive ()
 Check if the input is being supplied interactively by a user. More...
 
bool GetIsRealTerminal ()
 Check if the input is coming from a real terminal. More...
 
void SetPopped (bool b)
 
void WaitForPop ()
 

Protected Attributes

const bool m_default_response
 
bool m_user_response
 
- Protected Attributes inherited from lldb_private::IOHandlerDelegate
Completion m_completion
 
- Protected Attributes inherited from lldb_private::IOHandlerEditline
std::unique_ptr< Editline > m_editline_up
 
IOHandlerDelegatem_delegate
 
std::string m_prompt
 
std::string m_continuation_prompt
 
StringListm_current_lines_ptr
 
uint32_t m_base_line_number
 
uint32_t m_curr_line_idx
 
bool m_multi_line
 
bool m_color_prompts
 
bool m_interrupt_exits
 
bool m_editing
 
- Protected Attributes inherited from lldb_private::IOHandler
Debuggerm_debugger
 
lldb::StreamFileSP m_input_sp
 
lldb::StreamFileSP m_output_sp
 
lldb::StreamFileSP m_error_sp
 
repro::DataRecorderm_data_recorder
 
Predicate< bool > m_popped
 
Flags m_flags
 
Type m_type
 
void * m_user_data
 
bool m_done
 
bool m_active
 

Additional Inherited Members

- Public Types inherited from lldb_private::IOHandlerDelegate
enum  Completion { Completion::None, Completion::LLDBCommand, Completion::Expression }
 
- Public Types inherited from lldb_private::IOHandler
enum  Type {
  Type::CommandInterpreter, Type::CommandList, Type::Confirm, Type::Curses,
  Type::Expression, Type::REPL, Type::ProcessIO, Type::PythonInterpreter,
  Type::PythonCode, Type::Other
}
 

Detailed Description

Definition at line 444 of file IOHandler.h.

Constructor & Destructor Documentation

◆ IOHandlerConfirm()

IOHandlerConfirm::IOHandlerConfirm ( Debugger debugger,
llvm::StringRef  prompt,
bool  default_response 
)

◆ ~IOHandlerConfirm()

IOHandlerConfirm::~IOHandlerConfirm ( )
overridedefault

Referenced by IOHandlerConfirm().

Member Function Documentation

◆ GetResponse()

bool lldb_private::IOHandlerConfirm::GetResponse ( ) const
inline

Definition at line 451 of file IOHandler.h.

Referenced by lldb_private::CommandInterpreter::Confirm().

◆ IOHandlerComplete()

int IOHandlerConfirm::IOHandlerComplete ( IOHandler io_handler,
const char *  current_line,
const char *  cursor,
const char *  last_char,
int  skip_first_n_matches,
int  max_matches,
StringList matches,
StringList descriptions 
)
overridevirtual

◆ IOHandlerInputComplete()

void IOHandlerConfirm::IOHandlerInputComplete ( IOHandler io_handler,
std::string &  data 
)
overridevirtual

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.

Implements lldb_private::IOHandlerDelegate.

Definition at line 187 of file IOHandler.cpp.

References m_default_response, m_user_response, and lldb_private::IOHandler::SetIsDone().

Member Data Documentation

◆ m_default_response

const bool lldb_private::IOHandlerConfirm::m_default_response
protected

Definition at line 462 of file IOHandler.h.

Referenced by IOHandlerComplete(), IOHandlerConfirm(), and IOHandlerInputComplete().

◆ m_user_response

bool lldb_private::IOHandlerConfirm::m_user_response
protected

Definition at line 463 of file IOHandler.h.

Referenced by IOHandlerInputComplete().


The documentation for this class was generated from the following files: