sbIMetadataChannel Interface Reference

A wrapper for an nsIChannel that buffers the incoming data. More...

List of all members.

Public Member Functions

void open (in nsIChannel aChannel, in sbIMetadataHandler aHandler)
 Open the channel and start downloading the file.
void close ()
 Close the channel and free all references.
void skip (in PRUint64 aDistance)
 Skip forward in the read buffer.
PRUint32 read (in charPtr aBuffer, in PRUint32 aSize)
 Read from the buffer.
char readChar ()
 Read a byte from the buffer.
PRInt32 readInt32 ()
 Read a 32bit int from the buffer.
PRInt64 readInt64 ()
 Read a 32bit int from the buffer.

Public Attributes

attribute PRUInt64 pos
 The current read position (for the read methods).
readonly attribute PRUInt64 buf
 The current internal buffer position (everything the channel has sent).
readonly attribute PRUInt64 size
 The size of the file targeted by the nsIChannel.
readonly attribute PRBool seekable
 If the datastream is seekable.
readonly attribute PRBool completed
 If the nsIChannel has finished (by completion or error).


Detailed Description

A wrapper for an nsIChannel that buffers the incoming data.

Every time the channel reports it has data available (or a change in state) it will call the given sbIMetadataHandler::onChannelData method.

This class provides buffered read methods for the handler to retrieve data.

See also:
sbIMetadataHandler

Definition at line 49 of file sbIMetadataChannel.idl.


Member Function Documentation

void sbIMetadataChannel::open ( in nsIChannel  aChannel,
in sbIMetadataHandler  aHandler 
)

Open the channel and start downloading the file.

An instance of sbIMetadataHandler passes itself and an nsIChannel into this method in order to start transferring data across the channel.

Every time the channel reports it has data available (or a change in state) it will call the given sbIMetadataHandler::onChannelData method.

Parameters:
aChannel The channel from which to download
aHandler The handler to be informed of the download progress

PRUint32 sbIMetadataChannel::read ( in charPtr  aBuffer,
in PRUint32  aSize 
)

Read from the buffer.

Parameters:
aBuffer The buffer into which to read
aSize The size of the buffer in bytes
Returns:
The number of bytes read

char sbIMetadataChannel::readChar (  ) 

Read a byte from the buffer.

Returns:
The byte read

PRInt32 sbIMetadataChannel::readInt32 (  ) 

Read a 32bit int from the buffer.

Returns:
The value read

PRInt64 sbIMetadataChannel::readInt64 (  ) 

Read a 32bit int from the buffer.

Returns:
The value read

void sbIMetadataChannel::skip ( in PRUint64  aDistance  ) 

Skip forward in the read buffer.

Parameters:
aDistance The number of bytes to skip forward in the buffer (you can pass negative numbers)


Member Data Documentation

attribute PRUInt64 sbIMetadataChannel::pos

The current read position (for the read methods).

Todo:
Make "SetPos()" work past the end of the buffer. Right now, nothing is seekable.

Definition at line 55 of file sbIMetadataChannel.idl.

readonly attribute PRBool sbIMetadataChannel::seekable

If the datastream is seekable.

Todo:
Make "GetSeekable()" work. Right now, nothing is seekable.

Definition at line 68 of file sbIMetadataChannel.idl.


The documentation for this interface was generated from the following file:
Generated on Mon Aug 21 21:01:55 2006 for Songbird by  doxygen 1.4.7