Public Member Functions

nsIStringInputStream Interface Reference

nsIStringInputStream More...

import "nsIStringStream.idl";

Inheritance diagram for nsIStringInputStream:
Collaboration diagram for nsIStringInputStream:

List of all members.

Public Member Functions

void setData (in string data, in long dataLen)
 SetData - assign data to the input stream (copied on assignment).
void adoptData (in charPtr data, in long dataLen)
 NOTE: the following methods are designed to give C++ code added control over the ownership and lifetime of the stream data.
void shareData (in string data, in long dataLen)
 ShareData - assign data to the input stream.

Detailed Description

nsIStringInputStream

Provides scriptable and specialized C++-only methods for initializing a nsIInputStream implementation with a simple character array.


Member Function Documentation

void nsIStringInputStream::adoptData ( in charPtr  data,
in long  dataLen 
)

NOTE: the following methods are designed to give C++ code added control over the ownership and lifetime of the stream data.

Use with care :-) AdoptData - assign data to the input stream. the input stream takes ownership of the given data buffer and will nsMemory::Free it when the input stream is destroyed.

Parameters:
data - stream data
dataLen - stream data length (-1 if length should be computed)
void nsIStringInputStream::setData ( in string  data,
in long  dataLen 
)

SetData - assign data to the input stream (copied on assignment).

Parameters:
data - stream data
dataLen - stream data length (-1 if length should be computed)

NOTE: C++ code should consider using AdoptData or ShareData to avoid making an extra copy of the stream data.

NOTE: For JS callers, the given data must not contain null characters (other than a null terminator) because a null character in the middle of the data string will be seen as a terminator when the data is converted from a JS string to a C++ character array.

void nsIStringInputStream::shareData ( in string  data,
in long  dataLen 
)

ShareData - assign data to the input stream.

the input stream references the given data buffer until the input stream is destroyed. the given data buffer must outlive the input stream.

Parameters:
data - stream data
dataLen - stream data length (-1 if length should be computed)

The documentation for this interface was generated from the following file: