Line data Source code
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 :
13 : #define NUM_OF_PROBERS 3
14 :
15 : class nsMBCSGroupProber: public nsCharSetProber {
16 : public:
17 : nsMBCSGroupProber();
18 : virtual ~nsMBCSGroupProber();
19 : nsProbingState HandleData(const char* aBuf, uint32_t aLen);
20 : const char* GetCharSetName();
21 0 : nsProbingState GetState(void) {return mState;}
22 : void Reset(void);
23 : float GetConfidence(void);
24 :
25 : #ifdef DEBUG_chardet
26 : void DumpStatus();
27 : #endif
28 : #ifdef DEBUG_jgmyers
29 : void GetDetectorState(nsUniversalDetector::DetectorState (&states)[nsUniversalDetector::NumDetectors], uint32_t &offset);
30 : #endif
31 :
32 : protected:
33 : nsProbingState mState;
34 : nsCharSetProber* mProbers[NUM_OF_PROBERS];
35 : bool mIsActive[NUM_OF_PROBERS];
36 : int32_t mBestGuess;
37 : uint32_t mActiveNum;
38 : uint32_t mKeepNext;
39 : };
40 :
41 : #endif /* nsMBCSGroupProber_h__ */
42 :
|