aboutsummaryrefslogtreecommitdiffstats
path: root/include/lldb/Core/FileSpecList.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/lldb/Core/FileSpecList.h')
-rw-r--r--include/lldb/Core/FileSpecList.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/include/lldb/Core/FileSpecList.h b/include/lldb/Core/FileSpecList.h
index 79623ef1fdca..8edc3280b01b 100644
--- a/include/lldb/Core/FileSpecList.h
+++ b/include/lldb/Core/FileSpecList.h
@@ -25,6 +25,9 @@ class Stream;
/// A class that contains a mutable list of FileSpec objects.
class FileSpecList {
public:
+ typedef std::vector<FileSpec> collection;
+ typedef collection::const_iterator const_iterator;
+
/// Default constructor.
///
/// Initialize this object with an empty file list.
@@ -76,6 +79,15 @@ public:
/// \b true if the file was appended, \b false otherwise.
bool AppendIfUnique(const FileSpec &file);
+ /// Inserts a new FileSpec into the FileSpecList constructed in-place with
+ /// the given arguments.
+ ///
+ /// \param[in] args
+ /// Arguments to create the FileSpec
+ template <class... Args> void EmplaceBack(Args &&... args) {
+ m_files.emplace_back(std::forward<Args>(args)...);
+ }
+
/// Clears the file list.
void Clear();
@@ -182,9 +194,10 @@ public:
static size_t GetFilesMatchingPartialPath(const char *path, bool dir_okay,
FileSpecList &matches);
+ const_iterator begin() const { return m_files.begin(); }
+ const_iterator end() const { return m_files.end(); }
+
protected:
- typedef std::vector<FileSpec>
- collection; ///< The collection type for the file list.
collection m_files; ///< A collection of FileSpec objects.
};