JX Application Framework
|
#include <JAssertBase.h>
Public Types | |
enum | Action { kIgnoreFailure , kAbort , kAskUser } |
Public Member Functions | |
JAssertBase () | |
virtual | ~JAssertBase () |
virtual int | Assert (const JUtf8Byte *expr, const JUtf8Byte *file, const int line, const JUtf8Byte *message, const JUtf8Byte *function)=0 |
virtual void | Abort () |
Static Public Member Functions | |
static int | DefaultAssert (const JUtf8Byte *expr, const JUtf8Byte *file, const int line, const JUtf8Byte *message, const JUtf8Byte *function) |
static Action | GetAction () |
static void | SetAction (const Action action) |
Base class for reporting fatal errors
Base class for global object that handles assert() macro. To use this system, create a derived class and pass it to JInitCore(). Derived classes must override Assert(). This returns zero if the program is supposed to continue. Otherwise, it should call abort(). DefaultAssert() uses the environment variable J_ASSERT_ACTION to determine how the assert() macro behaves: "ask_user" prints message and asks "abort or continue?" any other value prints message and calls abort() undefined prints message and calls abort() "silent" ignores the failure (unsafe if assert() is used correctly) This action is settable at run-time via SetAction().
enum JAssertBase::Action |
JAssertBase::JAssertBase | ( | ) |
|
virtual |
|
virtual |
Derived classes can override this to perform clean-up.
Reimplemented in JXAssert.
|
pure virtual |
Implemented in JXAssert.
|
static |
|
static |
|
static |
We can't call unsetenv() because SunOS 4.1.4 doesn't have it.