00001 /***************************************************************************\ 00002 * Copyright (C) by University Paris-Est - MISS team 00003 * ImageException.hpp created in 09 2008. 00004 * Mail : biri@univ-mlv.fr 00005 * 00006 * This file is part of the OpenKraken-image. 00007 * 00008 * The OpenKraken-image is free software; you can redistribute it and/or modify 00009 * it under the terms of the GNU Lesser General Public License as published by 00010 * the Free Software Foundation; either version 3 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * The OpenKraken-image is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public License 00019 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00020 * 00021 \***************************************************************************/ 00022 00023 /* 00024 * Anti-doublon 00025 */ 00026 #ifndef __OPENKN_IMAGE__IMAGEEXCEPTION_HPP__ 00027 #define __OPENKN_IMAGE__IMAGEEXCEPTION_HPP__ 00028 00029 //#if defined(_MSC_VER) && (_MSC_VER >= 1020) 00030 //#pragma warning(disable:4996) 00031 //#endif 00032 00033 /* 00034 * External Includes 00035 */ 00036 #include <iostream> 00037 #include <string> 00038 #include <exception> 00039 00040 00041 /* 00042 * Internal Includes 00043 */ 00044 00045 /* 00046 * Namespace 00047 */ 00048 namespace kn{ 00049 /* 00050 * Class definition 00051 */ 00052 00056 class ImageException : public std::exception { 00057 00058 /* 00059 * Constructor & destructors 00060 */ 00061 public: 00066 ImageException(const std::string& err="", const std::string& funcname=""); 00070 ImageException(const ImageException & e); 00073 ~ImageException() throw() {} 00074 00075 00076 private : 00079 std::string str; 00080 public : 00084 inline std::string errorString() const {return str;} 00088 virtual const char* what() const throw() {return str.c_str();} 00089 }; 00090 00096 inline std::ostream& operator <<(std::ostream& stream, const ImageException & err){ 00097 return stream << err.errorString(); 00098 } 00099 00100 00101 /* 00102 * End of Namespace 00103 */ 00104 } 00105 00106 /* 00107 * End of Anti-doublon 00108 */ 00109 #endif
1.5.8