• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDECore

  • kdecore
  • localization
  • probers
nsGB2312Prober.h
Go to the documentation of this file.
1/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/* -*- C++ -*-
3* Copyright (C) 1998 <developer@mozilla.org>
4*
5*
6* Permission is hereby granted, free of charge, to any person obtaining
7* a copy of this software and associated documentation files (the
8* "Software"), to deal in the Software without restriction, including
9* without limitation the rights to use, copy, modify, merge, publish,
10* distribute, sublicense, and/or sell copies of the Software, and to
11* permit persons to whom the Software is furnished to do so, subject to
12* the following conditions:
13*
14* The above copyright notice and this permission notice shall be included
15* in all copies or substantial portions of the Software.
16*
17* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24*/
25
26#ifndef nsGB2312Prober_h__
27#define nsGB2312Prober_h__
28
29#include "nsCharSetProber.h"
30#include "nsCodingStateMachine.h"
31#include "CharDistribution.h"
32
33// We use gb18030 to replace gb2312, because 18030 is a superset.
34namespace kencodingprober {
35class KDE_NO_EXPORT nsGB18030Prober: public nsCharSetProber {
36public:
37 nsGB18030Prober(void){mCodingSM = new nsCodingStateMachine(&GB18030SMModel);
38 Reset();};
39 virtual ~nsGB18030Prober(void){delete mCodingSM;};
40 nsProbingState HandleData(const char* aBuf, unsigned int aLen);
41 const char* GetCharSetName() {return "gb18030";};
42 nsProbingState GetState(void) {return mState;};
43 void Reset(void);
44 float GetConfidence(void);
45 void SetOpion() {};
46
47protected:
48 void GetDistribution(unsigned int aCharLen, const char* aStr);
49
50 nsCodingStateMachine* mCodingSM;
51 nsProbingState mState;
52
53 //GB2312ContextAnalysis mContextAnalyser;
54 GB2312DistributionAnalysis mDistributionAnalyser;
55 char mLastChar[2];
56
57};
58}
59
60#endif /* nsGB2312Prober_h__ */
61
CharDistribution.h
kencodingprober::GB2312DistributionAnalysis
Definition: CharDistribution.h:127
kencodingprober::nsCharSetProber
Definition: nsCharSetProber.h:42
kencodingprober::nsCodingStateMachine
Definition: nsCodingStateMachine.h:53
kencodingprober::nsGB18030Prober
Definition: nsGB2312Prober.h:35
kencodingprober::nsGB18030Prober::~nsGB18030Prober
virtual ~nsGB18030Prober(void)
Definition: nsGB2312Prober.h:39
kencodingprober::nsGB18030Prober::nsGB18030Prober
nsGB18030Prober(void)
Definition: nsGB2312Prober.h:37
kencodingprober::nsGB18030Prober::GetCharSetName
const char * GetCharSetName()
Definition: nsGB2312Prober.h:41
kencodingprober::nsGB18030Prober::GetState
nsProbingState GetState(void)
Definition: nsGB2312Prober.h:42
kencodingprober::nsGB18030Prober::GetDistribution
void GetDistribution(unsigned int aCharLen, const char *aStr)
kencodingprober::nsGB18030Prober::SetOpion
void SetOpion()
Definition: nsGB2312Prober.h:45
kencodingprober::nsGB18030Prober::mDistributionAnalyser
GB2312DistributionAnalysis mDistributionAnalyser
Definition: nsGB2312Prober.h:54
kencodingprober::nsGB18030Prober::mCodingSM
nsCodingStateMachine * mCodingSM
Definition: nsGB2312Prober.h:50
kencodingprober::nsGB18030Prober::mState
nsProbingState mState
Definition: nsGB2312Prober.h:51
kencodingprober
Definition: CharDistribution.cpp:37
kencodingprober::nsProbingState
nsProbingState
Definition: nsCharSetProber.h:34
kencodingprober::GB18030SMModel
KDE_NO_EXPORT SMModel GB18030SMModel
Definition: nsMBCSSM.cpp:305
nsCharSetProber.h
nsCodingStateMachine.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

Skip menu "KDECore"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal