當前位置: 首頁>>代碼示例>>C++>>正文


C++ CheckValidIndex函數代碼示例

本文整理匯總了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));
}
開發者ID:Bootz,項目名稱:TrueBlood-Dev-Server,代碼行數:7,代碼來源:PreparedStatement.cpp

示例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);
}
開發者ID:FirstCore,項目名稱:GaryMoveOut_4.3.4,代碼行數:7,代碼來源:PreparedStatement.cpp

示例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;
}
開發者ID:powerzilly,項目名稱:trinitycore,代碼行數:13,代碼來源:PreparedStatement.cpp

示例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);
}
開發者ID:BoThay,項目名稱:ArkCORE,代碼行數:14,代碼來源:PreparedStatement.cpp

示例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);
}
開發者ID:Diyvol,項目名稱:TrinityCore,代碼行數:21,代碼來源:PreparedStatement.cpp


注:本文中的CheckValidIndex函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。