diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2016-01-06 20:12:03 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2016-01-06 20:12:03 +0000 |
commit | 9e6d35490a6542f9c97607f93c2ef8ca8e03cbcc (patch) | |
tree | dd2a1ddf0476664c2b823409c36cbccd52662ca7 /include/lldb/Core/StringList.h | |
parent | 3bd2e91faeb9eeec1aae82c64a3253afff551cfd (diff) |
Notes
Diffstat (limited to 'include/lldb/Core/StringList.h')
-rw-r--r-- | include/lldb/Core/StringList.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/lldb/Core/StringList.h b/include/lldb/Core/StringList.h index 3e341b994075..53bdb6994a56 100644 --- a/include/lldb/Core/StringList.h +++ b/include/lldb/Core/StringList.h @@ -133,8 +133,15 @@ public: operator << (const char* str); StringList& + operator << (const std::string &s); + + StringList& operator << (StringList strings); + // 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 @@ -147,6 +154,23 @@ public: 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. + virtual void LogDump(Log *log, const char *name = nullptr); + + // Static helper to convert an iterable of strings to a StringList, and then + // dump it with the semantics of the `LogDump` method. + template<typename T> static void LogDump(Log *log, T s_iterable, const char *name = nullptr) + { + if (!log) + return; + // Make a copy of the iterable as a StringList + StringList l{}; + for (const auto &s : s_iterable) + l << s; + + l.LogDump(log, name); + } private: STLStringArray m_strings; }; |