1 //===-- StreamCallback.h -----------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef liblldb_StreamCallback_h_
10 #define liblldb_StreamCallback_h_
12 #include "lldb/lldb-types.h"
13 #include "llvm/Support/raw_ostream.h"
18 namespace lldb_private {
20 class StreamCallback : public llvm::raw_ostream {
22 StreamCallback(lldb::LogOutputCallback callback, void *baton);
23 ~StreamCallback() override = default;
26 lldb::LogOutputCallback m_callback;
29 void write_impl(const char *Ptr, size_t Size) override;
30 uint64_t current_pos() const override;
33 } // namespace lldb_private
35 #endif // liblldb_StreamCallback_h