9#ifndef LLDB_CORE_FILESPECLIST_H
10#define LLDB_CORE_FILESPECLIST_H
29 typedef std::vector<std::shared_ptr<SupportFile>>
collection;
35 return Append(std::make_shared<SupportFile>(file));
37 void Append(std::shared_ptr<SupportFile> &&file) {
38 m_files.push_back(std::move(file));
80 std::make_shared<SupportFile>(std::forward<Args>(args)...));
153 m_files.emplace_back(std::forward<Args>(args)...);
163 void Dump(
Stream *s,
const char *separator_cstr =
"\n")
const;
221 }
else if (idx ==
m_files.size()) {
247 llvm::iterator_range<const_iterator>
files()
const {
248 return llvm::make_range(
begin(),
end());
A command line argument class.
std::vector< FileSpec > collection
const_iterator begin() const
llvm::iterator_range< const_iterator > files() const
const_iterator end() const
bool Insert(size_t idx, const FileSpec &file)
const FileSpec & GetFileSpecAtIndex(size_t idx) const
Get file at index.
void EmplaceBack(Args &&...args)
Inserts a new FileSpec into the FileSpecList constructed in-place with the given arguments.
void Clear()
Clears the file list.
FileSpecList()
Default constructor.
void Append(const FileSpec &file)
Append a FileSpec object to the list.
size_t GetSize() const
Get the number of files in the file list.
size_t FindFileIndex(size_t idx, const FileSpec &file, bool full) const
Find a file index.
FileSpecList & operator=(FileSpecList &&rhs)=default
Move-assignment operator.
bool Replace(size_t idx, const FileSpec &file)
size_t MemorySize() const
Get the memory cost of this object.
bool AppendIfUnique(const FileSpec &file)
Append a FileSpec object if unique.
FileSpecList(const FileSpecList &rhs)=default
Copy constructor.
FileSpecList(std::vector< FileSpec > &&rhs)
Initialize this object from a vector of FileSpecs.
void Dump(Stream *s, const char *separator_cstr="\n") const
Dumps the file list to the supplied stream pointer "s".
FileSpecList(FileSpecList &&rhs)=default
Move constructor.
~FileSpecList()
Destructor.
collection m_files
A collection of FileSpec objects.
collection::const_iterator const_iterator
FileSpecList & operator=(const FileSpecList &rhs)=default
Assignment operator.
A stream class that can stream formatted output to a file.
A list of support files for a CompileUnit.
const FileSpec & GetFileSpecAtIndex(size_t idx) const
void Append(const FileSpec &file)
const_iterator begin() const
size_t FindCompatibleIndex(size_t idx, const FileSpec &file, RealpathPrefixes *realpath_prefixes=nullptr) const
Find a compatible file index.
SupportFileList(SupportFileList &&other)=default
collection m_files
A collection of FileSpec objects.
void Append(std::shared_ptr< SupportFile > &&file)
std::vector< std::shared_ptr< SupportFile > > collection
bool AppendIfUnique(const FileSpec &file)
size_t FindFileIndex(size_t idx, const FileSpec &file, bool full) const
lldb::SupportFileSP GetSupportFileAtIndex(size_t idx) const
const_iterator end() const
SupportFileList(const SupportFileList &)=delete
collection::const_iterator const_iterator
void EmplaceBack(Args &&...args)
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::SupportFile > SupportFileSP