1/* -*- C++ -*-
2 SPDX-FileCopyrightText: 1998 Netscape Communications Corporation <developer@mozilla.org>
3
4 SPDX-License-Identifier: MIT
5*/
6
7#ifndef nsEscCharSetProber_h__
8#define nsEscCharSetProber_h__
9
10#include <array>
11#include <memory>
12
13#include "nsCharSetProber.h"
14#include "nsCodingStateMachine.h"
15
16namespace kencodingprober
17{
18class KCODECS_NO_EXPORT nsEscCharSetProber : public nsCharSetProber
19{
20public:
21 nsEscCharSetProber(void);
22 ~nsEscCharSetProber(void) override;
23 nsProbingState HandleData(const char *aBuf, unsigned int aLen) override;
24 const char *GetCharSetName() override
25 {
26 return mDetectedCharset;
27 }
28 nsProbingState GetState(void) override
29 {
30 return mState;
31 }
32 void Reset(void) override;
33 float GetConfidence(void) override
34 {
35 return (float)0.99;
36 }
37
38protected:
39 std::array<std::unique_ptr<nsCodingStateMachine>, 2> mCodingSM;
40 nsProbingState mState = eDetecting;
41 const char *mDetectedCharset = nullptr;
42};
43}
44#endif /* nsEscCharSetProber_h__ */
45

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