File indexing completed on 2024-04-28 03:53:04

0001 /*
0002     The Original Code is Mozilla Universal charset detector code.
0003 
0004     SPDX-FileCopyrightText: 2001 Netscape Communications Corporation
0005     SPDX-FileContributor: Shy Shalom <shooshX@gmail.com>
0006 
0007     SPDX-License-Identifier: MPL-1.1 OR GPL-2.0-or-later OR LGPL-2.1-or-later
0008 */
0009 
0010 #ifndef nsSBCSGroupProber_h__
0011 #define nsSBCSGroupProber_h__
0012 
0013 #include "nsCharSetProber.h"
0014 
0015 #define NUM_OF_SBCS_PROBERS 14
0016 
0017 namespace kencodingprober
0018 {
0019 class KCODECS_NO_EXPORT nsSBCSGroupProber : public nsCharSetProber
0020 {
0021 public:
0022     nsSBCSGroupProber();
0023     ~nsSBCSGroupProber() override;
0024     nsProbingState HandleData(const char *aBuf, unsigned int aLen) override;
0025     const char *GetCharSetName() override;
0026     nsProbingState GetState(void) override
0027     {
0028         return mState;
0029     }
0030     void Reset(void) override;
0031     float GetConfidence(void) override;
0032     void SetOpion() override
0033     {
0034     }
0035 
0036 #ifdef DEBUG_PROBE
0037     void DumpStatus() override;
0038 #endif
0039 
0040 protected:
0041     nsProbingState mState;
0042     nsCharSetProber *mProbers[NUM_OF_SBCS_PROBERS];
0043     bool mIsActive[NUM_OF_SBCS_PROBERS];
0044     int mBestGuess;
0045     unsigned int mActiveNum;
0046 };
0047 }
0048 
0049 #endif /* nsSBCSGroupProber_h__ */