00001 /*! 00002 * \file PassguardErrorManager.h 00003 * \brief Defines the class that manage all error messages of the Framework 00004 * 00005 * \author Frederic RUAUDEL <grumz@users.sf.net> 00006 * 00007 * $Revision: 1.2 $ 00008 * $Date: 2003/02/20 12:31:53 $ 00009 * 00010 * \b PassGuardFramework 00011 * Copyleft (c) 2002 Frederic RUAUDEL, all rights reversed 00012 * 00013 * This program is free software which I release under the GNU General Public 00014 * License. You may redistribute and/or modify this program under the terms 00015 * of that license as published by the Free Software Foundation; either 00016 * version 2 of the License, or (at your option) any later version. 00017 * 00018 * This program is distributed in the hope that it will be useful, 00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00021 * GNU General Public License for more details. Version 2 is in the 00022 * COPYING file in the top level directory of this distribution. 00023 * 00024 * To get a copy of the GNU General Public License, write to the Free Software 00025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00026 **/ 00027 00028 #ifndef PASSGUARD_ERROR_MANAGER_H 00029 #define PASSGUARD_ERROR_MANAGER_H 00030 00031 #include <errno.h> 00032 00033 #include <map> 00034 #include <string> 00035 00036 using namespace std; 00037 00038 /*! 00039 * \brief Manage all error messages of the Framework 00040 **/ 00041 class PassguardErrorManager 00042 { 00043 public: 00044 ~PassguardErrorManager (); 00045 00046 string getErrorMessage (string function_name) const; 00047 string getLastErrorMessage (string* function_name); 00048 00049 string getHelpMessage (string function_name) const; 00050 string getLastHelpMessage (string* function_name); 00051 00052 protected: 00053 PassguardErrorManager (); 00054 void setErrorMessage (string function_name, string error_message, string help_message=""); 00055 00056 private: 00057 map<string, string> _error_messages; 00058 map<string, string> _help_messages; 00059 string _last_function_in_error; 00060 }; 00061 00062 #endif /* PASSGUARD_ERROR_MANAGER_H */