nsIStructuredCloneContainer 编辑
dom/interfaces/base/nsIStructuredCloneContainer.idl
Scriptable This interface acts as a container for an object serialized using the structured clone algorithm. 1.0 66 Introduced Gecko 6.0 Inherits from: nsISupports
Last changed in Gecko 6.0 (Firefox 6.0 / Thunderbird 6.0 / SeaMonkey 2.3)You can copy an object into an nsIStructuredCloneContainer
using initFromVariant()
or initFromBase64()
. it is an error to initialize an nsIStructuredCloneContainer
more than once.
Once you've initialized the container, you can get a copy of the object it stores by calling deserializeToVariant()
. You can also get a base-64-encoded string containing a copy of the container's serialized data, using getDataAsBase64()
.
Method overview
nsIVariant deserializeToVariant(); |
AString getDataAsBase64(); |
void initFromBase64(in AString aData,in unsigned long aFormatVersion); |
void initFromVariant(in nsIVariant aData); |
Attributes
Attribute | Type | Description |
formatVersion | unsigned long | Get the version of the structured clone algorithm which was used to generate this container's serialized buffer. Read only. |
serializedNBytes | unsigned long long | Get the size in bytes of this container's serialized data. Read only. |
Methods
deserializeToVariant()
Deserialize the object this container holds, returning it wrapped as an nsIVariant
.
nsIVariant deserializeToVariant();
Parameters
None.
Return value
An nsIVariant
.
getDataAsBase64()
Get this structured clone container's data as a base-64-encoded string.
AString getDataAsBase64();
Parameters
None.
Return value
A base-64-encoded string.
initFromBase64()
Initialize this structured clone container from a base-64-encoded byte stream.
void initFromBase64( in AString aData, in unsigned long aFormatVersion );
Parameters
aData
- A base-64-encoded byte stream.
aFormatVersion
- The version of the structured clone algorithm which was used to generate
aData
.
initFromVariant()
Initialize this structured clone container so it contains a clone of the given variant.
void initFromVariant( in nsIVariant aData );
Parameters
aData
- A
nsIVariant
, must be backed by ajsval
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论