00001 // This file is part of ff3d - http://www.freefem.org/ff3d 00002 // Copyright (C) 2004,2005 Stéphane Del Pino 00003 // 00004 // This program is free software; you can redistribute it and/or modify 00005 // it under the terms of the GNU General Public License as published by 00006 // the Free Software Foundation; either version 2, or (at your option) 00007 // any later version. 00008 // 00009 // This program is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 // GNU General Public License for more details. 00013 // 00014 // You should have received a copy of the GNU General Public License 00015 // along with this program; if not, write to the Free Software Foundation, 00016 // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 // 00018 // $Id: ErrorHandler.hpp,v 1.6 2006/09/30 17:09:23 delpinux Exp $ 00019 00020 #ifndef ERROR_HANDLER_HPP 00021 #define ERROR_HANDLER_HPP 00022 00023 #include <cstddef> 00024 #include <string> 00025 00034 class ErrorHandler 00035 { 00036 public: 00037 enum Type { 00038 asked, 00039 compilation, 00040 normal, 00041 unexpected 00042 }; 00043 00044 private: 00045 const std::string __filename; 00046 const size_t __lineNumber; 00047 const std::string __errorMessage; 00049 const Type __type; 00050 public: 00055 virtual void writeErrorMessage(); 00056 00062 ErrorHandler(const ErrorHandler& e) 00063 : __filename(e.__filename), 00064 __lineNumber(e.__lineNumber), 00065 __errorMessage(e.__errorMessage), 00066 __type(e.__type) 00067 { 00068 ; 00069 } 00070 00079 ErrorHandler(const std::string& filename, 00080 const size_t& lineNumber, 00081 const std::string& errorMessage, 00082 const Type& type); 00083 00088 virtual ~ErrorHandler() 00089 { 00090 ; 00091 } 00092 }; 00093 00094 #endif // ERROR_HANDLER_HPP
1.5.6