Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Attributes
nsDiskCacheOutputStream Class Reference
Inheritance diagram for nsDiskCacheOutputStream:
Inheritance graph
[legend]
Collaboration diagram for nsDiskCacheOutputStream:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsDiskCacheOutputStream (nsDiskCacheStreamIO *parent)
virtual ~nsDiskCacheOutputStream ()
NS_DECL_ISUPPORTS
NS_DECL_NSIOUTPUTSTREAM void 
ReleaseStreamIO ()
void close ()
 Close the stream.
void flush ()
 Flush the stream.
unsigned long write (in string aBuf, in unsigned long aCount)
 Write data into the stream.
unsigned long writeFrom (in nsIInputStream aFromStream, in unsigned long aCount)
 Writes data into the stream from an input stream.
unsigned long writeSegments (in nsReadSegmentFun aReader, in voidPtr aClosure, in unsigned long aCount)
 Low-level write method that has access to the stream's underlying buffer.
boolean isNonBlocking ()

Private Attributes

nsDiskCacheStreamIOmStreamIO
PRBool mClosed

Detailed Description

Definition at line 200 of file nsDiskCacheStreams.cpp.


Constructor & Destructor Documentation

Definition at line 227 of file nsDiskCacheStreams.cpp.

{
    Close();
    ReleaseStreamIO();
}

Here is the call graph for this function:


Member Function Documentation

void nsIOutputStream::close ( ) [inherited]

Close the stream.

Forces the output stream to flush any buffered data.

Exceptions:
NS_BASE_STREAM_WOULD_BLOCKif unable to flush without blocking the calling thread (non-blocking mode only)
void nsIOutputStream::flush ( ) [inherited]

Flush the stream.

Exceptions:
NS_BASE_STREAM_WOULD_BLOCKif unable to flush without blocking the calling thread (non-blocking mode only)
Returns:
true if stream is non-blocking

NOTE: writing to a blocking output stream will block the calling thread until all given data can be consumed by the stream.

NS_DECL_ISUPPORTS NS_DECL_NSIOUTPUTSTREAM void nsDiskCacheOutputStream::ReleaseStreamIO ( ) [inline]

Definition at line 208 of file nsDiskCacheStreams.cpp.

Here is the caller graph for this function:

unsigned long nsIOutputStream::write ( in string  aBuf,
in unsigned long  aCount 
) [inherited]

Write data into the stream.

Parameters:
aBufthe buffer containing the data to be written
aCountthe maximum number of bytes to be written
Returns:
number of bytes written (may be less than aCount)
Exceptions:
NS_BASE_STREAM_WOULD_BLOCKif writing to the output stream would block the calling thread (non-blocking mode only)
<other-error>on failure
unsigned long nsIOutputStream::writeFrom ( in nsIInputStream  aFromStream,
in unsigned long  aCount 
) [inherited]

Writes data into the stream from an input stream.

Parameters:
aFromStreamthe stream containing the data to be written
aCountthe maximum number of bytes to be written
Returns:
number of bytes written (may be less than aCount)
Exceptions:
NS_BASE_STREAM_WOULD_BLOCKif writing to the output stream would block the calling thread (non-blocking mode only)
<other-error>on failure

NOTE: This method is defined by this interface in order to allow the output stream to efficiently copy the data from the input stream into its internal buffer (if any). If this method was provided as an external facility, a separate char* buffer would need to be used in order to call the output stream's other Write method.

unsigned long nsIOutputStream::writeSegments ( in nsReadSegmentFun  aReader,
in voidPtr  aClosure,
in unsigned long  aCount 
) [inherited]

Low-level write method that has access to the stream's underlying buffer.

The reader function may be called multiple times for segmented buffers. WriteSegments is expected to keep calling the reader until either there is nothing left to write or the reader returns an error. WriteSegments should not call the reader with zero bytes to provide.

Parameters:
aReaderthe "provider" of the data to be written
aClosureopaque parameter passed to reader
aCountthe maximum number of bytes to be written
Returns:
number of bytes written (may be less than aCount)
Exceptions:
NS_BASE_STREAM_WOULD_BLOCKif writing to the output stream would block the calling thread (non-blocking mode only)
<other-error>on failure

NOTE: this function may be unimplemented if a stream has no underlying buffer (e.g., socket output stream).


Member Data Documentation

Definition at line 212 of file nsDiskCacheStreams.cpp.

Definition at line 211 of file nsDiskCacheStreams.cpp.


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