Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

FirebirdParameter.h

Go to the documentation of this file.
00001 #ifndef __FIREBIRD_PARAMETER_H__
00002 #define __FIREBIRD_PARAMETER_H__
00003 
00004 // For compilers that support precompilation, includes "wx.h".
00005 #include "wx/wxprec.h"
00006 
00007 #ifdef __BORLANDC__
00008     #pragma hdrstop
00009 #endif
00010 
00011 #ifndef WX_PRECOMP
00012     #include "wx/wx.h"
00013 #endif
00014 
00015 #include "wx/datetime.h"
00016 
00017 #include "DatabaseStringConverter.h"
00018 #include "ibase.h"
00019 
00020 class FirebirdParameter : public DatabaseStringConverter
00021 {
00022 public:
00023   FirebirdParameter(XSQLVAR* pVar);
00024   FirebirdParameter(XSQLVAR* pVar, const wxString& strValue, const wxCSConv* conv);
00025   FirebirdParameter(XSQLVAR* pVar, int nValue);
00026   FirebirdParameter(XSQLVAR* pVar, double dblValue);
00027   FirebirdParameter(XSQLVAR* pVar, bool bValue);
00028   FirebirdParameter(XSQLVAR* pVar, const wxDateTime& dateValue);
00029   FirebirdParameter(XSQLVAR* pVar, isc_db_handle pDatabase, isc_tr_handle pTransaction, const void* pData, long nDataLength);
00030   virtual ~FirebirdParameter();
00031 
00032   enum {
00033     PARAM_STRING = 0,
00034     PARAM_INT,
00035     PARAM_DOUBLE,
00036     PARAM_DATETIME,
00037     PARAM_BOOL,
00038     PARAM_BLOB,
00039     PARAM_NULL
00040   };
00041    
00042   long unsigned int GetDataLength();
00043   long unsigned int* GetDataLengthPtr();
00044   
00045   const void* GetDataPtr();
00046   int GetParameterType();
00047 
00048   short GetBufferType();
00049 
00050   const XSQLVAR* GetFirebirdSqlVarPtr() { return m_pParameter; }
00051   void ResetBlob();
00052 
00053 private:
00054   int m_nParameterType;
00055   
00056   // A union would probably be better here
00057   wxString m_strValue;
00058   int m_nValue;
00059   float m_fValue;
00060   double m_dblValue;
00061   ISC_TIMESTAMP m_Date;
00062   bool m_bValue;
00063   wxMemoryBuffer m_BufferValue;
00064   long unsigned int m_nBufferLength;
00065   short m_nNullFlag;
00066   ISC_QUAD m_BlobId;
00067   isc_blob_handle m_pBlob;
00068   isc_db_handle m_pDatabase;
00069   isc_tr_handle m_pTransaction;
00070   
00071   XSQLVAR* m_pParameter;
00072 };
00073 
00074 #endif // __FIREBIRD_PARAMETER_H__
00075 

Generated on Sat May 13 17:31:34 2006 for databaselayer by  doxygen 1.4.1