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


C++ ENSURE_INDEX_VALUE函數代碼示例

本文整理匯總了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);
}
開發者ID:Type-of-Tool,項目名稱:ExMail,代碼行數:7,代碼來源:mozStorageRow.cpp

示例2: ENSURE_INDEX_VALUE

NS_IMETHODIMP
Row::GetInt32(PRUint32 aIndex,
              PRInt32 *_value)
{
  ENSURE_INDEX_VALUE(aIndex, mNumCols);
  return mData.ObjectAt(aIndex)->GetAsInt32(_value);
}
開發者ID:FunkyVerb,項目名稱:devtools-window,代碼行數:7,代碼來源:mozStorageRow.cpp

示例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;
}
開發者ID:lail3344,項目名稱:mozilla-central,代碼行數:35,代碼來源:mozStorageStatement.cpp

示例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;
}
開發者ID:Andrel322,項目名稱:gecko-dev,代碼行數:9,代碼來源:mozStorageArgValueArray.cpp

示例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;
}
開發者ID:AshishNamdev,項目名稱:mozilla-central,代碼行數:12,代碼來源:mozStorageBindingParams.cpp

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


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