mozIStorageValueArray 编辑

The mozIStorageValueArray interface obtains provides methods to obtain data from a given result.

For an introduction on how to use this interface, see the Storage overview document.

storage/public/mozIStorageValueArray.idlScriptable Please add a summary to this article.   Last changed in Gecko 1.8 (Firefox 1.5 / Thunderbird 1.5 / SeaMonkey 1.0)

Inherits from: nsISupports

Method overview

long getTypeOfIndex(in unsigned long aIndex);
long getInt32(in unsigned long aIndex);
long long getInt64(in unsigned long aIndex);
double getDouble(in unsigned long aIndex);
AUTF8String getUTF8String(in unsigned long aIndex);
AString getString(in unsigned long aIndex);
void getBlob(in unsigned long aIndex, out unsigned long aDataSize, [array,size_is(aDataSize)] out octet aData);
boolean getIsNull(in unsigned long aIndex);

Attributes

AttributeTypeDescription
numEntriesunsigned longThe number of entries in the array.

Constants

ConstantValueDescription
VALUE_TYPE_NULL0Null data type.
VALUE_TYPE_INTEGER1INTEGER data type.
VALUE_TYPE_FLOAT2FLOAT data type.
VALUE_TYPE_TEXT3TEXT data type.
VALUE_TYPE_BLOB4BLOB data type.

Methods

getTypeOfIndex()

Returns the type of the value at the given column index.

 long getTypeOfIndex(
   in unsigned long aIndex
 );
Parameters
aIndex

The zero-based numerical index for the column to get the data from.

Return value

One of the constants mozIStorageValueArray.VALUE_TYPE_NULL, mozIStorageValueArray.VALUE_TYPE_INTEGER, mozIStorageValueArray.VALUE_TYPE_FLOAT, mozIStorageValueArray.VALUE_TYPE_TEXT, or mozIStorageValueArray.VALUE_TYPE_BLOB describing the type aIndex is.

getInt32()

Obtains a Int32 from the specified index.

 long getInt32(
   in unsigned long aIndex
 );
Parameters
aIndex
The zero-based numerical index for the column to get the data from.
Return value

The int32 for the specified entry.

getInt64()

Obtains a int64 from the specified index.

 long long getInt64(
   in unsigned long aIndex
 );
Parameters
aIndex
The zero-based numerical index for the column to get the data from.
Return value

The int64 for the specified entry.

getDouble()

Obtains a double from the specified index.

 double getDouble(
   in unsigned long aIndex
 );
Parameters
aIndex
The zero-based numerical index for the column to get the data from.
Return value

The double for the specified entry.

getUTF8String()

Obtains a UTF8String from the specified index.

Note: C++ callers should be aware that a string value for a NULL column has IsVoid set to distinguish it from an empty string.
 AUTF8String getUTF8String(
   in unsigned long aIndex
 );
Parameters
aIndex
The zero-based numerical index for the column to get the data from.
Return value

The utf8string for the specified entry.

getString()

Obtains a string from the specified index.

Note: C++ callers should be aware that a string value for a NULL column has IsVoid set to distinguish it from an empty string.
 AString getString(
   in unsigned long aIndex
 );
Parameters
aIndex
The zero-based numerical index for the column to get the data from.
Return value

The string for the specified entry.

getBlob()

Obtains a blob from the specified index.

 void getBlob(
   in unsigned long aIndex,
   out unsigned long aDataSize,
   [array,size_is(aDataSize)] out octet aData
 );
Parameters
aIndex
The zero-based numerical index for the column to get the data from.
aDataSize
The size of the returned array.
Return value

The blob for the specified entry.

getIsNull()

Checks if given column index is NULL.

 boolean getIsNull(
   in unsigned long aIndex
 );
Parameters
aIndex
The zero-based numerical index for the column to get the data from.
Return value

Returns true if the column specified by aIndex is NULL, or false otherwise.

See also

 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:131 次

字数:9860

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文