本文整理汇总了C++中CheckValidIndex函数的典型用法代码示例。如果您正苦于以下问题:C++ CheckValidIndex函数的具体用法?C++ CheckValidIndex怎么用?C++ CheckValidIndex使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CheckValidIndex函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CheckValidIndex
void MySQLPreparedStatement::setFloat(const uint8 index, const float value)
{
CheckValidIndex(index);
m_paramsSet[index] = true;
MYSQL_BIND* param = &m_bind[index];
setValue(param, MYSQL_TYPE_FLOAT, &value, sizeof(float), (value > 0.0f));
}
示例2: CheckValidIndex
void MySQLPreparedStatement::setUInt16(const uint8 index, const uint16 value)
{
CheckValidIndex(index);
m_paramsSet[index] = true;
MYSQL_BIND* param = &m_bind[index];
setValue(param, MYSQL_TYPE_SHORT, &value, sizeof(uint16), true);
}
示例3: CheckValidIndex
void MySQLPreparedStatement::setNull(const uint8 index)
{
CheckValidIndex(index);
m_paramsSet[index] = true;
MYSQL_BIND* param = &m_bind[index];
param->buffer_type = MYSQL_TYPE_NULL;
delete [] static_cast<char *>(param->buffer);
param->buffer = NULL;
param->buffer_length = 0;
param->is_null_value = 1;
delete param->length;
param->length = NULL;
}
示例4: CheckValidIndex
void MySQLPreparedStatement::setString(const uint8 index, const char* value) {
CheckValidIndex(index);
m_paramsSet[index] = true;
MYSQL_BIND* param = &m_bind[index];
size_t len = strlen(value) + 1;
param->buffer_type = MYSQL_TYPE_VAR_STRING;
delete[] static_cast<char *>(param->buffer);
param->buffer = new char[len];
param->buffer_length = len;
param->is_null_value = 0;
param->length = new unsigned long(len - 1);
memcpy(param->buffer, value, len);
}
示例5: CheckValidIndex
void MySQLPreparedStatement::setBinary(const uint8 index, const std::vector<uint8>& value, bool isString)
{
CheckValidIndex(index);
m_paramsSet[index] = true;
MYSQL_BIND* param = &m_bind[index];
uint32 len = uint32(value.size());
param->buffer_type = MYSQL_TYPE_BLOB;
delete [] static_cast<char *>(param->buffer);
param->buffer = new char[len];
param->buffer_length = len;
param->is_null_value = 0;
delete param->length;
param->length = new unsigned long(len);
if (isString)
{
*param->length -= 1;
param->buffer_type = MYSQL_TYPE_VAR_STRING;
}
memcpy(param->buffer, value.data(), len);
}