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

A file collection class. More...

#include "lldb/Utility/FileSpecList.h"

Public Types

typedef std::vector< FileSpeccollection
 
typedef collection::const_iterator const_iterator
 

Public Member Functions

 FileSpecList ()
 Default constructor.
 
 FileSpecList (const FileSpecList &rhs)=default
 Copy constructor.
 
 FileSpecList (FileSpecList &&rhs)=default
 Move constructor.
 
 FileSpecList (std::vector< FileSpec > &&rhs)
 Initialize this object from a vector of FileSpecs.
 
 ~FileSpecList ()
 Destructor.
 
FileSpecListoperator= (const FileSpecList &rhs)=default
 Assignment operator.
 
FileSpecListoperator= (FileSpecList &&rhs)=default
 Move-assignment operator.
 
void Append (const FileSpec &file)
 Append a FileSpec object to the list.
 
bool AppendIfUnique (const FileSpec &file)
 Append a FileSpec object if unique.
 
template<class... Args>
void EmplaceBack (Args &&...args)
 Inserts a new FileSpec into the FileSpecList constructed in-place with the given arguments.
 
void Clear ()
 Clears the file list.
 
void Dump (Stream *s, const char *separator_cstr="\n") const
 Dumps the file list to the supplied stream pointer "s".
 
size_t FindFileIndex (size_t idx, const FileSpec &file, bool full) const
 Find a file index.
 
const FileSpecGetFileSpecAtIndex (size_t idx) const
 Get file at index.
 
size_t MemorySize () const
 Get the memory cost of this object.
 
bool IsEmpty () const
 
size_t GetSize () const
 Get the number of files in the file list.
 
bool Insert (size_t idx, const FileSpec &file)
 
bool Replace (size_t idx, const FileSpec &file)
 
bool Remove (size_t idx)
 
const_iterator begin () const
 
const_iterator end () const
 
llvm::iterator_range< const_iteratorfiles () const
 

Protected Attributes

collection m_files
 A collection of FileSpec objects.
 

Detailed Description

A file collection class.

A class that contains a mutable list of FileSpec objects.

Definition at line 85 of file FileSpecList.h.

Member Typedef Documentation

◆ collection

Definition at line 87 of file FileSpecList.h.

◆ const_iterator

typedef collection::const_iterator lldb_private::FileSpecList::const_iterator

Definition at line 88 of file FileSpecList.h.

Constructor & Destructor Documentation

◆ FileSpecList() [1/4]

FileSpecList::FileSpecList ( )

Default constructor.

Initialize this object with an empty file list.

Definition at line 18 of file FileSpecList.cpp.

Referenced by MemorySize().

◆ FileSpecList() [2/4]

lldb_private::FileSpecList::FileSpecList ( const FileSpecList rhs)
default

Copy constructor.

◆ FileSpecList() [3/4]

lldb_private::FileSpecList::FileSpecList ( FileSpecList &&  rhs)
default

Move constructor.

◆ FileSpecList() [4/4]

lldb_private::FileSpecList::FileSpecList ( std::vector< FileSpec > &&  rhs)
inline

Initialize this object from a vector of FileSpecs.

Definition at line 102 of file FileSpecList.h.

◆ ~FileSpecList()

FileSpecList::~FileSpecList ( )
default

Destructor.

Member Function Documentation

◆ Append()

void FileSpecList::Append ( const FileSpec file)

◆ AppendIfUnique()

bool FileSpecList::AppendIfUnique ( const FileSpec file)

Append a FileSpec object if unique.

Appends file to the end of the file list if it doesn't already exist in the file list.

Parameters
[in]fileA new file to append to this file list.
Returns
true if the file was appended, false otherwise.

Definition at line 31 of file FileSpecList.cpp.

References end(), and m_files.

Referenced by ObjectFileELF::GetDependentModules(), ObjectFileMachO::GetDependentModules(), ObjectFilePECOFF::GetDependentModules(), GetModuleConfig(), lldb_private::SymbolLocatorDefault::LocateExecutableSymbolFile(), ObjectFileMachO::ParseSymtab(), CommandObjectBreakpointSet::CommandOptions::SetOptionValue(), and CommandObjectThreadJump::CommandOptions::SetOptionValue().

◆ begin()

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

Definition at line 238 of file FileSpecList.h.

References m_files.

Referenced by files().

◆ Clear()

void FileSpecList::Clear ( )

◆ Dump()

void FileSpecList::Dump ( Stream s,
const char *  separator_cstr = "\n" 
) const

Dumps the file list to the supplied stream pointer "s".

Parameters
[in]sThe stream that will be used to dump the object description.

Definition at line 57 of file FileSpecList.cpp.

References lldb_private::Stream::AsRawOstream(), end(), m_files, and lldb_private::Stream::PutCString().

◆ EmplaceBack()

template<class... Args>
void lldb_private::FileSpecList::EmplaceBack ( Args &&...  args)
inline

Inserts a new FileSpec into the FileSpecList constructed in-place with the given arguments.

Parameters
[in]argsArguments to create the FileSpec

Definition at line 146 of file FileSpecList.h.

References m_files.

Referenced by lldb_private::ItaniumABILanguageRuntime::CreateExceptionSearchFilter(), lldb_private::SearchFilterByModuleListAndCU::CreateFromStructuredData(), and lldb_private::PlatformDarwin::SetThreadCreationBreakpoint().

◆ end()

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

