9#ifndef LLDB_CORE_FILESPECLIST_H
10#define LLDB_CORE_FILESPECLIST_H
11#if defined(__cplusplus)
28 typedef std::vector<FileSpec> collection;
29 typedef collection::const_iterator const_iterator;
37 FileSpecList(
const FileSpecList &rhs) =
default;
40 FileSpecList(FileSpecList &&rhs) =
default;
43 FileSpecList(std::vector<FileSpec> &&rhs) : m_files(std::move(rhs)) {}
57 FileSpecList &operator=(
const FileSpecList &rhs) =
default;
60 FileSpecList &operator=(FileSpecList &&rhs) =
default;
68 void Append(
const FileSpec &file);
80 bool AppendIfUnique(
const FileSpec &file);
87 template <
class... Args>
void EmplaceBack(Args &&... args) {
88 m_files.emplace_back(std::forward<Args>(args)...);
98 void Dump(Stream *s,
const char *separator_cstr =
"\n")
const;
117 size_t FindFileIndex(
size_t idx,
const FileSpec &file,
bool full)
const;
143 size_t FindCompatibleIndex(
size_t idx,
const FileSpec &file)
const;
158 const FileSpec &GetFileSpecAtIndex(
size_t idx)
const;
171 const FileSpec *GetFileSpecPointerAtIndex(
size_t idx)
const;
181 size_t MemorySize()
const;
183 bool IsEmpty()
const {
return m_files.empty(); }
189 size_t GetSize()
const;
191 bool Insert(
size_t idx,
const FileSpec &file) {
192 if (idx < m_files.size()) {
193 m_files.insert(m_files.begin() + idx, file);
195 }
else if (idx == m_files.size()) {
196 m_files.push_back(file);
202 bool Replace(
size_t idx,
const FileSpec &file) {
203 if (idx < m_files.size()) {
210 bool Remove(
size_t idx) {
211 if (idx < m_files.size()) {
212 m_files.erase(m_files.begin() + idx);
218 static size_t GetFilesMatchingPartialPath(
const char *path,
bool dir_okay,
219 FileSpecList &matches);
221 const_iterator begin()
const {
return m_files.begin(); }
222 const_iterator end()
const {
return m_files.end(); }
A class that represents a running process on the host machine.