File indexing completed on 2024-05-05 16:05:50
0001 /* -*- C++ -*- 0002 SPDX-FileCopyrightText: 1998 Netscape Communications Corporation <developer@mozilla.org> 0003 0004 SPDX-License-Identifier: MIT 0005 */ 0006 0007 #ifndef JAPANESEGROUPPROBER_H 0008 #define JAPANESEGROUPPROBER_H 0009 0010 #include "UnicodeGroupProber.h" 0011 #include "nsCharSetProber.h" 0012 #include "nsEUCJPProber.h" 0013 #include "nsSJISProber.h" 0014 0015 #define JP_NUM_OF_PROBERS 3 0016 namespace kencodingprober 0017 { 0018 class KCODECS_NO_EXPORT JapaneseGroupProber : public nsCharSetProber 0019 { 0020 public: 0021 JapaneseGroupProber(); 0022 ~JapaneseGroupProber() override; 0023 nsProbingState HandleData(const char *aBuf, unsigned int aLen) override; 0024 const char *GetCharSetName() override; 0025 nsProbingState GetState(void) override 0026 { 0027 return mState; 0028 } 0029 void Reset(void) override; 0030 float GetConfidence(void) override; 0031 void SetOpion() override 0032 { 0033 } 0034 0035 #ifdef DEBUG_PROBE 0036 void DumpStatus() override; 0037 #endif 0038 0039 protected: 0040 nsProbingState mState; 0041 nsCharSetProber *mProbers[JP_NUM_OF_PROBERS]; 0042 bool mIsActive[JP_NUM_OF_PROBERS]; 0043 int mBestGuess; 0044 unsigned int mActiveNum; 0045 }; 0046 } 0047 #endif /* JAPANESEGROUPPROBER_H */