1 //===-- StreamCallback.cpp -------------------------------------*- 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 #include "lldb/Utility/StreamCallback.h"
14 using namespace lldb_private;
16 StreamCallback::StreamCallback(lldb::LogOutputCallback callback, void *baton)
17 : llvm::raw_ostream(true), m_callback(callback), m_baton(baton) {}
19 void StreamCallback::write_impl(const char *Ptr, size_t Size) {
20 m_callback(std::string(Ptr, Size).c_str(), m_baton);
23 uint64_t StreamCallback::current_pos() const { return 0; }