Version: 1.0.0
mysql_preparedstatement_parameter.h
Go to the documentation of this file.
1 #ifndef _WX_DATABASE_MYSQL_PREPARED_STATEMENT_PARAMETER_H_
2 #define _WX_DATABASE_MYSQL_PREPARED_STATEMENT_PARAMETER_H_
3 
4 #include "wx/database/wxprec.h"
5 
6 typedef struct bind_data {
7  wxString strValue;
8  int nValue;
9  double dblValue;
10  MYSQL_TIME dateValue;
11  bool bValue;
12  wxMemoryBuffer bufferValue;
13  wxCharBuffer charBufferValue;
14  unsigned long nBufferLength;
16 
18 {
19 public:
20  // ctor
21  wxMysqlPreparedStatementParameter(MYSQL_BIND* pBind); // Default to NULL
22  wxMysqlPreparedStatementParameter(MYSQL_BIND* pBind, const wxString& strValue);
23  wxMysqlPreparedStatementParameter(MYSQL_BIND* pBind, int nValue);
24  wxMysqlPreparedStatementParameter(MYSQL_BIND* pBind, double dblValue);
25  wxMysqlPreparedStatementParameter(MYSQL_BIND* pBind, const void* pData, long nDataLength);
26  wxMysqlPreparedStatementParameter(MYSQL_BIND* pBind, const wxDateTime& dateValue);
27  wxMysqlPreparedStatementParameter(MYSQL_BIND* pBind, bool bValue);
28  wxMysqlPreparedStatementParameter(MYSQL_BIND* pBind, MYSQL_FIELD* pField);
29 
30  // dtor
32 
33  MYSQL_BIND* GetMysqlBind() { return m_pBind; }
35 
36  void SetInt(int nValue);
37  void SetDouble(double dblValue);
38  void SetString(const wxString& strValue);
39  void SetNull();
40  void SetBlob(const void* pData, long nDataLength);
41  void SetDate(const wxDateTime& dateValue);
42  void SetBool(bool bValue);
43 
44  void ClearBuffer();
45 private:
46  MYSQL_BIND* m_pBind;
48  my_bool m_bIsNull;
49 };
50 
51 #endif//_WX_DATABASE_MYSQL_PREPARED_STATEMENT_PARAMETER_H_
52 
struct bind_data MysqlBindData
void SetDate(const wxDateTime &dateValue)
wxMysqlPreparedStatementParameter(MYSQL_BIND *pBind)
void SetString(const wxString &strValue)
void SetBlob(const void *pData, long nDataLength)
void SetDouble(double dblValue)