An RAII object that temporarily switches an output stream to a specific color.

Synopsis

Declared in <llvm/Support/WithColor.h>

class WithColor;

Type Aliases

Name

Description

AutoDetectFunctionType

Predicate that decides whether colors should be auto‐enabled for a stream.

Member Functions

Name

Description

WithColor [constructor]

Constructors

~WithColor [destructor]

Restore the stream's previous color state.

changeColor

Change the color of text that will be output from this point forward.

colorsEnabled

Determine whether colors are displayed.

get

Return the underlying output stream.

resetColor

Reset the colors to terminal defaults. Call this when you are done outputting colored text, or before program exit.

operator raw_ostream&

Convert to the underlying output stream.

operator<<

Write O to the colored stream and return this wrapper.

Static Member Functions

Name

Description

defaultAutoDetectFunction

Retrieve the default color auto detection function.

defaultErrorHandler

Implement default handling for Error. Print "error: " to stderr.

defaultWarningHandler

Implement default handling for Warning. Print "warning: " to stderr.

error

error overloads

note

note overloads

remark

remark overloads

setAutoDetectFunction

Change the global auto detection function.

warning

warning overloads

Created with MrDocs