1 | //===-- StreamAsynchronousIO.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_CORE_STREAMASYNCHRONOUSIO_H |
10 | #define LLDB_CORE_STREAMASYNCHRONOUSIO_H |
11 | |
12 | #include "lldb/Utility/Stream.h" |
13 | |
14 | #include <string> |
15 | |
16 | #include <cstddef> |
17 | |
18 | namespace lldb_private { |
19 | class Debugger; |
20 | |
21 | class StreamAsynchronousIO : public Stream { |
22 | public: |
23 | StreamAsynchronousIO(Debugger &debugger, bool for_stdout, bool colors); |
24 | |
25 | ~StreamAsynchronousIO() override; |
26 | |
27 | void Flush() override; |
28 | |
29 | protected: |
30 | size_t WriteImpl(const void *src, size_t src_len) override; |
31 | |
32 | private: |
33 | Debugger &m_debugger; |
34 | std::string m_data; |
35 | bool m_for_stdout; |
36 | }; |
37 | |
38 | } // namespace lldb_private |
39 | |
40 | #endif // LLDB_CORE_STREAMASYNCHRONOUSIO_H |
41 | |