Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
MySQLPreparedStatement Class Reference

#include <PreparedStatement.h>

Collaboration diagram for MySQLPreparedStatement:

Public Member Functions

 MySQLPreparedStatement (MYSQL_STMT *stmt)
void setBinary (const uint8 index, const std::vector< uint8 > &value, bool isString)
void setBool (const uint8 index, const bool value)
void setDouble (const uint8 index, const double value)
void setFloat (const uint8 index, const float value)
void setInt16 (const uint8 index, const int16 value)
void setInt32 (const uint8 index, const int32 value)
void setInt64 (const uint8 index, const int64 value)
void setInt8 (const uint8 index, const int8 value)
void setNull (const uint8 index)
void setUInt16 (const uint8 index, const uint16 value)
void setUInt32 (const uint8 index, const uint32 value)
void setUInt64 (const uint8 index, const uint64 value)
void setUInt8 (const uint8 index, const uint8 value)
 ~MySQLPreparedStatement ()

Protected Member Functions

bool CheckValidIndex (uint8 index)
void ClearParameters ()
MYSQL_BIND * GetBind ()
std::string getQueryString (std::string const &sqlPattern) const
MYSQL_STMT * GetSTMT ()

Protected Attributes

PreparedStatementm_stmt

Private Member Functions

 MySQLPreparedStatement (MySQLPreparedStatement const &right)=delete
MySQLPreparedStatementoperator= (MySQLPreparedStatement const &right)=delete
void setValue (MYSQL_BIND *param, enum_field_types type, const void *value, uint32 len, bool isUnsigned)

Private Attributes

MYSQL_BIND * m_bind
MYSQL_STMT * m_Mstmt
uint32 m_paramCount
std::vector< bool > m_paramsSet

Friends

class MySQLConnection
class PreparedStatement

Detailed Description

Definition at line 107 of file PreparedStatement.h.

Constructor & Destructor Documentation

◆ MySQLPreparedStatement() [1/2]

MySQLPreparedStatement::MySQLPreparedStatement ( MYSQL_STMT * stmt)

Initialize variable parameters

"If set to 1, causes mysql_stmt_store_result() to update the metadata MYSQL_FIELD->max_length value."

Definition at line 202 of file PreparedStatement.cpp.

References m_bind, m_Mstmt, m_paramCount, m_paramsSet, and m_stmt.

Referenced by MySQLPreparedStatement(), and operator=().

◆ ~MySQLPreparedStatement()

MySQLPreparedStatement::~MySQLPreparedStatement ( )

Definition at line 218 of file PreparedStatement.cpp.

References ClearParameters(), m_bind, and m_Mstmt.

◆ MySQLPreparedStatement() [2/2]

MySQLPreparedStatement::MySQLPreparedStatement ( MySQLPreparedStatement const & right)
privatedelete

Member Function Documentation

◆ CheckValidIndex()

bool MySQLPreparedStatement::CheckValidIndex ( uint8 index)
protected

◆ ClearParameters()

void MySQLPreparedStatement::ClearParameters ( )
protected

Definition at line 230 of file PreparedStatement.cpp.

References m_bind, m_paramCount, and m_paramsSet.

Referenced by ~MySQLPreparedStatement().

◆ GetBind()

MYSQL_BIND * MySQLPreparedStatement::GetBind ( )
inlineprotected

Definition at line 132 of file PreparedStatement.h.

References m_bind.

◆ getQueryString()

std::string MySQLPreparedStatement::getQueryString ( std::string const & sqlPattern) const
protected

◆ GetSTMT()

MYSQL_STMT * MySQLPreparedStatement::GetSTMT ( )
inlineprotected

Definition at line 131 of file PreparedStatement.h.

References m_Mstmt.

◆ operator=()

MySQLPreparedStatement & MySQLPreparedStatement::operator= ( MySQLPreparedStatement const & right)
privatedelete

◆ setBinary()

void MySQLPreparedStatement::setBinary ( const uint8 index,
const std::vector< uint8 > & value,
bool isString )

Definition at line 343 of file PreparedStatement.cpp.

References CheckValidIndex(), m_bind, and m_paramsSet.

◆ setBool()

void MySQLPreparedStatement::setBool ( const uint8 index,
const bool value )

