Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

boss_mysql_exceptions.h

Go to the documentation of this file.
00001 /* boss_mysql_exceptions.h    $Revision: 1.2 $ $Date: 2005/12/10 20:33:54 $
00002    Copyright (C) 2000 University of Bonn.
00003    http://www.ikp.uni-bonn.de/boss
00004 
00005    This program is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU General Public License
00007    as published by the Free Software Foundation; either version 2
00008    of the License, or (at your option) any later version.
00009 
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013    GNU General Public License for more details.
00014 
00015    You should have received a copy of the GNU General Public License
00016    along with this program; if not, write to the Free Software
00017    Foundation, Inc., 59 Temple Place - Suite 330,
00018    Boston, MA  02111-1307, USA.
00019 */
00020 
00021 #ifndef MYSQL_EXCEPTIONS_H
00022 #define MYSQL_EXCEPTIONS_H
00023 
00024 using namespace std;
00025 
00026 #include <string>
00027 #include <iostream>
00028 
00033 class MySQL_TwoStringException {
00034 protected:      
00035         string f_name;
00036         string message;
00037 public:
00038         MySQL_TwoStringException(const string & f_n, const string m) : f_name(f_n), message(m) {}
00039         virtual void printError(const bool & fatal = false) const = 0;
00040         virtual ~MySQL_TwoStringException() {}
00041 };      
00042 
00043 class MySQL_StringNumException {
00044 protected:      
00045         string   f_name;
00046         unsigned message;
00047 public:
00048         MySQL_StringNumException(const string & f_n, const unsigned m) : f_name(f_n), message(m) {}
00049         virtual void printError(const bool & fatal = false) const = 0;
00050         virtual ~MySQL_StringNumException() {}
00051 };      
00052 
00053 class MySQL_ConnectFailed : public MySQL_TwoStringException {
00054 public:
00055         MySQL_ConnectFailed(const string & f_n, const string m) : MySQL_TwoStringException(f_n, m) {}
00056         void printError(const bool & fatal) const;
00057 };
00058 
00059 class MySQL_QueryFailed : public MySQL_TwoStringException {
00060 public:
00061         MySQL_QueryFailed(const string & f_n, const string m) : MySQL_TwoStringException(f_n, m) {}
00062         void printError(const bool & fatal) const;
00063 };
00064 
00065 class MySQL_IndexOutOfRange : public MySQL_StringNumException {
00066 public:
00067         MySQL_IndexOutOfRange(const string & f_n, const unsigned m) : MySQL_StringNumException(f_n, m) {}
00068         void printError(const bool & fatal) const;
00069 };
00070 
00071 #endif

Generated on Tue Dec 20 23:14:37 2005 for BOSS by doxygen 1.3.6