7#ifndef nsCodingStateMachine_h__
8#define nsCodingStateMachine_h__
10#include "kencodingprober.h"
12#include "kcodecs_export.h"
15namespace kencodingprober
24#define GETCLASS(c) GETFROMPCK(((unsigned char)(c)), mModel->classTable)
29 unsigned int classFactor;
31 const unsigned int *charLenTable;
35class KCODECS_NO_EXPORT nsCodingStateMachine
38 nsCodingStateMachine(
const SMModel *sm)
40 mCurrentState = eStart;
43 nsSMState NextState(
char c)
46 unsigned int byteCls = GETCLASS(c);
47 if (mCurrentState == eStart) {
49 mCurrentCharLen = mModel->charLenTable[byteCls];
52 mCurrentState = GETFROMPCK(mCurrentState * (mModel->classFactor) + byteCls, mModel->stateTable);
56 unsigned int GetCurrentCharLen(
void)
58 return mCurrentCharLen;
62 mCurrentState = eStart;
64 const char *GetCodingStateMachine()
69 const char *DumpCurrentState()
71 switch (mCurrentState) {
86 unsigned int mCurrentCharLen;
87 unsigned int mCurrentBytePos;
89 const SMModel *mModel;
92extern KCODECS_NO_EXPORT
const SMModel UTF8SMModel;
93extern KCODECS_NO_EXPORT
const SMModel Big5SMModel;
94extern KCODECS_NO_EXPORT
const SMModel EUCJPSMModel;
95extern KCODECS_NO_EXPORT
const SMModel EUCKRSMModel;
96extern KCODECS_NO_EXPORT
const SMModel GB18030SMModel;
97extern KCODECS_NO_EXPORT
const SMModel SJISSMModel;
98extern KCODECS_NO_EXPORT
const SMModel UCS2LESMModel;
99extern KCODECS_NO_EXPORT
const SMModel UCS2BESMModel;
101extern KCODECS_NO_EXPORT
const SMModel HZSMModel;
102extern KCODECS_NO_EXPORT
const SMModel ISO2022CNSMModel;
103extern KCODECS_NO_EXPORT
const SMModel ISO2022JPSMModel;
104extern KCODECS_NO_EXPORT
const SMModel ISO2022KRSMModel;
QString name(StandardAction id)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 13 2024 11:48:48 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.