📄 wg_error.h
字号:
// wg_error.h//// wGui error classes////// Copyright (c) 2002 Rob Wiskow// rob-dev@boxedchaos.com//// This library is free software; you can redistribute it and/or// modify it under the terms of the GNU Lesser General Public// License as published by the Free Software Foundation; either// version 2.1 of the License, or (at your option) any later version.//// This library is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU// Lesser General Public License for more details.//// You should have received a copy of the GNU Lesser General Public// License along with this library; if not, write to the Free Software// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA//// This is for all the exception classes that are used in wGui#ifndef _WG_ERROR_H_#define _WG_ERROR_H_#include <exception>#include <string>namespace wGui{//! All wGui exception classes are derived from hereclass Wg_Ex_Base : public std::exception{public: //! \param sWhat A string for more information on what caused the exception Wg_Ex_Base(const std::string& sWhat) : m_sWhat(sWhat) { } //! Standard Destructor virtual ~Wg_Ex_Base(void) throw() { } //! \return A string describing what caused the exception virtual const char* what() const throw() { return m_sWhat.c_str(); } //! \return A std::string reference describing what caused the exception virtual const std::string& std_what() const throw() { return m_sWhat; }private: std::string m_sWhat;};//! Exceptions caused by SDL errorsclass Wg_Ex_SDL : public Wg_Ex_Base{public: //! \param sWhat A string for more information on what caused the exception Wg_Ex_SDL(const std::string& sWhat) : Wg_Ex_Base(sWhat) { }};//! Exceptions caused by FreeType errorsclass Wg_Ex_FreeType : public Wg_Ex_Base{public: //! \param sWhat A string for more information on what caused the exception Wg_Ex_FreeType(const std::string& sWhat) : Wg_Ex_Base(sWhat) { }};//! General wGui errorsclass Wg_Ex_App : public Wg_Ex_Base{public: //! \param sWhat A string for more information on what caused the exception Wg_Ex_App(const std::string& sWhat) : Wg_Ex_Base(sWhat) { }};//! Exceptions caused by out-of-range type errorsclass Wg_Ex_Range : public Wg_Ex_Base{public: //! \param sWhat A string for more information on what caused the exception Wg_Ex_Range(const std::string& sWhat) : Wg_Ex_Base(sWhat) { }};}#endif // _WG_ERROR_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -