1 //===-- StringList.h --------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_StringList_h_
11 #define liblldb_StringList_h_
15 #include "lldb/Core/STLUtils.h"
16 #include "lldb/lldb-forward.h"
18 namespace lldb_private {
26 StringList (const char *str);
28 StringList (const char **strv, int strc);
34 AppendString (const std::string &s);
37 AppendString (std::string &&s);
40 AppendString (const char *str);
43 AppendString (const char *str, size_t str_len);
46 AppendList (const char ** strv, int strc);
49 AppendList (StringList strings);
52 ReadFileLines (FileSpec &input_file);
64 GetMaxStringLength () const;
67 operator [](size_t idx)
69 // No bounds checking, verify "idx" is good prior to calling this function
70 return m_strings[idx];
74 operator [](size_t idx) const
76 // No bounds checking, verify "idx" is good prior to calling this function
77 return m_strings[idx];
86 GetStringAtIndex (size_t idx) const;
89 Join (const char *separator, Stream &strm);
95 LongestCommonPrefix (std::string &common_prefix);
98 InsertStringAtIndex (size_t idx, const std::string &str);
101 InsertStringAtIndex (size_t idx, std::string &&str);
104 InsertStringAtIndex (size_t id, const char *str);
107 DeleteStringAtIndex (size_t id);
113 SplitIntoLines (const std::string &lines);
116 SplitIntoLines (const char *lines, size_t len);
119 CopyList(const char* item_preamble = NULL,
120 const char* items_sep = "\n") const;
123 operator << (const char* str);
126 operator << (StringList strings);
128 // This string list contains a list of valid auto completion
129 // strings, and the "s" is passed in. "matches" is filled in
130 // with zero or more string values that start with "s", and
131 // the first string to exactly match one of the string
132 // values in this collection, will have "exact_matches_idx"
133 // filled in to match the index, or "exact_matches_idx" will
136 AutoComplete (const char *s,
138 size_t &exact_matches_idx) const;
142 STLStringArray m_strings;
145 } // namespace lldb_private
147 #endif // liblldb_StringList_h_