本文整理匯總了C++中ENSURE_INDEX_VALUE函數的典型用法代碼示例。如果您正苦於以下問題:C++ ENSURE_INDEX_VALUE函數的具體用法?C++ ENSURE_INDEX_VALUE怎麽用?C++ ENSURE_INDEX_VALUE使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了ENSURE_INDEX_VALUE函數的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: ENSURE_INDEX_VALUE
NS_IMETHODIMP
Row::GetInt64(uint32_t aIndex,
int64_t *_value)
{
ENSURE_INDEX_VALUE(aIndex, mNumCols);
return mData.ObjectAt(aIndex)->GetAsInt64(_value);
}
示例2: ENSURE_INDEX_VALUE
NS_IMETHODIMP
Row::GetInt32(PRUint32 aIndex,
PRInt32 *_value)
{
ENSURE_INDEX_VALUE(aIndex, mNumCols);
return mData.ObjectAt(aIndex)->GetAsInt32(_value);
}
示例3: ENSURE_INDEX_VALUE
NS_IMETHODIMP
Statement::GetTypeOfIndex(uint32_t aIndex,
int32_t *_type)
{
if (!mDBStatement)
return NS_ERROR_NOT_INITIALIZED;
ENSURE_INDEX_VALUE(aIndex, mResultColumnCount);
if (!mExecuting)
return NS_ERROR_UNEXPECTED;
int t = ::sqlite3_column_type(mDBStatement, aIndex);
switch (t) {
case SQLITE_INTEGER:
*_type = mozIStorageStatement::VALUE_TYPE_INTEGER;
break;
case SQLITE_FLOAT:
*_type = mozIStorageStatement::VALUE_TYPE_FLOAT;
break;
case SQLITE_TEXT:
*_type = mozIStorageStatement::VALUE_TYPE_TEXT;
break;
case SQLITE_BLOB:
*_type = mozIStorageStatement::VALUE_TYPE_BLOB;
break;
case SQLITE_NULL:
*_type = mozIStorageStatement::VALUE_TYPE_NULL;
break;
default:
return NS_ERROR_FAILURE;
}
return NS_OK;
}
示例4: ENSURE_INDEX_VALUE
NS_IMETHODIMP
ArgValueArray::GetDouble(uint32_t aIndex,
double *_value)
{
ENSURE_INDEX_VALUE(aIndex, mArgc);
*_value = ::sqlite3_value_double(mArgv[aIndex]);
return NS_OK;
}
示例5: NS_ENSURE_FALSE
NS_IMETHODIMP
BindingParams::BindByIndex(uint32_t aIndex,
nsIVariant *aValue)
{
NS_ENSURE_FALSE(mLocked, NS_ERROR_UNEXPECTED);
ENSURE_INDEX_VALUE(aIndex, mParamCount);
// Store the variant for later use.
NS_ENSURE_TRUE(mParameters.ReplaceObjectAt(aValue, aIndex),
NS_ERROR_OUT_OF_MEMORY);
return NS_OK;
}
示例6: NS_ENSURE_FALSE
NS_IMETHODIMP
BindingParams::BindByIndex(uint32_t aIndex,
nsIVariant *aValue)
{
NS_ENSURE_FALSE(mLocked, NS_ERROR_UNEXPECTED);
ENSURE_INDEX_VALUE(aIndex, mParamCount);
// Store the variant for later use.
RefPtr<Variant_base> variant = convertVariantToStorageVariant(aValue);
if (!variant)
return NS_ERROR_UNEXPECTED;
if (mParameters.Length() <= aIndex) {
(void)mParameters.SetLength(aIndex);
(void)mParameters.AppendElement(variant);
}
else {
NS_ENSURE_TRUE(mParameters.ReplaceElementAt(aIndex, variant),
NS_ERROR_OUT_OF_MEMORY);
}
return NS_OK;
}