Definition at line 258 of file PreparedStatement.cpp.

References setUInt8().

◆ setDouble()

void MySQLPreparedStatement::setDouble ( const uint8 index,
const double value )

Definition at line 335 of file PreparedStatement.cpp.

References CheckValidIndex(), m_bind, m_paramsSet, and setValue().

◆ setFloat()

void MySQLPreparedStatement::setFloat ( const uint8 index,
const float value )

Definition at line 327 of file PreparedStatement.cpp.

References CheckValidIndex(), m_bind, m_paramsSet, and setValue().

◆ setInt16()

void MySQLPreparedStatement::setInt16 ( const uint8 index,
const int16 value )

Definition at line 303 of file PreparedStatement.cpp.

References CheckValidIndex(), m_bind, m_paramsSet, and setValue().

◆ setInt32()

void MySQLPreparedStatement::setInt32 ( const uint8 index,
const int32 value )

Definition at line 311 of file PreparedStatement.cpp.

References CheckValidIndex(), m_bind, m_paramsSet, and setValue().

◆ setInt64()

void MySQLPreparedStatement::setInt64 ( const uint8 index,
const int64 value )

Definition at line 319 of file PreparedStatement.cpp.

References CheckValidIndex(), m_bind, m_paramsSet, and setValue().

◆ setInt8()

void MySQLPreparedStatement::setInt8 ( const uint8 index,
const int8 value )

Definition at line 295 of file PreparedStatement.cpp.

References CheckValidIndex(), m_bind, m_paramsSet, and setValue().

◆ setNull()

void MySQLPreparedStatement::setNull ( const uint8 index)

Definition at line 365 of file PreparedStatement.cpp.

References CheckValidIndex(), m_bind, and m_paramsSet.

◆ setUInt16()

void MySQLPreparedStatement::setUInt16 ( const uint8 index,
const uint16 value )

Definition at line 271 of file PreparedStatement.cpp.

References CheckValidIndex(), m_bind, m_paramsSet, and setValue().

◆ setUInt32()

void MySQLPreparedStatement::setUInt32 ( const uint8 index,
const uint32 value )

Definition at line 279 of file PreparedStatement.cpp.

References CheckValidIndex(), m_bind, m_paramsSet, and setValue().

◆ setUInt64()

void MySQLPreparedStatement::setUInt64 ( const uint8 index,
const uint64 value )

Definition at line 287 of file PreparedStatement.cpp.

References CheckValidIndex(), m_bind, m_paramsSet, and setValue().

◆ setUInt8()

void MySQLPreparedStatement::setUInt8 ( const uint8 index,
const uint8 value )

Definition at line 263 of file PreparedStatement.cpp.

References CheckValidIndex(), m_bind, m_paramsSet, and setValue().

Referenced by setBool().

◆ setValue()

void MySQLPreparedStatement::setValue ( MYSQL_BIND * param,
enum_field_types type,
const void * value,
uint32 len,
bool isUnsigned )
private

◆ MySQLConnection

friend class MySQLConnection
friend

Definition at line 109 of file PreparedStatement.h.

References MySQLConnection.

Referenced by MySQLConnection.

◆ PreparedStatement

friend class PreparedStatement
friend

Definition at line 110 of file PreparedStatement.h.

References PreparedStatement.

Referenced by PreparedStatement.

Member Data Documentation

◆ m_bind

◆ m_Mstmt

MYSQL_STMT* MySQLPreparedStatement::m_Mstmt
private

Definition at line 142 of file PreparedStatement.h.

Referenced by GetSTMT(), MySQLPreparedStatement(), and ~MySQLPreparedStatement().

◆ m_paramCount

uint32 MySQLPreparedStatement::m_paramCount
private

Definition at line 143 of file PreparedStatement.h.

Referenced by CheckValidIndex(), ClearParameters(), and MySQLPreparedStatement().

◆ m_paramsSet

std::vector<bool> MySQLPreparedStatement::m_paramsSet
private

◆ m_stmt

PreparedStatement* MySQLPreparedStatement::m_stmt
protected

Definition at line 133 of file PreparedStatement.h.

Referenced by CheckValidIndex(), getQueryString(), and MySQLPreparedStatement().


The documentation for this class was generated from the following files: