Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes
TokenStreamListener Class Reference

This class downloads the raw content of an email message, buffering until complete segments are seen, that is until a linefeed is seen, although any of the valid token separators would do. More...

Inheritance diagram for TokenStreamListener:
Inheritance graph
[legend]
Collaboration diagram for TokenStreamListener:
Collaboration graph
[legend]

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS
NS_DECL_NSIREQUESTOBSERVER
NS_DECL_NSISTREAMLISTENER
NS_DECL_NSIMSGHEADERSINK 
TokenStreamListener (TokenAnalyzer *analyzer)
virtual ~TokenStreamListener ()
void onDataAvailable (in nsIRequest aRequest, in nsISupports aContext, in nsIInputStream aInputStream, in unsigned long aOffset, in unsigned long aCount)
 Called when the next chunk of data (corresponding to the request) may be read without blocking the calling thread.
void onStartRequest (in nsIRequest aRequest, in nsISupports aContext)
 Called to signify the beginning of an asynchronous request.
void onStopRequest (in nsIRequest aRequest, in nsISupports aContext, in nsresult aStatusCode)
 Called to signify the end of an asynchronous request.

Protected Attributes

TokenAnalyzermAnalyzer
char * mBuffer
PRUint32 mBufferSize
PRUint32 mLeftOverCount
Tokenizer mTokenizer
PRBool mSetAttachmentFlag

Private Member Functions

void processHeaders (in nsIUTF8StringEnumerator aHeaderNames, in nsIUTF8StringEnumerator aHeaderValues, in boolean dontCollectAddress)
void handleAttachment (in string contentType, in string url, in wstring displayName, in string uri, in boolean aNotDownloaded)
void onEndAllAttachments ()
void onEndMsgHeaders (in nsIMsgMailNewsUrl url)
void onEndMsgDownload (in nsIMsgMailNewsUrl url)
void onMsgHasRemoteContent (in nsIMsgDBHdr aMsgHdr)
nsIMsgDBHdr getDummyMsgHeader ()

Private Attributes

attribute nsISupports securityInfo
readonly attribute
nsIWritablePropertyBag2 
properties

Detailed Description

This class downloads the raw content of an email message, buffering until complete segments are seen, that is until a linefeed is seen, although any of the valid token separators would do.

This could be a further refinement.

Definition at line 710 of file nsBayesianFilter.cpp.


Constructor & Destructor Documentation

Definition at line 737 of file nsBayesianFilter.cpp.

{
    delete[] mBuffer;
    delete mAnalyzer;
}

Member Function Documentation

void nsIMsgHeaderSink::handleAttachment ( in string  contentType,
in string  url,
in wstring  displayName,
in string  uri,
in boolean  aNotDownloaded 
) [inherited]
void nsIStreamListener::onDataAvailable ( in nsIRequest  aRequest,
in nsISupports  aContext,
in nsIInputStream  aInputStream,
in unsigned long  aOffset,
in unsigned long  aCount 
) [inherited]

Called when the next chunk of data (corresponding to the request) may be read without blocking the calling thread.

The onDataAvailable impl must read exactly |aCount| bytes of data before returning.

Parameters:
aRequestrequest corresponding to the source of the data
aContextuser defined context
aInputStreaminput stream containing the data chunk
aOffsetNumber of bytes that were sent in previous onDataAvailable calls for this request. In other words, the sum of all previous count parameters. If that number is greater than or equal to 2^32, this parameter will be PR_UINT32_MAX (2^32 - 1).
aCountnumber of bytes available in the stream

NOTE: The aInputStream parameter must implement readSegments.

An exception thrown from onDataAvailable has the side-effect of causing the request to be canceled.

void nsIRequestObserver::onStartRequest ( in nsIRequest  aRequest,
in nsISupports  aContext 
) [inherited]

Called to signify the beginning of an asynchronous request.

Parameters:
aRequestrequest being observed
aContextuser defined context

An exception thrown from onStartRequest has the side-effect of causing the request to be canceled.

Here is the caller graph for this function:

void nsIRequestObserver::onStopRequest ( in nsIRequest  aRequest,
in nsISupports  aContext,
in nsresult  aStatusCode 
) [inherited]

Called to signify the end of an asynchronous request.

This call is always preceded by a call to onStartRequest.

Parameters:
aRequestrequest being observed
aContextuser defined context
aStatusCodereason for stopping (NS_OK if completed successfully)

An exception thrown from onStopRequest is generally ignored.

Here is the caller graph for this function:

void nsIMsgHeaderSink::processHeaders ( in nsIUTF8StringEnumerator  aHeaderNames,
in nsIUTF8StringEnumerator  aHeaderValues,
in boolean  dontCollectAddress 
) [inherited]

Member Data Documentation

Definition at line 720 of file nsBayesianFilter.cpp.

char* TokenStreamListener::mBuffer [protected]

Definition at line 721 of file nsBayesianFilter.cpp.

Definition at line 722 of file nsBayesianFilter.cpp.

Definition at line 723 of file nsBayesianFilter.cpp.

Definition at line 725 of file nsBayesianFilter.cpp.

Definition at line 724 of file nsBayesianFilter.cpp.

Definition at line 91 of file nsIMimeMiscStatus.idl.

attribute nsISupports nsIMsgHeaderSink::securityInfo [inherited]

Definition at line 83 of file nsIMimeMiscStatus.idl.


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