Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields  

SQLField.h

00001 /*
00002  * $Id: SQLField.h,v 1.2 2003/09/04 18:57:57 mindstorm2600 Exp $
00003  */
00004 #ifndef __CLAW_SQLRESULTCELL_H__
00005 #define __CLAW_SQLRESULTCELL_H__
00006 
00007 #include<DatabaseInterface.h>
00008 #include<Date.h>
00009 #include<Time.h>
00010 #include<Timestamp.h>
00011 #include<Byte.h>
00012 #include<String.h>
00013 
00014 namespace clawsoft{
00025         class SQLField:public DatabaseInterface{
00026                 private:
00027                         void            *dataPtr;
00028                         Uint32          dataLen;
00029                         int             dataType;
00030                         char            *tmpStr;
00031                         String          *tmpString;
00032                         Date            *tmpDate;
00033                         Time            *tmpTime;
00034                         Timestamp       *tmpTimestamp;
00035                         Byte            *tmpByte;
00036                         String          colname;
00037                 public:
00041                         enum SQLtypes{
00043                                 TINYINT   = 1, 
00045                                 INTEGER   = 2,
00048                                 BIGINT    = 3,
00050                                 FLOAT     = 4,
00052                                 DOUBLE    = 5,
00055                                 CHAR      = 6,
00058                                 VARCHAR   = 7,
00061                                 STRING    = 8,
00069                                 BLOB      = 9,
00074                                 TEXT      = 10,
00077                                 DATE      = 11,
00080                                 TIME      = 12,
00083                                 TIMESTAMP = 13,
00087                                 BIT       = 14,
00089                                 BYTE      = 15
00090                         };
00096                         SQLField(const void *data, const Uint32 size);
00101                         SQLField(const int type, const void *data, const Uint32 size);
00104                         ~SQLField();
00120                         Sint16          toTinyInt();
00123                         Uint16          toUTinyInt();
00132                         Sint32          toInteger();
00135                         Uint32          toUInteger();
00144                         Sint64          toBigInt();
00147                         Uint64          toUBigInt();
00158                         float           toFloat();
00169                         double          toDouble();
00172                         const char      *toChar();
00176                         const String    *toString();
00180                         const String    *toText();
00185                         const void      *toBLOB();
00188                         const Date      *toDate();
00191                         const Time      *toTime();
00194                         const Timestamp *toTimestamp();
00197                         bool            toBit();
00200                         const Byte      *toByte();
00203                         const int       getDatatype();
00205                         const Uint32    size();
00207                         const Uint32    dataSize();
00209                         void setFieldName(const String &nam);
00211                         const String &getFieldName();
00212         };
00213 };
00214 
00215 #endif

Authors:

Juan V. Guerrero
Jannette C. Mejia
Juan C. Guevara

Powered by:

SourceForgeLogo