1/*
2 The Original Code is Mozilla Universal charset detector code.
3
4 SPDX-FileCopyrightText: 2001 Netscape Communications Corporation
5 SPDX-FileContributor: Shy Shalom <shooshX@gmail.com>
6
7 SPDX-License-Identifier: MPL-1.1 OR GPL-2.0-or-later OR LGPL-2.1-or-later
8*/
9
10#ifndef nsSBCSGroupProber_h__
11#define nsSBCSGroupProber_h__
12
13#include "nsCharSetProber.h"
14
15#include <array>
16
17#define NUM_OF_SBCS_PROBERS 12
18
19namespace kencodingprober
20{
21class KCODECS_NO_EXPORT nsSBCSGroupProber : public nsCharSetProber
22{
23public:
24 nsSBCSGroupProber();
25 ~nsSBCSGroupProber() override;
26 nsProbingState HandleData(const char *aBuf, unsigned int aLen) override;
27 const char *GetCharSetName() override;
28 nsProbingState GetState(void) override
29 {
30 return mState;
31 }
32 void Reset(void) override;
33 float GetConfidence(void) override;
34
35#ifdef DEBUG_PROBE
36 void DumpStatus() override;
37#endif
38
39protected:
40 nsProbingState mState;
41 std::array<nsCharSetProber *, NUM_OF_SBCS_PROBERS> mProbers = {nullptr};
42 std::array<bool, NUM_OF_SBCS_PROBERS> mIsActive = {false};
43 int mBestGuess;
44};
45}
46
47#endif /* nsSBCSGroupProber_h__ */
48

source code of kcodecs/src/probers/nsSBCSGroupProber.h