00001 /* 00002 * exception.h 00003 * This file is part of dbPager Classes Library (DCL) 00004 * 00005 * Copyright (c) 2008 Dennis Prochko <wolfsoft@mail.ru> 00006 * 00007 * DCL is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation version 3. 00010 * 00011 * DCL is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with DCL; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin St, Fifth Floor, 00019 * Boston, MA 02110-1301 USA 00020 */ 00021 00022 #ifndef _EXCEPTION_H_ 00023 #define _EXCEPTION_H_ 00024 00025 #include <exception> 00026 #include <string> 00027 00028 namespace dbp { 00029 00031 00035 class exception: public std::exception { 00036 public: 00038 exception(const std::string &msg = "") throw(): _msg(msg) { } 00040 virtual ~exception() throw() { } 00042 00046 virtual const char* what() const throw() { 00047 return _msg.c_str(); 00048 } 00049 protected: 00050 const std::string& get_message() const throw() { 00051 return _msg; 00052 } 00053 private: 00054 std::string _msg; 00055 }; 00056 00057 } // namespace 00058 00059 #endif /*_EXCEPTION_H_*/