⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 err.cpp

📁 一个任天堂掌上游戏机NDS的源代码
💻 CPP
字号:
/*************************************************************************** DSemu - The Next Generation                                             ** Error handling through exceptions [err.cpp]                             ** Copyright Imran Nazar, 2005; released under the BSD public licence.     ***************************************************************************/// This file is quite old, so it's very well documented.#include "log.h"#include "err.h"//-------------------------------------------------------------------------// Function:   Constructor (Exception)// Purpose:    Fill private variables with blanks.// Parameters: None.Exception::Exception(){    type = ERR_UNKNOWN;    msg = std::string("");}//-------------------------------------------------------------------------// Function:   Constructor (Exception) [overload]// Purpose:    Fill private variables with supplied type and blank msg.// Parameters: exctype - Type of exceptionException::Exception(int exctype){    type = exctype;    msg = std::string("");}//-------------------------------------------------------------------------// Function:   Constructor (Exception) [overload]// Purpose:    Fill private variables with supplied values.// Parameters: exctype - Type of exception//             excmsg  - Message providing exception detailsException::Exception(int exctype, std::string excmod, std::string excmsg){    type = exctype;    module = excmod;    msg = excmsg;}//-------------------------------------------------------------------------// Function:   Non-logging print-out (Report)// Purpose:    Print error message based on contents of Exception, without//             saving to log file.// Parameters: None// Returns:    Nonevoid Exception::Report(){    char str[1024];        sprintf(str, "Error type x%04X: %s", type, msg.c_str());    #ifdef WIN32        MessageBox(NULL, str, "Emulation Error", MB_OK);    #else        fprintf(stderr, "%s\n", str);    #endif}//-------------------------------------------------------------------------// Function:   Logging print-out (Log)// Purpose:    Print error message based on Exception contents, to log.// Parameters: None// Returns:    Nonevoid Exception::Log(){    char str[1024];        sprintf(str, "Error type x%04X", type);    Logger::log(module) << str << ": " << msg;}/*** EOF: err.cpp ********************************************************/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -