Corrade::Utility::Warning class

Warning output handler.

Same as Debug, but by default writes output to standard error output. Thus it is possible to separate / mute Debug, Warning and Error outputs.

Base classes

class Debug
Debug output handler.

Public static functions

static auto defaultOutput() -> std::ostream* new in 2019.10
Default warning output stream.
static auto output() -> std::ostream*
Current warning output stream.
static auto isTty() -> bool
Whether current warning output is a TTY.

Constructors, destructors, conversion operators

Warning(Flags flags = {}) explicit
Default constructor.
Warning(std::ostream* output, Flags flags = {}) explicit
Constructor.
Warning(const Warning&) deleted
Copying is not allowed.
Warning(Warning&&) defaulted
Move constructor.
~Warning()
Destructor.

Public functions

auto operator=(const Warning&) -> Warning& deleted
Copying is not allowed.
auto operator=(Warning&&) -> Warning& deleted
Move assignment is not allowed.

Function documentation

static std::ostream* Corrade::Utility::Warning::defaultOutput() new in 2019.10

Default warning output stream.

Warning output when no output redirection happens. A pointer to std::cerr.

static std::ostream* Corrade::Utility::Warning::output()

Current warning output stream.

Warning output constructed with the Warning(Flags) constructor will be using this output stream.

static bool Corrade::Utility::Warning::isTty()

Whether current warning output is a TTY.

Calls isTty(std::ostream*) with output of enclosing Warning instance or with std::cerr if there isn't any.

Corrade::Utility::Warning::Warning(Flags flags = {}) explicit

Default constructor.

Parameters
flags Output flags

Inherits output of enclosing Warning instance or uses std::cerr if there isn't any.

Corrade::Utility::Warning::Warning(std::ostream* output, Flags flags = {}) explicit

Constructor.

Parameters
output Stream where to put warning output. If set to nullptr, no warning output will be written anywhere.
flags Output flags

All new instances created using the default Warning() constructor during lifetime of this instance will inherit the output set in output.

Corrade::Utility::Warning::~Warning()

Destructor.

Resets the output redirection back to the output of enclosing scope. If there was any output, adds newline at the end. Also resets output color modifier, if there was any.