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

#include <StringList.h>

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

Public Types

typedef collection::iterator iterator
 
typedef collection::const_iterator const_iterator
 

Public Member Functions

 StringList ()
 
 StringList (const char *str)
 
 StringList (const char **strv, int strc)
 
virtual ~StringList ()
 
void AppendString (const std::string &s)
 
void AppendString (std::string &&s)
 
void AppendString (const char *str)
 
void AppendString (const char *str, size_t str_len)
 
void AppendString (llvm::StringRef str)
 
void AppendList (const char **strv, int strc)
 
void AppendList (StringList strings)
 
size_t GetSize () const
 
void SetSize (size_t n)
 
size_t GetMaxStringLength () const
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
std::stringoperator[] (size_t idx)
 
const std::stringoperator[] (size_t idx) const
 
void PopBack ()
 
const char * GetStringAtIndex (size_t idx) const
 
void Join (const char *separator, Stream &strm)
 
void Clear ()
 
std::string LongestCommonPrefix ()
 
void InsertStringAtIndex (size_t idx, const std::string &str)
 
void InsertStringAtIndex (size_t idx, std::string &&str)
 
void InsertStringAtIndex (size_t id, const char *str)
 
void DeleteStringAtIndex (size_t id)
 
void RemoveBlankLines ()
 
size_t SplitIntoLines (const std::string &lines)
 
size_t SplitIntoLines (const char *lines, size_t len)
 
std::string CopyList (const char *item_preamble=nullptr, const char *items_sep="\n") const
 
StringListoperator<< (const char *str)
 
StringListoperator<< (const std::string &s)
 
StringListoperator<< (const StringList &strings)
 
StringListoperator= (const std::vector< std::string > &rhs)
 
virtual void LogDump (Log *log, const char *name=nullptr)
 

Static Public Member Functions

template<typename T >
static void LogDump (Log *log, T s_iterable, const char *name=nullptr)
 

Private Types

typedef std::vector< std::stringcollection
 

Private Attributes

collection m_strings
 

Detailed Description

Definition at line 25 of file StringList.h.

Member Typedef Documentation

◆ collection

typedef std::vector<std::string> lldb_private::StringList::collection
private

Definition at line 26 of file StringList.h.

◆ const_iterator

typedef collection::const_iterator lldb_private::StringList::const_iterator

Definition at line 58 of file StringList.h.

◆ iterator

typedef collection::iterator lldb_private::StringList::iterator

Definition at line 57 of file StringList.h.

Constructor & Destructor Documentation

◆ StringList() [1/3]

StringList::StringList ( )

Definition at line 22 of file StringList.cpp.

◆ StringList() [2/3]

StringList::StringList ( const char *  str)
explicit

Definition at line 24 of file StringList.cpp.

References m_strings.

◆ StringList() [3/3]

StringList::StringList ( const char **  strv,
int  strc 
)

Definition at line 29 of file StringList.cpp.

References m_strings.

◆ ~StringList()

StringList::~StringList ( )
virtualdefault

Member Function Documentation

◆ AppendList() [1/2]

void StringList::AppendList ( const char **  strv,
int  strc 
)

Definition at line 56 of file StringList.cpp.

References m_strings.

Referenced by operator<<().

◆ AppendList() [2/2]

void StringList::AppendList ( StringList  strings)

Definition at line 63 of file StringList.cpp.

References begin(), end(), GetSize(), and m_strings.

◆ AppendString() [1/5]

void StringList::AppendString ( const char *  str)

Definition at line 38 of file StringList.cpp.

References m_strings.

◆ AppendString() [2/5]

void StringList::AppendString ( const char *  str,
size_t  str_len 
)

Definition at line 47 of file StringList.cpp.

References m_strings, and string().

◆ AppendString() [3/5]

void StringList::AppendString ( const std::string s)

◆ AppendString() [4/5]

void StringList::AppendString ( llvm::StringRef  str)

Definition at line 52 of file StringList.cpp.

References m_strings.

◆ AppendString() [5/5]

void StringList::AppendString ( std::string &&  s)

Definition at line 45 of file StringList.cpp.

References m_strings.

◆ begin() [1/2]

iterator lldb_private::StringList::begin ( )
inline

◆ begin() [2/2]

