/src/kcodecs/src/probers/nsLatin1Prober.h
Line | Count | Source |
1 | | /* -*- C++ -*- |
2 | | SPDX-FileCopyrightText: 1998 Netscape Communications Corporation <developer@mozilla.org> |
3 | | |
4 | | SPDX-License-Identifier: MIT |
5 | | */ |
6 | | |
7 | | #ifndef nsLatin1Prober_h__ |
8 | | #define nsLatin1Prober_h__ |
9 | | |
10 | | #include "nsCharSetProber.h" |
11 | | |
12 | 6.52k | #define FREQ_CAT_NUM 4 |
13 | | namespace kencodingprober |
14 | | { |
15 | | class KCODECS_NO_EXPORT nsLatin1Prober : public nsCharSetProber |
16 | | { |
17 | | public: |
18 | | nsLatin1Prober(void) |
19 | 1.30k | { |
20 | 1.30k | Reset(); |
21 | 1.30k | } |
22 | | ~nsLatin1Prober(void) override |
23 | 0 | { |
24 | 0 | } |
25 | | nsProbingState HandleData(const char *aBuf, unsigned int aLen) override; |
26 | | const char *GetCharSetName() override |
27 | 0 | { |
28 | 0 | return "windows-1252"; |
29 | 0 | } |
30 | | nsProbingState GetState(void) override |
31 | 0 | { |
32 | 0 | return mState; |
33 | 0 | } |
34 | | void Reset(void) override; |
35 | | float GetConfidence(void) override; |
36 | | |
37 | | #ifdef DEBUG_PROBE |
38 | | void DumpStatus() override; |
39 | | #endif |
40 | | |
41 | | protected: |
42 | | nsProbingState mState; |
43 | | char mLastCharClass; |
44 | | unsigned int mFreqCounter[FREQ_CAT_NUM]; |
45 | | }; |
46 | | } |
47 | | |
48 | | #endif /* nsLatin1Prober_h__ */ |