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

📄 baseexception.h

📁 克里金、反距离插值算法_栅格图等值线填充等
💻 H
字号:
// BaseException.h: interface for the CBaseException class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_BASEEXCEPTION_H__0902F453_576E_48BB_90ED_7FC4CA666A82__INCLUDED_)
#define AFX_BASEEXCEPTION_H__0902F453_576E_48BB_90ED_7FC4CA666A82__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <stdexcept>
#include <string>
#include <iostream>

#pragma warning( disable : 4290 ) // disable Exception Specification warning

#define LOCATION Location(__FILE__, __LINE__)

/** This function returns string object of Error filename and line number */
inline std::string Location(std::string file, int lineNo) {
	char buf[64];
	sprintf(buf, " line no. %d", lineNo);

	return file + buf;
}

class BaseException : public std::runtime_error
{
public:
	BaseException() throw() : runtime_error("error") {}
	BaseException(std::string message) throw() : runtime_error(message) {}
	BaseException(std::string message, std::string location) throw() : std::runtime_error(message+location) {}
	void Log(std::ostream& os) throw() { os << what() << std::endl; }
};

#endif // !defined(AFX_BASEEXCEPTION_H__0902F453_576E_48BB_90ED_7FC4CA666A82__INCLUDED_)

⌨️ 快捷键说明

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