Files
llvm-project/lldb/source/Utility/StreamCallback.cpp
T

24 lines
764 B
C++
Raw Normal View History

//===-- StreamCallback.cpp -------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
2017-03-06 18:34:25 +00:00
#include "lldb/Utility/StreamCallback.h"
2017-04-06 18:12:24 +00:00
#include <string>
using namespace lldb_private;
StreamCallback::StreamCallback(lldb::LogOutputCallback callback, void *baton)
2017-02-10 11:49:21 +00:00
: llvm::raw_ostream(true), m_callback(callback), m_baton(baton) {}
2017-02-10 11:49:21 +00:00
void StreamCallback::write_impl(const char *Ptr, size_t Size) {
m_callback(std::string(Ptr, Size).c_str(), m_baton);
}
2017-02-10 11:49:21 +00:00
uint64_t StreamCallback::current_pos() const { return 0; }