91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 1KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-05-05
  • 語言: 其他
  • 標簽: qt??c++??異常??

資源簡介

實現了異常管理流程,實現方法詳細見頭文件
try
{
std::cout << "Hello World!\n";
}
catch (Exception * ex)
{
cout << "Ex:" <Message.c_str() << endl;
}

資源截圖

代碼片段和文件信息

#include?“Exception.h“

using?namespace?QtSharp;

Exception*?Exception::_exception?=?0;

Exception*?Exception::Instance()
{
if?(_exception?==?0)
{
_exception?=?new?Exception();
}
return?_exception;
}

void?Exception::SetMessage(string?file?int?line?string?function?string?msg)
{
char?tmp[64];
sprintf(tmp?“%d“?line);
Message?=?“發生異常,文件:“+file?+?“\t行:“?+?tmp?+?“\t方法:“?+?function?+?“\t描述:“?+?msg;
}

Exception::Exception():Message(““)
{
}

Exception::~Exception()
{
if?(_exception?!=?0)
{
delete?_exception;
_exception?=?0;
}
}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????598??2019-10-02?11:05??Exception.cpp
?????文件?????????780??2019-10-02?11:03??Exception.h

評論

共有 條評論