summaryrefslogtreecommitdiffstats
path: root/lldb/source/Utility/StreamCallback.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-03-06 18:34:25 +0000
committerZachary Turner <zturner@google.com>2017-03-06 18:34:25 +0000
commitfb1a0a0d2facc5cff81fad4e9dcd18b176bcf37a (patch)
tree5a9c74e955efc762e1818fb4b45020758b2684dc /lldb/source/Utility/StreamCallback.cpp
parent75e0b91e597f97ee8f32f56984988ab55fbfa067 (diff)
downloadbcm5719-llvm-fb1a0a0d2facc5cff81fad4e9dcd18b176bcf37a.tar.gz
bcm5719-llvm-fb1a0a0d2facc5cff81fad4e9dcd18b176bcf37a.zip
Move many other files from Core -> Utility.
llvm-svn: 297043
Diffstat (limited to 'lldb/source/Utility/StreamCallback.cpp')
-rw-r--r--lldb/source/Utility/StreamCallback.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/lldb/source/Utility/StreamCallback.cpp b/lldb/source/Utility/StreamCallback.cpp
new file mode 100644
index 00000000000..854cf4b55fa
--- /dev/null
+++ b/lldb/source/Utility/StreamCallback.cpp
@@ -0,0 +1,21 @@
+//===-- StreamCallback.cpp -------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Utility/StreamCallback.h"
+
+using namespace lldb_private;
+
+StreamCallback::StreamCallback(lldb::LogOutputCallback callback, void *baton)
+ : llvm::raw_ostream(true), m_callback(callback), m_baton(baton) {}
+
+void StreamCallback::write_impl(const char *Ptr, size_t Size) {
+ m_callback(std::string(Ptr, Size).c_str(), m_baton);
+}
+
+uint64_t StreamCallback::current_pos() const { return 0; }
OpenPOWER on IntegriCloud