Index: include/lldb/Core/StringList.h =================================================================== --- include/lldb/Core/StringList.h +++ include/lldb/Core/StringList.h @@ -133,6 +133,9 @@ operator << (const char* str); StringList& + operator << (const std::string &s); + + StringList& operator << (StringList strings); // Copy assignment for a vector of strings @@ -157,7 +160,17 @@ // Static helper to convert an iterable of strings to a StringList, and then // dump it with the semantics of the `LogDump` method. - template static void LogDump(Log *log, T s_iterable, const char *name = nullptr); + template 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; }; Index: source/Core/StringList.cpp =================================================================== --- source/Core/StringList.cpp +++ source/Core/StringList.cpp @@ -306,6 +306,13 @@ } StringList& +StringList::operator << (const std::string& str) +{ + AppendString(str); + return *this; +} + +StringList& StringList::operator << (StringList strings) { AppendList(strings); @@ -362,16 +369,3 @@ if (name) log->Debug("End %s.", name); } - -templatevoid -StringList::LogDump(Log *log, T s_iterable, const char *name) -{ - 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); -}