Back to index

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

#include <nsDebugDetector.h>

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

List of all members.

Public Member Functions

 nsDebugDetector (nsDebugDetectorSel aSel)
virtual ~nsDebugDetector ()
NS_IMETHOD Init (nsICharsetDetectionObserver *aObserver)
NS_IMETHOD DoIt (const char *aBytesArray, PRUint32 aLen, PRBool *oDontFeedMe)
NS_IMETHOD Done ()

Protected Member Functions

virtual void Report ()

Private Attributes

PRInt32 mBlks
nsDebugDetectorSel mSel
nsICharsetDetectionObservermObserver
PRBool mStop

Detailed Description

Definition at line 64 of file nsDebugDetector.h.


Constructor & Destructor Documentation

Definition at line 48 of file nsDebugDetector.cpp.

{
  mSel = aSel;
  mBlks = 0;
  mObserver = nsnull;
  mStop = PR_FALSE;
}

Definition at line 56 of file nsDebugDetector.cpp.

{
}

Member Function Documentation

NS_IMETHODIMP nsDebugDetector::DoIt ( const char *  aBytesArray,
PRUint32  aLen,
PRBool oDontFeedMe 
) [virtual]

Implements nsICharsetDetector.

Definition at line 71 of file nsDebugDetector.cpp.

{
  NS_ASSERTION(mObserver != nsnull , "have not init yet");
  NS_ASSERTION(mStop == PR_FALSE , "don't call DoIt if we return PR_TRUE in oDontFeedMe");

  if((nsnull == aBytesArray) || (nsnull == oDontFeedMe))
     return NS_ERROR_ILLEGAL_VALUE;

  mBlks++;
  if((k1stBlk == mSel) && (1 == mBlks)) {
     *oDontFeedMe = mStop = PR_TRUE;
     Report();
  } else if((k2ndBlk == mSel) && (2 == mBlks)) {
     *oDontFeedMe = mStop = PR_TRUE;
     Report();
  } else {
     *oDontFeedMe = mStop = PR_FALSE;
  }
   
  return NS_OK;
}

Here is the call graph for this function:

Implements nsICharsetDetector.

Definition at line 94 of file nsDebugDetector.cpp.

{
  NS_ASSERTION(mObserver != nsnull , "have not init yet");
  if(klastBlk == mSel)
     Report();
  return NS_OK;
}

Here is the call graph for this function:

Implements nsICharsetDetector.

Definition at line 60 of file nsDebugDetector.cpp.

{
  NS_ASSERTION(mObserver == nsnull , "Init twice");
  if(nsnull == aObserver)
     return NS_ERROR_ILLEGAL_VALUE;

  mObserver = aObserver;
  return NS_OK;
}
void nsDebugDetector::Report ( ) [protected, virtual]

Definition at line 102 of file nsDebugDetector.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 83 of file nsDebugDetector.h.

Definition at line 85 of file nsDebugDetector.h.

Definition at line 84 of file nsDebugDetector.h.

Definition at line 86 of file nsDebugDetector.h.


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