LLDB  mainline
StreamCallback.h
Go to the documentation of this file.
1 //===-- StreamCallback.h -----------------------------------*- C++ -*-===//
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 
9 #ifndef LLDB_UTILITY_STREAMCALLBACK_H
10 #define LLDB_UTILITY_STREAMCALLBACK_H
11 
12 #include "lldb/lldb-types.h"
13 #include "llvm/Support/raw_ostream.h"
14 
15 #include <cstddef>
16 #include <cstdint>
17 
18 namespace lldb_private {
19 
20 class StreamCallback : public llvm::raw_ostream {
21 public:
22  StreamCallback(lldb::LogOutputCallback callback, void *baton);
23  ~StreamCallback() override = default;
24 
25 private:
27  void *m_baton;
28 
29  void write_impl(const char *Ptr, size_t Size) override;
30  uint64_t current_pos() const override;
31 };
32 
33 } // namespace lldb_private
34 
35 #endif // LLDB_UTILITY_STREAMCALLBACK_H
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::~StreamCallback
~StreamCallback() override=default
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
lldb-types.h
lldb_private::StreamCallback
Definition: StreamCallback.h:20
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16