00001 /* vim: set et sw=3 tw=0 fo=croqlaw cino=t0: 00002 * 00003 * Astxx, the Asterisk C++ API and Utility Library. 00004 * Copyright (C) 2005-2007 Matthew A. Nicholson 00005 * Copyright (C) 2005-2007 Digium, Inc. 00006 * 00007 * This library is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public 00009 * License version 2.1 as published by the Free Software Foundation. 00010 * 00011 * This library 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 GNU 00014 * Lesser General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Lesser General Public 00017 * License along with this library; if not, write to the Free Software 00018 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 */ 00020 00036 #ifndef ASTXX_EXCEPTION_H 00037 #define ASTXX_EXCEPTION_H 00038 00039 #include <stdexcept> 00040 #include <string> 00041 00042 namespace astxx { 00047 class exception : public std::exception { 00048 public: 00050 explicit exception(const std::string& desc) throw() : std::exception(), description(desc) { } 00051 virtual ~exception() throw() { } 00053 virtual const char* what() const throw() { 00054 return description.c_str(); 00055 } 00056 private: 00057 std::string description; 00058 }; 00059 00060 } 00061 00062 #endif
1.5.6