Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions
nsJACharsetClassicDetector Class Reference

#include <nsClassicDetectors.h>

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

List of all members.

Public Member Functions

 nsJACharsetClassicDetector ()
NS_IMETHOD Init (nsICharsetDetectionObserver *aObserver)
NS_IMETHOD DoIt (const char *aBuf, PRUint32 aLen, PRBool *oDontFeedMe)
NS_IMETHOD Done ()

Detailed Description

Definition at line 95 of file nsClassicDetectors.h.


Constructor & Destructor Documentation

Definition at line 98 of file nsClassicDetectors.h.

    : nsClassicDetector("ja") {};

Member Function Documentation

NS_IMETHODIMP nsClassicDetector::DoIt ( const char *  aBuf,
PRUint32  aLen,
PRBool oDontFeedMe 
) [virtual, inherited]

Implements nsICharsetDetector.

Definition at line 240 of file nsClassicDetectors.cpp.

{
  NS_ASSERTION(mObserver != nsnull , "have not init yet");

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

  if (!PL_strcasecmp("ja", mLanguage) &&
      NS_SUCCEEDED(JA_AutoCharsetDetectBuffer(aBuf, (PRInt32) aLen, mCharset))) {
    mObserver->Notify(mCharset, eBestAnswer);
  }
  else {
    mObserver->Notify("", eNoAnswerMatch);
  }

  *oDontFeedMe = PR_TRUE;

  return NS_OK;
}

Here is the call graph for this function:

NS_IMETHODIMP nsClassicDetector::Done ( ) [virtual, inherited]

Implements nsICharsetDetector.

Definition at line 261 of file nsClassicDetectors.cpp.

{
  NS_ASSERTION(mObserver != nsnull , "have not init yet");
  return NS_OK;
}
NS_IMETHODIMP nsClassicDetector::Init ( nsICharsetDetectionObserver aObserver) [virtual, inherited]

Implements nsICharsetDetector.

Definition at line 228 of file nsClassicDetectors.cpp.

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

  mObserver = aObserver;

  return NS_OK;
}

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