/src/kcodecs/src/probers/nsBig5Prober.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 nsBig5Prober_h__ |
8 | | #define nsBig5Prober_h__ |
9 | | |
10 | | #include "CharDistribution.h" |
11 | | #include "nsCharSetProber.h" |
12 | | #include "nsCodingStateMachine.h" |
13 | | |
14 | | #include <memory> |
15 | | |
16 | | namespace kencodingprober |
17 | | { |
18 | | class KCODECS_NO_EXPORT nsBig5Prober : public nsCharSetProber |
19 | | { |
20 | | public: |
21 | | nsBig5Prober(); |
22 | 4.59k | ~nsBig5Prober() override = default; |
23 | | |
24 | | nsProbingState HandleData(const char *aBuf, unsigned int aLen) override; |
25 | | const char *GetCharSetName() override |
26 | 124 | { |
27 | 124 | return "Big5"; |
28 | 124 | } |
29 | | nsProbingState GetState(void) override |
30 | 0 | { |
31 | 0 | return mState; |
32 | 0 | } |
33 | | float GetConfidence(void) override; |
34 | | |
35 | | protected: |
36 | | std::unique_ptr<nsCodingStateMachine> mCodingSM; |
37 | | nsProbingState mState = eDetecting; |
38 | | |
39 | | // Big5ContextAnalysis mContextAnalyser; |
40 | | Big5DistributionAnalysis mDistributionAnalyser; |
41 | | |
42 | | char mLastChar[2] = {0}; |
43 | | }; |
44 | | } |
45 | | |
46 | | #endif /* nsBig5Prober_h__ */ |