Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

looktypes.h

00001 /* liblookdb: looktypes.h - Types library global things 
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_LOOKTYPES_H
00019 #define LIBLOOKDB_LOOKTYPES_H
00020 
00021 // $Id: looktypes.h,v 1.10 2001/07/04 15:53:22 clive Exp $
00022 
00023 #include "lookcompileropts.h"
00024 #include "string.h"
00025 
00026 namespace look {
00027 
00028 // dll things
00029 #ifdef WIN32
00030 #ifdef LOOKTYPES_BUILD
00031 #define LOOKTYPES_DLL __declspec(dllexport)
00032 #else
00033 #define LOOKTYPES_DLL __declspec(dllimport)
00034 #endif
00035 #else
00036 #define LOOKTYPES_DLL
00037 #endif
00038 
00039 // id's for our types and their pseudo-rtti
00040 const long LookFloatID = 1;
00041 const long LookStringID = 2;
00042 const long LookIntegerID = 3;
00043 const long LookMoneyID = 4;
00044 const long LookDateID = 5;
00045 const long LookTimeID = 6;
00046 const long LookDateTimeID = 7;
00047 const long LookNULLValueID = 8;
00048 const long LookLongStringID = 9;  // this isn't a real type, but it is used
00049                                   // for db communication
00050 const long LookNumericID = 10;
00051 const long LookRawDataID = 11;
00052 const long LookLongRawDataID = 12; // like looklongstringid
00053 
00054 // exceptions we can throw
00056 
00060 class LOOKTYPES_DLL LookException
00061 {
00062 public:
00063 
00064         // the char* is a lightweight string.
00066 
00070         LookException( int theErrorNumber, const char* theMessage )
00071                 : itsErrorNumber( theErrorNumber )
00072         {
00073                 itsMessage = new char[strlen(theMessage)+1];
00074                 strcpy( itsMessage, theMessage );
00075         }
00076         
00078         ~LookException()
00079         {
00080                 delete [] itsMessage;
00081         }
00082 
00084         LookException( const LookException& theOther )
00085                 : itsErrorNumber( theOther.itsErrorNumber )
00086         {
00087                 itsMessage = new char[strlen(theOther.itsMessage)+1];
00088                 strcpy( itsMessage, theOther.itsMessage );
00089         }
00090 
00092         LookException& operator=( const LookException& theOther )
00093         {
00094                 itsErrorNumber = theOther.itsErrorNumber;
00095                 delete [] itsMessage;
00096 
00097                 itsMessage = new char[strlen(theOther.itsMessage)+1];
00098                 strcpy( itsMessage, theOther.itsMessage );
00099 
00100                 return *this;
00101         }
00102 
00103         int itsErrorNumber;
00104         char* itsMessage;
00105 };
00106 
00107 // our error numbers
00108 // negatives are for application
00109 // Look Types library is 0-999
00110 const int sprintfError = 1;
00111 
00112 // blocks for other libraries
00113 // Look db library                       1000-1999
00114 // gte database library                  2000-2999
00115 // gte gui library                       3000-3999
00116 // db streams library                    4000-4999
00117 
00118 
00119 } // end of "look" namespace
00120 #endif

Generated at Thu Jan 17 12:53:06 2002 for liblookdb by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001