LLDB  mainline
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
lldb_private::StreamTee Class Reference

#include <StreamTee.h>

Inheritance diagram for lldb_private::StreamTee:
Inheritance graph
[legend]
Collaboration diagram for lldb_private::StreamTee:
Collaboration graph
[legend]

Public Member Functions

 StreamTee (bool colors=false)
 
 StreamTee (lldb::StreamSP &stream_sp)
 
 StreamTee (lldb::StreamSP &stream_sp, lldb::StreamSP &stream_2_sp)
 
 StreamTee (const StreamTee &rhs)
 
 ~StreamTee () override=default
 
StreamTeeoperator= (const StreamTee &rhs)
 
void Flush () override
 Flush the stream. More...
 
size_t AppendStream (const lldb::StreamSP &stream_sp)
 
size_t GetNumStreams () const
 
lldb::StreamSP GetStreamAtIndex (uint32_t idx)
 
void SetStreamAtIndex (uint32_t idx, const lldb::StreamSP &stream_sp)
 
- Public Member Functions inherited from lldb_private::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. More...
 
 Stream (bool colors=false)
 Construct a default Stream, not binary, host byte order and host addr size. More...
 
 Stream (const Stream &other)
 
Streamoperator= (const Stream &rhs)
 
virtual ~Stream ()
 Destructor. More...
 
size_t Write (const void *src, size_t src_len)
 Output character bytes to the stream. More...
 
size_t GetWrittenBytes () const
 
size_t PutChar (char ch)
 
lldb::ByteOrder SetByteOrder (lldb::ByteOrder byte_order)
 Set the byte_order value. More...
 
