| 1 | /* -*- C++ -*- |
| 2 | SPDX-FileCopyrightText: 1998 Netscape Communications Corporation <developer@mozilla.org> |
| 3 | |
| 4 | SPDX-License-Identifier: MIT |
| 5 | */ |
| 6 | |
| 7 | #ifndef nsMBCSGroupProber_h__ |
| 8 | #define nsMBCSGroupProber_h__ |
| 9 | |
| 10 | #include "UnicodeGroupProber.h" |
| 11 | #include "nsBig5Prober.h" |
| 12 | #include "nsEUCJPProber.h" |
| 13 | #include "nsEUCKRProber.h" |
| 14 | #include "nsGB2312Prober.h" |
| 15 | #include "nsSJISProber.h" |
| 16 | |
| 17 | #define NUM_OF_PROBERS 6 |
| 18 | namespace kencodingprober |
| 19 | { |
| 20 | class KCODECS_NO_EXPORT nsMBCSGroupProber : public nsCharSetProber |
| 21 | { |
| 22 | public: |
| 23 | nsMBCSGroupProber(); |
| 24 | ~nsMBCSGroupProber() override; |
| 25 | nsProbingState HandleData(const char *aBuf, unsigned int aLen) override; |
| 26 | const char *GetCharSetName() override; |
| 27 | nsProbingState GetState(void) override |
| 28 | { |
| 29 | return mState; |
| 30 | } |
| 31 | void Reset(void) override; |
| 32 | float GetConfidence(void) override; |
| 33 | |
| 34 | #ifdef DEBUG_PROBE |
| 35 | void DumpStatus() override; |
| 36 | #endif |
| 37 | |
| 38 | protected: |
| 39 | nsProbingState mState; |
| 40 | nsCharSetProber *mProbers[NUM_OF_PROBERS]; |
| 41 | bool mIsActive[NUM_OF_PROBERS]; |
| 42 | int mBestGuess; |
| 43 | unsigned int mActiveNum; |
| 44 | }; |
| 45 | } |
| 46 | |
| 47 | #endif /* nsMBCSGroupProber_h__ */ |
| 48 | |