LLDB  mainline
StreamCallback.cpp
Go to the documentation of this file.
1 //===-- StreamCallback.cpp ------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
10 
11 #include <string>
12 
13 using namespace lldb_private;
14 
16  : llvm::raw_ostream(true), m_callback(callback), m_baton(baton) {}
17 
18 void StreamCallback::write_impl(const char *Ptr, size_t Size) {
19  m_callback(std::string(Ptr, Size).c_str(), m_baton);
20 }
21 
22 uint64_t StreamCallback::current_pos() const { return 0; }
llvm
Definition: Debugger.h:49
lldb_private::StreamCallback::current_pos
uint64_t current_pos() const override
Definition: StreamCallback.cpp:22
lldb::LogOutputCallback
void(* LogOutputCallback)(const char *, void *baton)
Definition: lldb-types.h:70
lldb_private::StreamCallback::StreamCallback
StreamCallback(lldb::LogOutputCallback callback, void *baton)
Definition: StreamCallback.cpp:15
lldb_private::StreamCallback::write_impl
void write_impl(const char *Ptr, size_t Size) override
Definition: StreamCallback.cpp:18
lldb_private::StreamCallback::m_baton
void * m_baton
Definition: StreamCallback.h:27
lldb_private::StreamCallback::m_callback
lldb::LogOutputCallback m_callback
Definition: StreamCallback.h:26
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:39
StreamCallback.h
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16