LLDB
mainline
llvm-project
lldb
include
lldb
Core
StreamAsynchronousIO.h
Go to the documentation of this file.
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
/// A stream meant for asynchronously printing output. Output is buffered until
22
/// the stream is flushed or destroyed. Printing is handled by the currently
23
/// active IOHandler, or the debugger's output or error stream if there is none.
24
class
StreamAsynchronousIO
:
public
Stream
{
25
public
:
26
enum
ForSTDOUT
:
bool
{
27
STDOUT
=
true
,
28
STDERR
=
false
,
29
};
30
31
StreamAsynchronousIO
(
Debugger
&debugger, ForSTDOUT for_stdout);
32
33
~StreamAsynchronousIO
()
override
;
34
35
void
Flush
()
override
;
36
37
protected
:
38
size_t
WriteImpl
(
const
void
*src,
size_t
src_len)
override
;
39
40
private
:
41
Debugger
&
m_debugger
;
42
std::string
m_data
;
43
ForSTDOUT
m_for_stdout
;
44
};
45
46
}
// namespace lldb_private
47
48
#endif
// LLDB_CORE_STREAMASYNCHRONOUSIO_H
Stream.h
lldb_private::Debugger
A class to manage flag bits.
Definition
Debugger.h:80
lldb_private::StreamAsynchronousIO::Flush
void Flush() override
Flush the stream.
Definition
StreamAsynchronousIO.cpp:27
lldb_private::StreamAsynchronousIO::m_for_stdout
ForSTDOUT m_for_stdout
Definition
StreamAsynchronousIO.h:43
lldb_private::StreamAsynchronousIO::m_data
std::string m_data
Definition
StreamAsynchronousIO.h:42
lldb_private::StreamAsynchronousIO::StreamAsynchronousIO
StreamAsynchronousIO(Debugger &debugger, ForSTDOUT for_stdout)
Definition
StreamAsynchronousIO.cpp:17
lldb_private::StreamAsynchronousIO::WriteImpl
size_t WriteImpl(const void *src, size_t src_len) override
Output character bytes to the stream.
Definition
StreamAsynchronousIO.cpp:34
lldb_private::StreamAsynchronousIO::m_debugger
Debugger & m_debugger
Definition
StreamAsynchronousIO.h:41
lldb_private::StreamAsynchronousIO::~StreamAsynchronousIO
~StreamAsynchronousIO() override
Definition
StreamAsynchronousIO.cpp:22
lldb_private::StreamAsynchronousIO::ForSTDOUT
ForSTDOUT
Definition
StreamAsynchronousIO.h:26
lldb_private::StreamAsynchronousIO::STDERR
@ STDERR
Definition
StreamAsynchronousIO.h:28
lldb_private::StreamAsynchronousIO::STDOUT
@ STDOUT
Definition
StreamAsynchronousIO.h:27
lldb_private::Stream::Stream
Stream(uint32_t flags, uint32_t addr_size, lldb::ByteOrder byte_order, bool colors=false)
Construct with flags and address size and byte order.
Definition
Stream.cpp:27
lldb_private
A class that represents a running process on the host machine.
Definition
SBAddressRange.h:14
Generated on
for LLDB by
1.14.0