LLDB  mainline
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
lldb_private::ScriptInterpreterIORedirect Class Reference

#include <ScriptInterpreter.h>

Collaboration diagram for lldb_private::ScriptInterpreterIORedirect:
Collaboration graph
[legend]

Public Member Functions

 ~ScriptInterpreterIORedirect ()
 
lldb::FileSP GetInputFile () const
 
lldb::FileSP GetOutputFile () const
 
lldb::FileSP GetErrorFile () const
 
void Flush ()
 Flush our output and error file handles. More...
 

Static Public Member Functions

static llvm::Expected< std::unique_ptr< ScriptInterpreterIORedirect > > Create (bool enable_io, Debugger &debugger, CommandReturnObject *result)
 Create an IO redirect. More...
 

Private Member Functions

 ScriptInterpreterIORedirect (std::unique_ptr< File > input, std::unique_ptr< File > output)
 
 ScriptInterpreterIORedirect (Debugger &debugger, CommandReturnObject *result)
 

Private Attributes

lldb::FileSP m_input_file_sp
 
lldb::StreamFileSP m_output_file_sp
 
lldb::StreamFileSP m_error_file_sp
 
Communication m_communication
 
bool m_disconnect
 

Detailed Description

Definition at line 96 of file ScriptInterpreter.h.

Constructor & Destructor Documentation

◆ ~ScriptInterpreterIORedirect()

ScriptInterpreterIORedirect::~ScriptInterpreterIORedirect ( )

◆ ScriptInterpreterIORedirect() [1/2]

ScriptInterpreterIORedirect::ScriptInterpreterIORedirect ( std::unique_ptr< File input,
std::unique_ptr< File output 
)
private

Definition at line 157 of file ScriptInterpreter.cpp.

Referenced by Create().

◆ ScriptInterpreterIORedirect() [2/2]

ScriptInterpreterIORedirect::ScriptInterpreterIORedirect ( Debugger debugger,
CommandReturnObject result 
)
private

Member Function Documentation

◆ Create()

llvm::Expected< std::unique_ptr< ScriptInterpreterIORedirect > > ScriptInterpreterIORedirect::Create ( bool  enable_io,
Debugger debugger,
CommandReturnObject result 
)
static

Create an IO redirect.

If IO is enabled, this will redirects the output to the command return object if set or to the debugger otherwise. If IO is disabled, it will redirect all IO to /dev/null.

Definition at line 137 of file ScriptInterpreter.cpp.

References lldb_private::FileSystem::DEV_NULL, lldb_private::File::eOpenOptionReadOnly, lldb_private::File::eOpenOptionWriteOnly, lldb_private::FileSystem::Instance(), lldb_private::FileSystem::Open(), and ScriptInterpreterIORedirect().

Referenced by lldb_private::ScriptInterpreterLua::ExecuteOneLine().

◆ Flush()

void ScriptInterpreterIORedirect::Flush ( )

Flush our output and error file handles.

Definition at line 209 of file ScriptInterpreter.cpp.

References m_error_file_sp, and m_output_file_sp.

Referenced by lldb_private::ScriptInterpreterLua::ExecuteOneLine().

◆ GetErrorFile()

lldb::FileSP lldb_private::ScriptInterpreterIORedirect::GetErrorFile ( ) const
inline

Definition at line 108 of file ScriptInterpreter.h.

References m_error_file_sp.

Referenced by lldb_private::ScriptInterpreterLua::ExecuteOneLine().

◆ GetInputFile()

lldb::FileSP lldb_private::ScriptInterpreterIORedirect::GetInputFile ( ) const
inline

Definition at line 106 of file ScriptInterpreter.h.

References m_input_file_sp.

◆ GetOutputFile()

lldb::FileSP lldb_private::ScriptInterpreterIORedirect::GetOutputFile ( ) const
inline

Definition at line 107 of file ScriptInterpreter.h.

References m_output_file_sp.

Referenced by lldb_private::ScriptInterpreterLua::ExecuteOneLine().

Member Data Documentation

◆ m_communication

Communication lldb_private::ScriptInterpreterIORedirect::m_communication
private

◆ m_disconnect

bool lldb_private::ScriptInterpreterIORedirect::m_disconnect
private

◆ m_error_file_sp

lldb::StreamFileSP lldb_private::ScriptInterpreterIORedirect::m_error_file_sp
private

◆ m_input_file_sp

lldb::FileSP lldb_private::ScriptInterpreterIORedirect::m_input_file_sp
private

Definition at line 118 of file ScriptInterpreter.h.

Referenced by GetInputFile(), and ScriptInterpreterIORedirect().

◆ m_output_file_sp

lldb::StreamFileSP lldb_private::ScriptInterpreterIORedirect::m_output_file_sp
private

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