00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef LIBLOOKDB_DBDESCRIBETABLE_H
00019 #define LIBLOOKDB_DBDESCRIBETABLE_H
00020
00021
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 }
00098 #endif