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

0001 /*  -*- C++ -*-
0002     SPDX-FileCopyrightText: 1998 Netscape Communications Corporation <developer@mozilla.org>
0003 
0004     SPDX-License-Identifier: MIT
0005 */
0006 
0007 #ifndef nsLatin1Prober_h__
0008 #define nsLatin1Prober_h__
0009 
0010 #include "nsCharSetProber.h"
0011 
0012 #define FREQ_CAT_NUM 4
0013 namespace kencodingprober
0014 {
0015 class KCODECS_NO_EXPORT nsLatin1Prober : public nsCharSetProber
0016 {
0017 public:
0018     nsLatin1Prober(void)
0019     {
0020         Reset();
0021     }
0022     ~nsLatin1Prober(void) override
0023     {
0024     }
0025     nsProbingState HandleData(const char *aBuf, unsigned int aLen) override;
0026     const char *GetCharSetName() override
0027     {
0028         return "windows-1252";
0029     }
0030     nsProbingState GetState(void) override
0031     {
0032         return mState;
0033     }
0034     void Reset(void) override;
0035     float GetConfidence(void) override;
0036     void SetOpion() override
0037     {
0038     }
0039 
0040 #ifdef DEBUG_PROBE
0041     void DumpStatus() override;
0042 #endif
0043 
0044 protected:
0045     nsProbingState mState;
0046     char mLastCharClass;
0047     unsigned int mFreqCounter[FREQ_CAT_NUM];
0048 };
0049 }
0050 
0051 #endif /* nsLatin1Prober_h__ */