|
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 #ifndef nsMBCSGroupProber_h__ |
|
7 #define nsMBCSGroupProber_h__ |
|
8 |
|
9 #include "nsSJISProber.h" |
|
10 #include "nsUTF8Prober.h" |
|
11 #include "nsEUCJPProber.h" |
|
12 #include "nsGB2312Prober.h" |
|
13 #include "nsEUCKRProber.h" |
|
14 #include "nsBig5Prober.h" |
|
15 #include "nsEUCTWProber.h" |
|
16 |
|
17 #define NUM_OF_PROBERS 7 |
|
18 |
|
19 class nsMBCSGroupProber: public nsCharSetProber { |
|
20 public: |
|
21 nsMBCSGroupProber(uint32_t aLanguageFilter); |
|
22 virtual ~nsMBCSGroupProber(); |
|
23 nsProbingState HandleData(const char* aBuf, uint32_t aLen); |
|
24 const char* GetCharSetName(); |
|
25 nsProbingState GetState(void) {return mState;} |
|
26 void Reset(void); |
|
27 float GetConfidence(void); |
|
28 |
|
29 #ifdef DEBUG_chardet |
|
30 void DumpStatus(); |
|
31 #endif |
|
32 #ifdef DEBUG_jgmyers |
|
33 void GetDetectorState(nsUniversalDetector::DetectorState (&states)[nsUniversalDetector::NumDetectors], uint32_t &offset); |
|
34 #endif |
|
35 |
|
36 protected: |
|
37 nsProbingState mState; |
|
38 nsCharSetProber* mProbers[NUM_OF_PROBERS]; |
|
39 bool mIsActive[NUM_OF_PROBERS]; |
|
40 int32_t mBestGuess; |
|
41 uint32_t mActiveNum; |
|
42 uint32_t mKeepNext; |
|
43 }; |
|
44 |
|
45 #endif /* nsMBCSGroupProber_h__ */ |
|
46 |