📄 wz.cxx
字号:
//#define wzPrintError//#include <iostream.h>#include <signal.h>#include <stdlib.h>#include <math.h>#include "wz.hxx"#include "wzsafepointer.hxx"#include "wzoutput.hxx"#ifdef wzDebugstatic int maxcount=3;#elsestatic int maxcount=0;#endifextern const wzFloat wzPi = 4*atan((double)1.0);static int count=1;void wzDebugger(){ if(++count>maxcount) throw wzError("errors","InternalError");}void wzMessage(wzString s){ wzOutput::Default.operator()("<>\n")<<s;}wzError::wzError(wzString m,wzString e):module(m),entry(e) {#ifdef wzPrintError print();#else ;#endif}void wzError::print(){ wzOutput::Error<<"\nError: \"<>\"\n",entry; wzPrintDocumentationEntry(wzOutput::Error,module,entry);}wzString wzgethome(){wzString s=getenv("COG_HOME"); if(s) return s; else return "\"$COG_HOME\"";}const wzString wzHomePath = wzgethome();static void wzHandleFPE(int){ throw wzMathError();}void wzInitializeExceptionHandling(){ struct sigaction sa; int ret; sa.sa_handler = wzHandleFPE; sigemptyset(&sa.sa_mask); ret = sigaction(SIGFPE, &sa, 0);}// errors wzProxyHangingError::wzProxyHangingError() :wzError("mainwzproxytest","SafePointerHangingError"){;}wzProxyLockError::wzProxyLockError() :wzError("mainwzproxytest","SafePointerLockError"){;}wzDetectionError::wzDetectionError():wzError("errors","DetectionError"){;}wzFileOpenError::wzFileOpenError():wzError("errors","FileOpenError"){;}wzFileReadError::wzFileReadError():wzError("errors","FileReadError"){;}wzFileWriteError::wzFileWriteError():wzError("errors","FileWriteError"){;}wzAssertionError::wzAssertionError():wzError("errors","AssertionError"){;} wzNotEnoughMemory::wzNotEnoughMemory():wzFailure("not enough memory"){;}wzAssertionFailure::wzAssertionFailure(wzString d) :wzFailure(d){;}wzInternalFailure::wzInternalFailure(wzString d) :wzFailure(d){;}wzDetectionFailure::wzDetectionFailure(wzString d) :wzFailure(d){;}wzFailure::wzFailure(wzString d):description(d){wzDebugger();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -