LLDB mainline
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.
void Append (const FileSpecList &other)
 Appends all elements of other to the end of this list (regardless of whether a FileSpec already exists in 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.
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 91 of file FileSpecList.h.

Member Typedef Documentation

◆ collection

Definition at line 93 of file FileSpecList.h.

◆ const_iterator

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

Definition at line 94 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 20 of file FileSpecList.cpp.

References m_files.

Referenced by Append(), FileSpecList(), FileSpecList(), operator=(), and operator=().

◆ FileSpecList() [2/4]

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

Copy constructor.

References FileSpecList().

◆ FileSpecList() [3/4]

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

Move constructor.

References FileSpecList().

◆ FileSpecList() [4/4]

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

Initialize this object from a vector of FileSpecs.

Definition at line 108 of file FileSpecList.h.

References m_files.

◆ ~FileSpecList()

FileSpecList::~FileSpecList ( )
default

Destructor.

Member Function Documentation

◆ Append() [1/2]

◆ Append() [2/2]

void lldb_private::FileSpecList::Append ( const FileSpecList & other)
inline

Appends all elements of other to the end of this list (regardless of whether a FileSpec already exists in the list).

Definition at line 137 of file FileSpecList.h.

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

◆ 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 33 of file FileSpecList.cpp.

References end(), and m_files.

Referenced by ObjectFileELF::GetDependentModules(), ObjectFileMachO::GetDependentModules(), ObjectFilePECOFF::GetDependentModules(), GetModuleConfig(), lldb_private::SymbolLocatorDefault::LocateExecutableSymbolFile(), and lldb_private::Target::SetExecutableModule().

◆ begin()

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

Definition at line 240 of file FileSpecList.h.

References m_files.

Referenced by files().

◆ Clear()

void FileSpecList::Clear ( )

Clears the file list.

Definition at line 55 of file FileSpecList.cpp.

References m_files.

Referenced by lldb_private::ObjectFileJIT::GetDependentModules().

◆ 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 58 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

◆ end()

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

Definition at line 241 of file FileSpecList.h.

References m_files.

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

◆ files()

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

Definition at line 243 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 94 of file FileSpecList.cpp.

References m_files.

◆ GetFileSpecAtIndex()

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

◆ GetSize()

◆ Insert()

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

Definition at line 213 of file FileSpecList.h.

References m_files.

Referenced by SymbolVendorPECOFF::CreateInstance().

◆ IsEmpty()

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

◆ 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.

References FileSpecList().

◆ operator=() [2/2]

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

Move-assignment operator.

References FileSpecList().

◆ Remove()

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

Definition at line 232 of file FileSpecList.h.

References m_files.

◆ Replace()

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

Definition at line 224 of file FileSpecList.h.

References m_files.

Member Data Documentation

◆ m_files

collection lldb_private::FileSpecList::m_files
protected

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