nsProbingState nsSBCSGroupProber::HandleData(const char* aBuf, uint32_t aLen) { nsProbingState st; uint32_t i; char *newBuf1 = 0; uint32_t newLen1 = 0; //apply filter to original buffer, and we got new buffer back //depend on what script it is, we will feed them the new buffer //we got after applying proper filter //this is done without any consideration to KeepEnglishLetters //of each prober since as of now, there are no probers here which //recognize languages with English characters. if (!FilterWithoutEnglishLetters(aBuf, aLen, &newBuf1, newLen1)) goto done; if (newLen1 == 0) goto done; // Nothing to see here, move on. for (i = 0; i < NUM_OF_SBCS_PROBERS; i++) { if (!mIsActive[i]) continue; st = mProbers[i]->HandleData(newBuf1, newLen1); if (st == eFoundIt) { mBestGuess = i; mState = eFoundIt; break; } else if (st == eNotMe) { mIsActive[i] = false; mActiveNum--; if (mActiveNum <= 0) { mState = eNotMe; break; } } } done: free(newBuf1); return mState; }
ProbingState SBCSGroupProber::HandleData(const char* aBuf, PRUint32 aLen) { ProbingState st; PRUint32 i; char *newBuf1; PRUint32 newLen1; //apply filter to original buffer, and we got new buffer back //depend on what script it is, we will feed them the new buffer //we got after applying proper filter FilterWithoutEnglishLetters(aBuf, aLen, &newBuf1, newLen1); for (i = 0; i < NUM_OF_SBCS_PROBERS; i++) { if (!mIsActive[i]) continue; st = mProbers[i]->HandleData(newBuf1, newLen1); if (st == eFoundIt) { mBestGuess = i; mState = eFoundIt; break; } else if (st == eNotMe) { mIsActive[i] = PR_FALSE; mActiveNum--; if (mActiveNum <= 0) { mState = eNotMe; break; } } } PR_FREEIF(newBuf1); return mState; }