Output formatter, typically used for debugging.
Typedefs | |
typedef void(* | Common::OutputFormatter) (char *dst, const char *src, size_t dstSize) |
typedef bool(* | Common::ErrorHandler) (const char *msg) |
Functions | |
void | Common::setErrorOutputFormatter (OutputFormatter f) |
void | Common::setErrorHandler (ErrorHandler handler) |
void NORETURN_PRE | error (MSVC_PRINTF const char *s,...) GCC_PRINTF(1 |
void | warning (MSVC_PRINTF const char *s,...) GCC_PRINTF(1 |
Variables | |
void NORETURN_PRE | NORETURN_POST |
typedef void(* Common::OutputFormatter) (char *dst, const char *src, size_t dstSize) |
typedef bool(* Common::ErrorHandler) (const char *msg) |
A callback that is invoked by error() just before aborting.
A typical example would be a function that shows a debug console and displays the given message in it.
void Common::setErrorOutputFormatter | ( | OutputFormatter | f | ) |
Set the output formatter used by error().
void Common::setErrorHandler | ( | ErrorHandler | handler | ) |
Set a callback that is invoked by error() after the error message has been printed, but before the application is terminated.
This can be used to e.g. show a debugger console.
void NORETURN_PRE error | ( | MSVC_PRINTF const char * | s, |
... | |||
) |
Print an error message to the text console and then terminate the process.
void warning | ( | MSVC_PRINTF const char * | s, |
... | |||
) |
Print a warning message to the text console (stderr).
Automatically prepends the text "WARNING: " and appends an exclamation mark and a newline.