1/* -*- C++ -*-
2 SPDX-FileCopyrightText: 1998 Netscape Communications Corporation <developer@mozilla.org>
3
4 SPDX-License-Identifier: MIT
5*/
6
7#ifndef JAPANESEGROUPPROBER_H
8#define JAPANESEGROUPPROBER_H
9
10#include "UnicodeGroupProber.h"
11#include "nsCharSetProber.h"
12#include "nsEUCJPProber.h"
13#include "nsSJISProber.h"
14
15#define JP_NUM_OF_PROBERS 3
16namespace kencodingprober
17{
18class KCODECS_NO_EXPORT JapaneseGroupProber : public nsCharSetProber
19{
20public:
21 JapaneseGroupProber();
22 ~JapaneseGroupProber() override;
23 nsProbingState HandleData(const char *aBuf, unsigned int aLen) override;
24 const char *GetCharSetName() override;
25 nsProbingState GetState(void) override
26 {
27 return mState;
28 }
29 void Reset(void) override;
30 float GetConfidence(void) override;
31
32#ifdef DEBUG_PROBE
33 void DumpStatus() override;
34#endif
35
36protected:
37 nsProbingState mState;
38 nsCharSetProber *mProbers[JP_NUM_OF_PROBERS];
39 bool mIsActive[JP_NUM_OF_PROBERS];
40 int mBestGuess;
41 unsigned int mActiveNum;
42};
43}
44#endif /* JAPANESEGROUPPROBER_H */
45

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