class raw_ostream
Declaration
class raw_ostream { /* full declaration omitted */ };
Description
This class implements an extremely fast bulk output stream that can *only* output to a stream. It does not support seeking, reopening, rewinding, line buffered disciplines etc. It is a simple buffer that outputs a chunk at a time.
Declared at: llvm/include/llvm/Support/raw_ostream.h:46
Member Variables
- public static const llvm::raw_ostream::Colors BLACK = Colors::BLACK
- public static const llvm::raw_ostream::Colors RED = Colors::RED
- public static const llvm::raw_ostream::Colors GREEN = Colors::GREEN
- public static const llvm::raw_ostream::Colors YELLOW = Colors::YELLOW
- public static const llvm::raw_ostream::Colors BLUE = Colors::BLUE
- public static const llvm::raw_ostream::Colors MAGENTA = Colors::MAGENTA
- public static const llvm::raw_ostream::Colors CYAN = Colors::CYAN
- public static const llvm::raw_ostream::Colors WHITE = Colors::WHITE
- public static const llvm::raw_ostream::Colors SAVEDCOLOR = Colors::SAVEDCOLOR
- public static const llvm::raw_ostream::Colors RESET = Colors::RESET
Method Overview
- public size_t GetBufferSize() const
- public size_t GetNumBytesInBuffer() const
- protected void SetBuffer(char * BufferStart, size_t Size)
- public void SetBufferSize(size_t Size)
- public void SetBuffered()
- public void SetUnbuffered()
- public virtual llvm::raw_ostream & changeColor(enum Colors Color, bool Bold = false, bool BG = false)
- public virtual void enable_colors(bool)
- public void flush()
- protected const char * getBufferStart() const
- public virtual bool has_colors() const
- public llvm::raw_ostream & indent(unsigned int NumSpaces)
- public virtual bool is_displayed() const
- protected virtual size_t preferred_buffer_size() const
- public raw_ostream(const llvm::raw_ostream &)
- public raw_ostream(bool unbuffered = false)
- public virtual llvm::raw_ostream & resetColor()
- public virtual llvm::raw_ostream & reverseColor()
- public uint64_t tell() const
- public llvm::raw_ostream & write(const char * Ptr, size_t Size)
- public llvm::raw_ostream & write(unsigned char C)
- public llvm::raw_ostream & write_escaped(llvm::StringRef Str, bool UseHexEscapes = false)
- public llvm::raw_ostream & write_hex(unsigned long long N)
- public llvm::raw_ostream & write_uuid(const uint8_t * UUID)
- public llvm::raw_ostream & write_zeros(unsigned int NumZeros)
- public virtual ~raw_ostream()
Methods
¶size_t GetBufferSize() const
size_t GetBufferSize() const
Declared at: llvm/include/llvm/Support/raw_ostream.h:129
¶size_t GetNumBytesInBuffer() const
size_t GetNumBytesInBuffer() const
Declared at: llvm/include/llvm/Support/raw_ostream.h:147
¶void SetBuffer(char* BufferStart, size_t Size)
void SetBuffer(char* BufferStart, size_t Size)
Description
Use the provided buffer as the raw_ostream buffer. This is intended for use only by subclasses which can arrange for the output to go directly into the desired output buffer, instead of being copied on each flush.
Declared at: llvm/include/llvm/Support/raw_ostream.h:329
Parameters
- char* BufferStart
- size_t Size
¶void SetBufferSize(size_t Size)
void SetBufferSize(size_t Size)
Description
Set the stream to be buffered, using the specified buffer size.
Declared at: llvm/include/llvm/Support/raw_ostream.h:124
Parameters
- size_t Size
¶void SetBuffered()
void SetBuffered()
Description
Set the stream to be buffered, with an automatically determined buffer size.
Declared at: llvm/include/llvm/Support/raw_ostream.h:121
¶void SetUnbuffered()
void SetUnbuffered()
Description
Set the stream to be unbuffered. When unbuffered, the stream will flush after every write. This routine will also flush the buffer immediately when the stream is being set to unbuffered.
Declared at: llvm/include/llvm/Support/raw_ostream.h:142
¶virtual llvm::raw_ostream& changeColor(
enum Colors Color,
bool Bold = false,
bool BG = false)
virtual llvm::raw_ostream& changeColor(
enum Colors Color,
bool Bold = false,
bool BG = false)
Description
Changes the foreground color of text that will be output from this point forward.
Declared at: llvm/include/llvm/Support/raw_ostream.h:273
Parameters
- enum Colors Color
- ANSI color to use, the special SAVEDCOLOR can be used to change only the bold attribute, and keep colors untouched
- bool Bold = false
- bold/brighter text, default false
- bool BG = false
- if true change the background, default: change foreground
Returns
itself so it can be used within < < invocations
¶virtual void enable_colors(bool)
virtual void enable_colors(bool)
Declared at: llvm/include/llvm/Support/raw_ostream.h:299
Parameters
- bool
¶void flush()
void flush()
Declared at: llvm/include/llvm/Support/raw_ostream.h:155
¶const char* getBufferStart() const
const char* getBufferStart() const
Description
Return the beginning of the current stream buffer, or 0 if the stream is unbuffered.
Declared at: llvm/include/llvm/Support/raw_ostream.h:338
¶virtual bool has_colors() const
virtual bool has_colors() const
Description
This function determines if this stream is displayed and supports colors.
Declared at: llvm/include/llvm/Support/raw_ostream.h:295
¶llvm::raw_ostream& indent(unsigned int NumSpaces)
llvm::raw_ostream& indent(unsigned int NumSpaces)
Description
indent - Insert 'NumSpaces' spaces.
Declared at: llvm/include/llvm/Support/raw_ostream.h:261
Parameters
- unsigned int NumSpaces
¶virtual bool is_displayed() const
virtual bool is_displayed() const
Description
This function determines if this stream is connected to a "tty" or "console" window. That is, the output would be displayed to the user rather than being put on a pipe or stored in a file.
Declared at: llvm/include/llvm/Support/raw_ostream.h:292
¶virtual size_t preferred_buffer_size() const
virtual size_t preferred_buffer_size() const
Description
Return an efficient buffer size for the underlying output mechanism.
Declared at: llvm/include/llvm/Support/raw_ostream.h:334
¶raw_ostream(const llvm::raw_ostream&)
raw_ostream(const llvm::raw_ostream&)
Declared at: llvm/include/llvm/Support/raw_ostream.h:107
Parameters
- const llvm::raw_ostream&
¶raw_ostream(bool unbuffered = false)
raw_ostream(bool unbuffered = false)
Declared at: llvm/include/llvm/Support/raw_ostream.h:100
Parameters
- bool unbuffered = false
¶virtual llvm::raw_ostream& resetColor()
virtual llvm::raw_ostream& resetColor()
Description
Resets the colors to terminal defaults. Call this when you are done outputting colored text, or before program exit.
Declared at: llvm/include/llvm/Support/raw_ostream.h:284
¶virtual llvm::raw_ostream& reverseColor()
virtual llvm::raw_ostream& reverseColor()
Description
Reverses the foreground and background colors.
Declared at: llvm/include/llvm/Support/raw_ostream.h:287
¶uint64_t tell() const
uint64_t tell() const
Description
tell - Return the current offset with the file.
Declared at: llvm/include/llvm/Support/raw_ostream.h:113
¶llvm::raw_ostream& write(const char* Ptr,
size_t Size)
llvm::raw_ostream& write(const char* Ptr,
size_t Size)
Declared at: llvm/include/llvm/Support/raw_ostream.h:243
Parameters
- const char* Ptr
- size_t Size
¶llvm::raw_ostream& write(unsigned char C)
llvm::raw_ostream& write(unsigned char C)
Declared at: llvm/include/llvm/Support/raw_ostream.h:242
Parameters
- unsigned char C
¶llvm::raw_ostream& write_escaped(
llvm::StringRef Str,
bool UseHexEscapes = false)
llvm::raw_ostream& write_escaped(
llvm::StringRef Str,
bool UseHexEscapes = false)
Description
Output \p Str, turning ' \ ', '\t', '\n', '"', and anything that doesn't satisfy llvm::isPrint into an escape sequence.
Declared at: llvm/include/llvm/Support/raw_ostream.h:240
Parameters
- llvm::StringRef Str
- bool UseHexEscapes = false
¶llvm::raw_ostream& write_hex(unsigned long long N)
llvm::raw_ostream& write_hex(unsigned long long N)
Description
Output \p N in hexadecimal, without any prefix or padding.
Declared at: llvm/include/llvm/Support/raw_ostream.h:229
Parameters
- unsigned long long N
¶llvm::raw_ostream& write_uuid(const uint8_t* UUID)
llvm::raw_ostream& write_uuid(const uint8_t* UUID)
Declared at: llvm/include/llvm/Support/raw_ostream.h:236
Parameters
- const uint8_t* UUID
¶llvm::raw_ostream& write_zeros(
unsigned int NumZeros)
llvm::raw_ostream& write_zeros(
unsigned int NumZeros)
Description
write_zeros - Insert 'NumZeros' nulls.
Declared at: llvm/include/llvm/Support/raw_ostream.h:264
Parameters
- unsigned int NumZeros
¶virtual ~raw_ostream()
virtual ~raw_ostream()
Declared at: llvm/include/llvm/Support/raw_ostream.h:110