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