53 virtual void Print(
const char *str);
63 void Fail(
const char *fmt, ...);
81 void Modal(
int type,
const char *message);
129#define ASSERT(cond) \
132 TheDebug.Fail("File: %s Line: %d Error: %s\n", __FILE__, __LINE__, #cond); \
143#define ASSERT_RANGE(x, low, high) ASSERT((low) <= (x) && (x) < (high))
void(* ModalCallbackFunc)(int &type, const char *message)
Handler that replaces the message box of Debug::Modal().
Definition Debug.h:15
void DebugPrint(const char *fmt,...)
Format a diagnostic message that this build discards.
Stream for diagnostic text, written to standard output or to a log file.
Definition debug.h:18
void StopLog()
Close the log.
bool mFailing
Definition Debug.h:100
virtual ~Debug()
Close the log.
bool mThrowOnFail
Definition Debug.h:101
ModalType
Kinds of message Modal() shows.
Definition Debug.h:26
@ kModalNotify
Definition Debug.h:28
@ kModalCancelable
Definition Debug.h:29
@ kModalFail
Definition Debug.h:27
void Notify(const char *fmt,...)
Show a notice.
void Modal(int type, const char *message)
Show a message through mModalCallback or a message box, and exit when the message remains a failure.
Debug()
Create the stream with output enabled and no log.
void StartLog(const char *file)
Close any log and open a new one.
virtual void Print(const char *str)
Write text to the log, converting each line feed to a carriage return and a line feed,...
void Fail(const char *fmt,...)
Report a failure and exit, or throw the message when mThrowOnFail is set.
BinStream that reads or writes a file.
Definition filestream.h:14
Text output stream.
Definition prnstream.h:16
Debug TheDebug
The diagnostic stream.