📄 warexception.cpp
字号:
#include "StdAfx.h"#include "WarException.h" // class implemented#ifndef WAR_ITOA_H# include "WarItoa.h"#endifusing namespace std;/////////////////////////////// PUBLIC /////////////////////////////////////////============================= LIFECYCLE ====================================WarException::WarException(const war_error_definitions local_error, const int system_error, war_ccstr_t message, war_ccstr_t source_file, const int source_line) : WarError(local_error, system_error, source_file, source_line), mMessage(message ? message : ""){}// WarExceptionWarException::WarException(const WarException& from): WarError(from),mMessage(from.mMessage){}// WarExceptionWarException::WarException(const WarError& err, war_ccstr_t message) : WarError(err), mMessage(message ? message : ""){}WarException::~WarException() throw(){}// ~WarException//============================= OPERATORS ====================================//============================= OPERATIONS ===================================const std::string& WarException::Explain() const{ if (mMessageBuf.empty()) { std::string msg, tmp_str; msg = "Exception from "; msg += GetFile(); msg += " line "; msg += WarItoa(tmp_str, GetLine()); msg += " caused by "; msg += WarError::Explain(); if (!msg.empty()) { msg += " ["; msg += mMessage; msg += ']'; } (std::string &)mMessageBuf = msg; } return mMessageBuf;}const char *WarException::what() const throw(){ return Explain().c_str();}//============================= ACESS ===================================//============================= INQUIRY ===================================/////////////////////////////// PROTECTED ////////////////////////////////////////////////////////////////// PRIVATE ///////////////////////////////////
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -