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

dbfield.h

00001 /* liblookdb: dbfield.h - A database column value
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_DBFIELD_H
00019 #define LIBLOOKDB_DBFIELD_H
00020 
00021 // $Id: dbfield.h,v 1.9 2001/07/19 17:51:49 clive Exp $
00022 
00023 #include "lookdblibrary.h"
00024 #include "lookdbinterface.h"
00025 #include "lkstring.h"
00026 #include "lkinteger.h"
00027 #include "lkmoney.h"
00028 #include "lkfloat.h"
00029 #include "lkdatetime.h"
00030 #include "lknumeric.h"
00031 #include "lkrawdata.h"
00032 
00033 namespace look {
00034 
00036 
00043 class LOOKDBLIBRARY_DLL DbField
00044 {
00045 public:
00046         DbField(LOOK_STMT theStmt, int theColumn);
00047         virtual ~DbField();
00048 
00049         const LookTypeBase* GetValue( void ) const;
00050         LookString GetAsString( void ) const;
00051 
00052         // these will throw exceptions if they are the wrong type
00053         LookInteger GetInteger( void ) const;
00054         LookMoney GetMoney( void ) const;
00055         LookDateTime GetDateTime( void ) const;
00056         LookFloat GetFloat( void ) const;
00057         LookNumeric GetNumeric( void ) const;
00058         LookRawData GetRawData( void ) const;
00059 
00060         bool IsNull() const;
00061 
00062         static void SetFixEmptyStrings( bool theFlag )
00063         {
00064                 itFixesEmptyStrings = theFlag;
00065         }
00066 
00067         static bool SetFixEmptyStringsAuto( void );
00068 
00069 private:
00070         LookString itsFieldName;
00071         bool itIsNull;
00072         LookTypeBase* itsValue;
00073 
00074         static bool itFixesEmptyStrings;
00075 };
00076 
00077 
00078 } // end of "look" namespace
00079 #endif // DbField_H

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