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

📄 throwable.h

📁 这个是symbian下的一个蛮庞大的3D游戏源代码!对于学习3D开发的人有很大的帮助!
💻 H
字号:
#ifndef _LANG_THROWABLE_H
#define _LANG_THROWABLE_H


#include "dprintf.h"
#include <lang/Format.h>


void internalError( const char* fname, int line, const char* expr );


namespace lang
{


/**
 * Base class for all exceptions.
 * 
 * @ingroup lang
 */
class Throwable
{
public:
	/** Creates throwable object with no error description. */
	Throwable();

	/** Creates throwable object with error description. */
	Throwable( const Format& msg );

	/** Returns the error message string. */
	const Format& getMessage() const;

private:
	Format	m_msg;
};

/** 
 * Wrapper for throwing exceptions.
 * Can be made 'work' also on platforms which do not support exceptions.
 */
template <class T> void throwError( T e )
{
	dprintf( "%s\n", e.getMessage().format().c_str() );
#ifdef _WINDOWS
	throw e;
#else
	::internalError( __FILE__, __LINE__, "" );
#endif
}


} // lang


#endif // _LANG_THROWABLE_H


⌨️ 快捷键说明

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