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

#include <CommandHistory.h>

Public Member Functions

 CommandHistory ()=default
 
 ~CommandHistory ()=default
 
size_t GetSize () const
 
bool IsEmpty () const
 
std::optional< llvm::StringRef > FindString (llvm::StringRef input_str) const
 
llvm::StringRef GetStringAtIndex (size_t idx) const
 
llvm::StringRef operator[] (size_t idx) const
 
llvm::StringRef GetRecentmostString () const
 
void AppendString (llvm::StringRef str, bool reject_if_dupe=true)
 
void Clear ()
 
void Dump (Stream &stream, size_t start_idx=0, size_t stop_idx=SIZE_MAX) const
 

Static Public Attributes

static const char g_repeat_char = '!'
 

Private Types

typedef std::vector< std::string > History
 

Private Member Functions

 CommandHistory (const CommandHistory &)=delete
 
const CommandHistoryoperator= (const CommandHistory &)=delete
 

Private Attributes

std::recursive_mutex m_mutex
 
History m_history
 

Detailed Description

Definition at line 22 of file CommandHistory.h.

Member Typedef Documentation

◆ History

typedef std::vector<std::string> lldb_private::CommandHistory::History
private

Definition at line 53 of file CommandHistory.h.

Constructor & Destructor Documentation

◆ CommandHistory() [1/2]

lldb_private::CommandHistory::CommandHistory ( )
default

◆ ~CommandHistory()

lldb_private::CommandHistory::~CommandHistory ( )
default

◆ CommandHistory() [2/2]

lldb_private::CommandHistory::CommandHistory ( const CommandHistory )
privatedelete

Member Function Documentation

◆ AppendString()

void CommandHistory::AppendString ( llvm::StringRef  str,
bool  reject_if_dupe = true 
)

Definition at line 79 of file CommandHistory.cpp.

References m_history, and m_mutex.

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

◆ Clear()

void CommandHistory::Clear ( )

Definition at line 90 of file CommandHistory.cpp.

References m_history, and m_mutex.

Referenced by CommandObjectSessionHistory::DoExecute().

◆ Dump()

void CommandHistory::Dump ( Stream stream,
size_t  start_idx = 0,
size_t  stop_idx = SIZE_MAX 
) const

◆ FindString()

std::optional< llvm::StringRef > CommandHistory::FindString ( llvm::StringRef  input_str) const

◆ GetRecentmostString()

llvm::StringRef CommandHistory::GetRecentmostString ( ) const

Definition at line 72 of file CommandHistory.cpp.

References m_history, and m_mutex.

◆ GetSize()

size_t CommandHistory::GetSize ( ) const

◆ GetStringAtIndex()

llvm::StringRef CommandHistory::GetStringAtIndex ( size_t  idx) const

◆ IsEmpty()

bool CommandHistory::IsEmpty ( ) const

Definition at line 22 of file CommandHistory.cpp.

References m_history, and m_mutex.

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

◆ operator=()

const CommandHistory & lldb_private::CommandHistory::operator= ( const CommandHistory )
privatedelete

◆ operator[]()

llvm::StringRef CommandHistory::operator[] ( size_t  idx) const

Definition at line 68 of file CommandHistory.cpp.

References GetStringAtIndex().

Member Data Documentation

◆ g_repeat_char

const char lldb_private::CommandHistory::g_repeat_char = '!'
static

◆ m_history

History lldb_private::CommandHistory::m_history
private

◆ m_mutex

std::recursive_mutex lldb_private::CommandHistory::m_mutex
mutableprivate

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