summaryrefslogtreecommitdiff
path: root/include/lldb/Utility/StringList.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/lldb/Utility/StringList.h')
-rw-r--r--include/lldb/Utility/StringList.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/include/lldb/Utility/StringList.h b/include/lldb/Utility/StringList.h
index 68c1f87510f6..0b1d955678b3 100644
--- a/include/lldb/Utility/StringList.h
+++ b/include/lldb/Utility/StringList.h
@@ -23,6 +23,8 @@ class Stream;
namespace lldb_private {
class StringList {
+ typedef std::vector<std::string> collection;
+
public:
StringList();
@@ -52,6 +54,14 @@ public:
size_t GetMaxStringLength() const;
+ typedef collection::iterator iterator;
+ typedef collection::const_iterator const_iterator;
+
+ iterator begin() { return m_strings.begin(); }
+ iterator end() { return m_strings.end(); }
+ const_iterator begin() const { return m_strings.begin(); }
+ const_iterator end() const { return m_strings.end(); }
+
std::string &operator[](size_t idx) {
// No bounds checking, verify "idx" is good prior to calling this function
return m_strings[idx];
@@ -69,7 +79,7 @@ public:
void Clear();
- void LongestCommonPrefix(std::string &common_prefix);
+ std::string LongestCommonPrefix();
void InsertStringAtIndex(size_t idx, const std::string &str);
@@ -97,14 +107,6 @@ public:
// Copy assignment for a vector of strings
StringList &operator=(const std::vector<std::string> &rhs);
- // This string list contains a list of valid auto completion strings, and the
- // "s" is passed in. "matches" is filled in with zero or more string values
- // that start with "s", and the first string to exactly match one of the
- // string values in this collection, will have "exact_matches_idx" filled in
- // to match the index, or "exact_matches_idx" will have SIZE_MAX
- size_t AutoComplete(llvm::StringRef s, StringList &matches,
- size_t &exact_matches_idx) const;
-
// Dump the StringList to the given lldb_private::Log, `log`, one item per
// line. If given, `name` will be used to identify the start and end of the
// list in the output.
@@ -125,7 +127,7 @@ public:
}
private:
- std::vector<std::string> m_strings;
+ collection m_strings;
};
} // namespace lldb_private