size_t PrintfAsRawHex8 (const char *format,...) __attribute__((__format__(__printf__
 Format a C string from a printf style format and variable arguments and encode and append the resulting C string as hex bytes. More...
 
size_t size_t PutHex8 (uint8_t uvalue)
 Append an uint8_t value in the hexadecimal format to the stream. More...
 
size_t PutNHex8 (size_t n, uint8_t uvalue)
 
size_t PutHex16 (uint16_t uvalue, lldb::ByteOrder byte_order=lldb::eByteOrderInvalid)
 
size_t PutHex32 (uint32_t uvalue, lldb::ByteOrder byte_order=lldb::eByteOrderInvalid)
 
size_t PutHex64 (uint64_t uvalue, lldb::ByteOrder byte_order=lldb::eByteOrderInvalid)
 
size_t PutMaxHex64 (uint64_t uvalue, size_t byte_size, lldb::ByteOrder byte_order=lldb::eByteOrderInvalid)
 
size_t PutFloat (float f, lldb::ByteOrder byte_order=lldb::eByteOrderInvalid)
 
size_t PutDouble (double d, lldb::ByteOrder byte_order=lldb::eByteOrderInvalid)
 
size_t PutLongDouble (long double ld, lldb::ByteOrder byte_order=lldb::eByteOrderInvalid)
 
size_t PutPointer (void *ptr)
 
size_t PutBytesAsRawHex8 (const void *src, size_t src_len, lldb::ByteOrder src_byte_order=lldb::eByteOrderInvalid, lldb::ByteOrder dst_byte_order=lldb::eByteOrderInvalid)
 
size_t PutRawBytes (const void *s, size_t src_len, lldb::ByteOrder src_byte_order=lldb::eByteOrderInvalid, lldb::ByteOrder dst_byte_order=lldb::eByteOrderInvalid)
 
size_t PutStringAsRawHex8 (llvm::StringRef s)
 
Streamoperator<< (const char *cstr)
 Output a NULL terminated C string cstr to the stream s. More...
 
Streamoperator<< (llvm::StringRef str)
 
Streamoperator<< (const void *p)
 Output a pointer value p to the stream s. More...
 
Streamoperator<< (char ch)
 Output a character ch to the stream s. More...
 
Streamoperator<< (uint8_t uval)=delete
 
Streamoperator<< (uint16_t uval)=delete
 
Streamoperator<< (uint32_t uval)=delete
 
Streamoperator<< (uint64_t uval)=delete
 
Streamoperator<< (int8_t sval)=delete
 
Streamoperator<< (int16_t sval)=delete
 
Streamoperator<< (int32_t sval)=delete
 
Streamoperator<< (int64_t sval)=delete
 
size_t PutCString (llvm::StringRef cstr)
 Output a C string to the stream. More...
 
size_t EOL ()
 Output and End of Line character to the stream. More...
 
uint32_t GetAddressByteSize () const
 Get the address size in bytes. More...
 
FlagsGetFlags ()
 The flags accessor. More...
 
const FlagsGetFlags () const
 The flags const accessor. More...
 
lldb::ByteOrder GetByteOrder () const
 
unsigned GetIndentLevel () const
 Get the current indentation level. More...
 
size_t Indent (llvm::StringRef s="")
 Indent the current line in the stream. More...
 
void IndentLess (unsigned amount=2)
 Decrement the current indentation level. More...
 
void IndentMore (unsigned amount=2)
 Increment the current indentation level. More...
 
void Offset (uint32_t offset, const char *format="0x%8.8x: ")
 Output an offset value. More...
 
size_t Printf (const char *format,...) __attribute__((format(printf
 Output printf formatted output to the stream. More...
 
size_t size_t PrintfVarArg (const char *format, va_list args)
 
template<typename... Args>
void Format (const char *format, Args &&... args)
 
void QuotedCString (const char *cstr, const char *format="\"%s\"")
 Output a quoted C string value to the stream. More...
 
void SetAddressByteSize (uint32_t addr_size)
 Set the address size in bytes. More...
 
void SetIndentLevel (unsigned level)
 Set the current indentation level. More...
 
size_t PutSLEB128 (int64_t uval)
 Output a SLEB128 number to the stream. More...
 
size_t PutULEB128 (uint64_t uval)
 Output a ULEB128 number to the stream. More...
 
llvm::raw_ostream & AsRawOstream ()
 Returns a raw_ostream that forwards the data to this Stream object. More...
 

Protected Types

typedef std::vector< lldb::StreamSP > collection
 

Protected Member Functions

size_t WriteImpl (const void *s, size_t length) override
 Output character bytes to the stream. More...
 
- Protected Member Functions inherited from lldb_private::Stream
void _PutHex8 (uint8_t uvalue, bool add_prefix)
 

Protected Attributes

std::recursive_mutex m_streams_mutex
 
collection m_streams
 
- Protected Attributes inherited from lldb_private::Stream
Flags m_flags
 Dump flags. More...
 
uint32_t m_addr_size = 4
 Size of an address in bytes. More...
 
lldb::ByteOrder m_byte_order
 Byte order to use when encoding scalar types. More...
 
unsigned m_indent_level = 0
 Indention level. More...
 
std::size_t m_bytes_written = 0
 Number of bytes written so far. More...
 
RawOstreamForward m_forwarder
 

Additional Inherited Members

- Public Types inherited from lldb_private::Stream
enum  { eBinary = (1 << 0) }
 m_flags bit values. More...
 

Detailed Description

Definition at line 20 of file StreamTee.h.

Member Typedef Documentation

◆ collection

typedef std::vector<lldb::StreamSP> lldb_private::StreamTee::collection
protected

Definition at line 111 of file StreamTee.h.

Constructor & Destructor Documentation

◆ StreamTee() [1/4]

lldb_private::StreamTee::StreamTee ( bool  colors = false)
inline

Definition at line 22 of file StreamTee.h.

◆ StreamTee() [2/4]

lldb_private::StreamTee::StreamTee ( lldb::StreamSP &  stream_sp)
inline

Definition at line 25 of file StreamTee.h.

References m_streams.

◆ StreamTee() [3/4]

lldb_private::StreamTee::StreamTee ( lldb::StreamSP &  stream_sp,
lldb::StreamSP &  stream_2_sp 
)
inline

Definition at line 32 of file StreamTee.h.

References m_streams.

◆ StreamTee() [4/4]

lldb_private::StreamTee::StreamTee ( const StreamTee rhs)
inline

Definition at line 41 of file StreamTee.h.

References m_streams, and m_streams_mutex.

◆ ~StreamTee()

lldb_private::StreamTee::~StreamTee ( )
overridedefault

Member Function Documentation

◆ AppendStream()

size_t lldb_private::StreamTee::AppendStream ( const lldb::StreamSP &  stream_sp)
inline

Definition at line 76 of file StreamTee.h.

References m_streams, and m_streams_mutex.

◆ Flush()

void lldb_private::StreamTee::Flush ( )
inlineoverridevirtual

Flush the stream.

Subclasses should flush the stream to make any output appear if the stream has any buffering.

Implements lldb_private::Stream.

Definition at line 63 of file StreamTee.h.

References lldb_private::Stream::Flush(), m_streams, and m_streams_mutex.

◆ GetNumStreams()

size_t lldb_private::StreamTee::GetNumStreams ( ) const
inline

Definition at line 83 of file StreamTee.h.

References m_streams, and m_streams_mutex.

◆ GetStreamAtIndex()

lldb::StreamSP lldb_private::StreamTee::GetStreamAtIndex ( uint32_t  idx)
inline

◆ operator=()

StreamTee& lldb_private::StreamTee::operator= ( const StreamTee rhs)
inline

Definition at line 50 of file StreamTee.h.

References m_streams, m_streams_mutex, and lldb_private::Stream::operator=().

◆ SetStreamAtIndex()

void lldb_private::StreamTee::SetStreamAtIndex ( uint32_t  idx,
const lldb::StreamSP &  stream_sp 
)
inline

◆ WriteImpl()

size_t lldb_private::StreamTee::WriteImpl ( const void *  src,
size_t  src_len 
)
inlineoverrideprotectedvirtual

Output character bytes to the stream.

Appends src_len characters from the buffer src to the stream.

Parameters
[in]srcA buffer containing at least src_len bytes of data.
[in]src_lenA number of bytes to append to the stream.
Returns
The number of bytes that were appended to the stream.

Implements lldb_private::Stream.

Definition at line 115 of file StreamTee.h.

References m_streams, m_streams_mutex, and lldb_private::Stream::Write().

Member Data Documentation

◆ m_streams

collection lldb_private::StreamTee::m_streams
protected

◆ m_streams_mutex

std::recursive_mutex lldb_private::StreamTee::m_streams_mutex
mutableprotected

The documentation for this class was generated from the following file: