📄 wz.hxx
字号:
#ifndef wz_hxx
#define wz_hxx
#include <float.h>
#ifndef wzObsoleteCode
#define wzObsoleteCode private
#else
#undef wzObsoleteCode
#define wzObsoleteCode public
#endif
#ifdef DEBUG
#define wzDebug
#endif
#define wzOffset(p_type,field) ((long unsigned int)&(((p_type)0)->field))
#define wzOffsetOf(s_type,field) wzOffset(s_type*,field)
// redeclaration of the standard type names
// #define instead of typedefs because of decladebug-problems
typedef void* wzAddress;
typedef char* wzString;
#define wzFloat double
const wzFloat wzFloatEpsilon = DBL_EPSILON;
#define wzDouble double
#define wzIndex unsigned int
#define wzInteger signed int
#define wzShort short signed int
#define wzBoolean short int
#define wzName wzString
#define wzByte unsigned char
// introduction of general self-commenting type names:
typedef long unsigned int wzFlag;
typedef wzIndex wzDimension;
typedef wzIndex wzReturnCode;
typedef wzIndex wzSize;
typedef void (*wzProcedure)(void);
class wzVoid{};
typedef void (wzVoid::*wzMethod)(void);
// some general self-commenting constants
static const wzReturnCode wzSuccess = 1;
static const wzBoolean wzFalse = 0;
static const wzBoolean wzTrue = 1;
static const wzFlag wzOff = 0;
static const wzFlag wzOn = ~0;
static const wzFloat wzNoFloat = 8.888888888888e36;
static const wzFloat wzInfty = 1.e32;
static const wzIndex wzNoIndex = 888888888;
static const wzIndex wzX = 0;
static const wzIndex wzY = 1;
static const wzIndex wzZ = 2;
static const wzIndex wzXdown = 3;
static const wzIndex wzYdown = 4;
static const wzIndex wzZdown = 5;
static const wzIndex wzXY = 2;
static const wzIndex wzYZ = 0;
static const wzIndex wzZX = 1;
static const wzIndex wzXZ = 4;
static const wzIndex wzYX = 5;
static const wzIndex wzZY = 3;
extern const wzString wzHomePath;
void wzDebugger();
class wzFailure{
public:
wzString description;
wzFailure(wzString d="unspecified"):description(d){wzDebugger();}
};
class wzDetectionFailure: public wzFailure{
public:
wzDetectionFailure(wzString d="error detection has failed")
:wzFailure(d){;}
};
class wzInternalFailure: public wzFailure{
public:
wzInternalFailure(wzString d="unspecified internal")
:wzFailure(d){;}
};
class wzAssertionFailure: public wzFailure{
public:
wzAssertionFailure(wzString d="unspecified assertion failure")
:wzFailure(d){;}
};
class wzNotEnoughMemory: public wzFailure{
public:
wzNotEnoughMemory()
:wzFailure("not enough memory"){;}
};
inline void wzFailed()
{throw wzInternalFailure();}
#ifdef wzDebug
inline void wzAssert(wzBoolean x)
//{if(!x){throw wzAssertionFailure();}}
{if(!x)wzDebugger();}
#else
#define wzAssert(x)
#endif
class wzError{
public:
wzString module;
wzString entry;
void print();
wzError(wzString m="errors",wzString e="errors");
};
class wzAssertionError: public wzError{
public: wzAssertionError():wzError("errors","AssertionError"){;}
};
class wzDetectionError: public wzError{
public: wzDetectionError():wzError("errors","DetectionError"){;}
};
class wzFileOpenError: public wzError{
public: wzFileOpenError():wzError("errors","FileOpenError"){;}
};
class wzFileReadError: public wzError{
public: wzFileReadError():wzError("errors","FileReadError"){;}
};
class wzFileWriteError: public wzError{
public: wzFileWriteError():wzError("errors","FileWriteError"){;}
};
void wzMessage(wzString);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -