summaryrefslogtreecommitdiffstats
path: root/source/Core/StringList.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2016-01-06 20:12:03 +0000
committerdim <dim@FreeBSD.org>2016-01-06 20:12:03 +0000
commit78b9749c0a4ea980a8b934645da6ae98fcc665e8 (patch)
treedd2a1ddf0476664c2b823409c36cbccd52662ca7 /source/Core/StringList.cpp
parent60cb593f9d55fa5ca7a5372b731f2330345b4b9a (diff)
downloadFreeBSD-src-78b9749c0a4ea980a8b934645da6ae98fcc665e8.zip
FreeBSD-src-78b9749c0a4ea980a8b934645da6ae98fcc665e8.tar.gz
Vendor import of lldb trunk r256945:
https://llvm.org/svn/llvm-project/lldb/trunk@256945
Diffstat (limited to 'source/Core/StringList.cpp')
-rw-r--r--source/Core/StringList.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/source/Core/StringList.cpp b/source/Core/StringList.cpp
index 4e07ba4..ce197ac 100644
--- a/source/Core/StringList.cpp
+++ b/source/Core/StringList.cpp
@@ -11,6 +11,8 @@
#include "lldb/Core/StreamString.h"
#include "lldb/Host/FileSpec.h"
+#include "lldb/Core/Log.h"
+#include "lldb/Core/StreamString.h"
#include <string>
@@ -305,12 +307,29 @@ StringList::operator << (const char* str)
}
StringList&
+StringList::operator << (const std::string& str)
+{
+ AppendString(str);
+ return *this;
+}
+
+StringList&
StringList::operator << (StringList strings)
{
AppendList(strings);
return *this;
}
+StringList&
+StringList::operator = (const std::vector<std::string> &rhs)
+{
+ Clear();
+ for (const auto &s : rhs)
+ m_strings.push_back(s);
+
+ return *this;
+}
+
size_t
StringList::AutoComplete (const char *s, StringList &matches, size_t &exact_idx) const
{
@@ -339,3 +358,21 @@ StringList::AutoComplete (const char *s, StringList &matches, size_t &exact_idx)
return matches.GetSize();
}
+void
+StringList::LogDump(Log *log, const char *name)
+{
+ if (!log)
+ return;
+
+ StreamString strm;
+ if (name)
+ strm.Printf("Begin %s:\n", name);
+ for (const auto &s : m_strings) {
+ strm.Indent();
+ strm.Printf("%s\n", s.c_str());
+ }
+ if (name)
+ strm.Printf("End %s.\n", name);
+
+ log->Debug("%s", strm.GetData());
+}
OpenPOWER on IntegriCloud