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

dbdescribetable.h

00001 /* liblookdb: dbdescribetable.h - Describe a table 
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_DBDESCRIBETABLE_H
00019 #define LIBLOOKDB_DBDESCRIBETABLE_H
00020 
00021 // $Id: dbdescribetable.h,v 1.6 2001/07/19 17:52:13 clive Exp $
00022 
00023 #include "lookdbutils.h"
00024 
00025 #include "lkstring.h"
00026 #include "t_list.h"
00027 
00028 namespace look {
00029 
00030 class DbQuery;
00031 
00033 
00040 class LOOKDBUTILITIES_DLL DbDescribeTable
00041 {
00042 public:
00043 
00045         struct SColumnInfo
00046         {
00047                 LookString itsName; 
00048                 long itsType;       
00049                 bool itIsNullable;  
00050 
00051                 SColumnInfo( const LookString& theName = "", long theType = -1,
00052                         bool isNullable = false)
00053                         : itsName( theName ),
00054                         itsType( theType ),
00055                         itIsNullable( isNullable )
00056                 {
00057                 }
00058 
00059                 ~SColumnInfo()
00060                 {
00061                 }
00062 
00063                 SColumnInfo( const SColumnInfo& theOther )
00064                         : itsName( theOther.itsName ),
00065                         itsType( theOther.itsType ),
00066                         itIsNullable( theOther.itIsNullable )
00067                 {
00068                 }
00069 
00070                 SColumnInfo& operator=( const SColumnInfo& theOther )
00071                 {
00072                         itsName = theOther.itsName;
00073                         itsType = theOther.itsType;
00074                         itIsNullable = theOther.itIsNullable;
00075                         return *this;
00076                 }
00077 
00078                 bool operator==( const SColumnInfo& theOther ) const
00079                 {
00080                         return itsName == theOther.itsName;
00081                 }
00082         };
00083 
00084         typedef LookTLList<SColumnInfo> ColumnInfoList;
00085 
00086         static bool DescribeTable( const LookString& theTableName,
00087                 ColumnInfoList& theColumns );
00088 
00089         static bool DescribeQuery( DbQuery* theQuery,
00090                 ColumnInfoList& theColumns );
00091 
00092 protected:
00093 
00094 };
00095 
00096 
00097 } // end of "look" namespace
00098 #endif

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