本文整理汇总了C++中Driver::ReadyForCommand方法的典型用法代码示例。如果您正苦于以下问题:C++ Driver::ReadyForCommand方法的具体用法?C++ Driver::ReadyForCommand怎么用?C++ Driver::ReadyForCommand使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Driver
的用法示例。
在下文中一共展示了Driver::ReadyForCommand方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
size_t
Driver::EditLineInputReaderCallback
(
void *baton,
SBInputReader *reader,
InputReaderAction notification,
const char *bytes,
size_t bytes_len
)
{
Driver *driver = (Driver *)baton;
switch (notification)
{
case eInputReaderActivate:
break;
case eInputReaderReactivate:
driver->ReadyForCommand();
break;
case eInputReaderDeactivate:
break;
case eInputReaderAsynchronousOutputWritten:
if (driver->m_io_channel_ap.get() != NULL)
driver->m_io_channel_ap->RefreshPrompt();
break;
case eInputReaderInterrupt:
if (driver->m_io_channel_ap.get() != NULL)
{
SBProcess process = driver->GetDebugger().GetSelectedTarget().GetProcess();
if (!driver->m_io_channel_ap->EditLineHasCharacters()
&& process.IsValid() && process.GetState() == lldb::eStateRunning)
{
process.Stop();
}
else
{
driver->m_io_channel_ap->OutWrite ("^C\n", 3, NO_ASYNC);
// I wish I could erase the entire input line, but there's no public API for that.
driver->m_io_channel_ap->EraseCharsBeforeCursor();
driver->m_io_channel_ap->RefreshPrompt();
}
}
break;
case eInputReaderEndOfFile:
if (driver->m_io_channel_ap.get() != NULL)
{
driver->m_io_channel_ap->OutWrite ("^D\n", 3, NO_ASYNC);
driver->m_io_channel_ap->RefreshPrompt ();
}
#ifdef __unix__
write (driver->m_editline_pty.GetMasterFileDescriptor(), "quit\n", 5);
#endif
break;
case eInputReaderGotToken:
#ifdef __unix__
write (driver->m_editline_pty.GetMasterFileDescriptor(), bytes, bytes_len);
#endif
break;
case eInputReaderDone:
break;
}
return bytes_len;
}