Definition at line 239 of file FileSpecList.h.

References m_files.

Referenced by AppendIfUnique(), Dump(), files(), and MemorySize().

◆ files()

llvm::iterator_range< const_iterator > lldb_private::FileSpecList::files ( ) const
inline

Definition at line 241 of file FileSpecList.h.

References begin(), and end().

Referenced by lldb_private::plugin::dwarf::SymbolFileDWARF::GetDwpSymbolFile().

◆ FindFileIndex()

size_t FileSpecList::FindFileIndex ( size_t  idx,
const FileSpec file,
bool  full 
) const

Find a file index.

Find the index of the file in the file spec list that matches file starting idx entries into the file spec list.

Parameters
[in]idxAn index into the file list.
[in]fileThe file specification to search for.
[in]fullShould FileSpec::Equal be called with "full" true or false.
Returns
The index of the file that matches file if it is found, else UINT32_MAX is returned.

Definition at line 95 of file FileSpecList.cpp.

References m_files.

Referenced by lldb_private::SearchFilterByModuleListAndCU::AddressPasses(), lldb_private::SearchFilterByModuleListAndCU::CompUnitPasses(), lldb_private::SearchFilterByModuleList::ModulePasses(), lldb_private::SearchFilterByModuleList::Search(), and lldb_private::SearchFilterByModuleListAndCU::Search().

◆ GetFileSpecAtIndex()

const FileSpec & FileSpecList::GetFileSpecAtIndex ( size_t  idx) const

◆ GetSize()

size_t FileSpecList::GetSize ( ) const

Get the number of files in the file list.

Returns
The number of files in the file spec list.

Definition at line 201 of file FileSpecList.cpp.

References m_files.

Referenced by lldb_private::SearchFilterByModuleListAndCU::AddressPasses(), lldb_private::ClangModulesDeclVendor::Create(), lldb_private::Target::CreateScriptedBreakpoint(), lldb_private::TargetList::CreateTargetInternal(), CommandObjectTargetVariable::DoExecute(), CommandObjectThreadJump::DoExecute(), CommandObjectBreakpointSet::DoExecute(), lldb_private::OptionValueFileSpecList::DumpValue(), lldb_private::PlatformDarwin::FindBundleBinaryInExecSearchPaths(), lldb_private::ThreadPlanStepInRange::FrameMatchesAvoidCriteria(), ObjectFilePECOFF::GetDependentModules(), lldb_private::SearchFilterByModuleList::GetDescription(), lldb_private::SearchFilterByModuleListAndCU::GetDescription(), lldb_private::plugin::dwarf::SymbolFileDWARF::GetDwoSymbolFileForCompileUnit(), GetModuleConfig(), lldb_private::Target::GetSearchFilterForModuleAndCUList(), lldb_private::Target::GetSearchFilterForModuleList(), lldb_private::ModuleList::GetSharedModule(), lldb_private::PlatformDarwin::GetSharedModule(), lldb_private::Module::LoadScriptingResourceInTarget(), lldb_private::SymbolLocatorDefault::LocateExecutableSymbolFile(), lldb_private::SearchFilterByModuleList::ModulePasses(), ObjectFileMachO::ParseSymtab(), lldb_private::Symbol::ResolveReExportedSymbolInModuleSpec(), lldb_private::SearchFilterByModuleListAndCU::Search(), lldb_private::SearchFilter::SerializeFileSpecList(), lldb_private::Target::SetExecutableModule(), CommandObjectThreadJump::CommandOptions::SetOptionValue(), and lldb_private::OptionValueFileSpecList::SetValueFromString().

◆ Insert()

bool lldb_private::FileSpecList::Insert ( size_t  idx,
const FileSpec file 
)
inline

Definition at line 211 of file FileSpecList.h.

References m_files.

Referenced by lldb_private::OptionValueFileSpecList::SetValueFromString().

◆ IsEmpty()

bool lldb_private::FileSpecList::IsEmpty ( ) const
inline

Definition at line 203 of file FileSpecList.h.

References m_files.

◆ MemorySize()

size_t FileSpecList::MemorySize ( ) const

Get the memory cost of this object.

Return the size in bytes that this object takes in memory. This returns the size in bytes of this object, not any shared string values it may refer to.

Returns
The number of bytes that this object occupies in memory.

Definition at line 190 of file FileSpecList.cpp.

References end(), FileSpecList(), and m_files.

◆ operator=() [1/2]

FileSpecList & lldb_private::FileSpecList::operator= ( const FileSpecList rhs)
default

Assignment operator.

Replace the file list in this object with the file list from rhs.

Parameters
[in]rhsA file list object to copy.
Returns
A const reference to this object.

◆ operator=() [2/2]

FileSpecList & lldb_private::FileSpecList::operator= ( FileSpecList &&  rhs)
default

Move-assignment operator.

◆ Remove()

bool lldb_private::FileSpecList::Remove ( size_t  idx)
inline

Definition at line 230 of file FileSpecList.h.

References m_files.

Referenced by lldb_private::OptionValueFileSpecList::SetValueFromString().

◆ Replace()

bool lldb_private::FileSpecList::Replace ( size_t  idx,
const FileSpec file 
)
inline

Definition at line 222 of file FileSpecList.h.

References m_files.

Referenced by lldb_private::OptionValueFileSpecList::SetValueFromString().

Member Data Documentation

◆ m_files

collection lldb_private::FileSpecList::m_files
protected

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