const_iterator lldb_private::StringList::begin ( ) const
inline

Definition at line 62 of file StringList.h.

References m_strings.

◆ Clear()

void StringList::Clear ( )

◆ CopyList()

std::string StringList::CopyList ( const char *  item_preamble = nullptr,
const char *  items_sep = "\n" 
) const

◆ DeleteStringAtIndex()

void StringList::DeleteStringAtIndex ( size_t  id)

◆ end() [1/2]

iterator lldb_private::StringList::end ( )
inline

◆ end() [2/2]

const_iterator lldb_private::StringList::end ( ) const
inline

Definition at line 63 of file StringList.h.

References m_strings.

◆ GetMaxStringLength()

size_t StringList::GetMaxStringLength ( ) const

Definition at line 70 of file StringList.cpp.

References m_strings.

Referenced by lldb_private::CommandObjectApropos::DoExecute().

◆ GetSize()

size_t StringList::GetSize ( ) const

◆ GetStringAtIndex()

const char * StringList::GetStringAtIndex ( size_t  idx) const

◆ InsertStringAtIndex() [1/3]

void StringList::InsertStringAtIndex ( size_t  id,
const char *  str 
)

Definition at line 118 of file StringList.cpp.

References m_strings.

◆ InsertStringAtIndex() [2/3]

void StringList::InsertStringAtIndex ( size_t  idx,
const std::string str 
)

Definition at line 127 of file StringList.cpp.

References m_strings.

Referenced by lldb::SBCommandInterpreter::HandleCompletionWithDescriptions().

◆ InsertStringAtIndex() [3/3]

void StringList::InsertStringAtIndex ( size_t  idx,
std::string &&  str 
)

Definition at line 134 of file StringList.cpp.

References m_strings.

◆ Join()

void StringList::Join ( const char *  separator,
Stream strm 
)

◆ LogDump() [1/2]

void StringList::LogDump ( Log log,
const char *  name = nullptr 
)
virtual

◆ LogDump() [2/2]

template<typename T >
static void lldb_private::StringList::LogDump ( Log log,
s_iterable,
const char *  name = nullptr 
)
inlinestatic

Definition at line 118 of file StringList.h.

References LogDump().

◆ LongestCommonPrefix()

std::string StringList::LongestCommonPrefix ( )

Definition at line 101 of file StringList.cpp.

References m_strings.

Referenced by lldb::SBCommandInterpreter::HandleCompletionWithDescriptions().

◆ operator<<() [1/3]

StringList & StringList::operator<< ( const char *  str)

Definition at line 205 of file StringList.cpp.

References AppendString().

◆ operator<<() [2/3]

StringList & StringList::operator<< ( const std::string s)

Definition at line 210 of file StringList.cpp.

References AppendString().

◆ operator<<() [3/3]

StringList & StringList::operator<< ( const StringList strings)

Definition at line 215 of file StringList.cpp.

References AppendList().

◆ operator=()

StringList & StringList::operator= ( const std::vector< std::string > &  rhs)

Definition at line 220 of file StringList.cpp.

References m_strings.

◆ operator[]() [1/2]

std::string& lldb_private::StringList::operator[] ( size_t  idx)
inline

Definition at line 65 of file StringList.h.

References m_strings.

◆ operator[]() [2/2]

const std::string& lldb_private::StringList::operator[] ( size_t  idx) const
inline

Definition at line 70 of file StringList.h.

References m_strings.

◆ PopBack()

void lldb_private::StringList::PopBack ( )
inline

◆ RemoveBlankLines()

void StringList::RemoveBlankLines ( )

Definition at line 179 of file StringList.cpp.

References DeleteStringAtIndex(), GetSize(), and m_strings.

◆ SetSize()

void lldb_private::StringList::SetSize ( size_t  n)
inline

Definition at line 53 of file StringList.h.

References m_strings.

◆ SplitIntoLines() [1/2]

size_t StringList::SplitIntoLines ( const char *  lines,
size_t  len 
)

Definition at line 150 of file StringList.cpp.

References end(), m_strings, and string().

◆ SplitIntoLines() [2/2]

size_t StringList::SplitIntoLines ( const std::string lines)

Member Data Documentation

◆ m_strings

collection lldb_private::StringList::m_strings
private

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