00001 /* liblookdb: dberror.h - Error handling 00002 Copyright (C) 1998-2001 LOOK Systems 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Lesser General Public 00006 License as published by the Free Software Foundation; either 00007 version 2.1 of the License, or (at your option) any later version. 00008 00009 This library 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 GNU 00012 Lesser General Public License for more details. 00013 00014 You should have received a copy of the GNU Lesser General Public 00015 License along with this library; if not, write to the Free Software 00016 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 */ 00018 #ifndef LIBLOOKDB_DBERROR_H 00019 #define LIBLOOKDB_DBERROR_H 00020 00021 // $Id: dberror.h,v 1.4 2001/07/05 16:11:16 clive Exp $ 00022 00023 #include "lookdblibrary.h" 00024 #include "lkstring.h" 00025 00026 namespace look { 00027 00029 00035 class LOOKDBLIBRARY_DLL DbError 00036 { 00037 public: 00038 00039 // get last error from the interface layer 00040 static void FindLastErrorFromDb( void ); 00041 00042 // set last error 00043 static void SetLastError( const LookString& theMessage, long theNumber ); 00044 00045 // add this error message segment to the beginning 00046 static void AppendErrorMessage( const LookString& theMessage ); 00047 00048 // return the last error we know about 00049 static LookString GetLastError( long& theErrorNumber ); 00050 static LookString GetLastErrorString( void ); 00051 static long GetLastErrorNumber( void ); 00052 00053 protected: 00054 00055 static long itsLastErrorNo; 00056 static LookString itsLastErrorMessage; 00057 00058 }; 00059 00060 00061 } // end of "look" namespace 00062 #endif