#include <nsCodingStateMachine.h>
Public Member Functions | |
nsCodingStateMachine (SMModel *sm) | |
nsSMState | NextState (char c) |
PRUint32 | GetCurrentCharLen (void) |
void | Reset (void) |
const char * | GetCodingStateMachine () |
Protected Attributes | |
nsSMState | mCurrentState |
PRUint32 | mCurrentCharLen |
PRUint32 | mCurrentBytePos |
SMModel * | mModel |
Definition at line 60 of file nsCodingStateMachine.h.
nsCodingStateMachine::nsCodingStateMachine | ( | SMModel * | sm | ) | [inline] |
Definition at line 62 of file nsCodingStateMachine.h.
References eStart, mCurrentState, and mModel.
00062 { 00063 mCurrentState = eStart; 00064 mModel = sm; 00065 };
const char* nsCodingStateMachine::GetCodingStateMachine | ( | ) | [inline] |
Definition at line 82 of file nsCodingStateMachine.h.
Referenced by nsEscCharSetProber::HandleData().
PRUint32 nsCodingStateMachine::GetCurrentCharLen | ( | void | ) | [inline] |
Definition at line 80 of file nsCodingStateMachine.h.
References mCurrentCharLen.
Referenced by nsUTF8Prober::HandleData(), nsSJISProber::HandleData(), nsGB18030Prober::HandleData(), nsEUCTWProber::HandleData(), nsEUCKRProber::HandleData(), nsEUCJPProber::HandleData(), and nsBig5Prober::HandleData().
00080 {return mCurrentCharLen;};
nsSMState nsCodingStateMachine::NextState | ( | char | c | ) | [inline] |
Definition at line 66 of file nsCodingStateMachine.h.
References SMModel::charLenTable, SMModel::classFactor, eStart, GETCLASS, GETFROMPCK, mCurrentBytePos, mCurrentCharLen, mCurrentState, mModel, and SMModel::stateTable.
Referenced by nsUTF8Prober::HandleData(), nsSJISProber::HandleData(), nsGB18030Prober::HandleData(), nsEUCTWProber::HandleData(), nsEUCKRProber::HandleData(), nsEUCJPProber::HandleData(), nsEscCharSetProber::HandleData(), and nsBig5Prober::HandleData().
00066 { 00067 //for each byte we get its class , if it is first byte, we also get byte length 00068 PRUint32 byteCls = GETCLASS(c); 00069 if (mCurrentState == eStart) 00070 { 00071 mCurrentBytePos = 0; 00072 mCurrentCharLen = mModel->charLenTable[byteCls]; 00073 } 00074 //from byte's class and stateTable, we get its next state 00075 mCurrentState=(nsSMState)GETFROMPCK(mCurrentState*(mModel->classFactor)+byteCls, 00076 mModel->stateTable); 00077 mCurrentBytePos++; 00078 return mCurrentState; 00079 };
void nsCodingStateMachine::Reset | ( | void | ) | [inline] |
Definition at line 81 of file nsCodingStateMachine.h.
References eStart, and mCurrentState.
Referenced by nsUTF8Prober::Reset(), nsSJISProber::Reset(), nsGB18030Prober::Reset(), nsEUCTWProber::Reset(), nsEUCKRProber::Reset(), nsEUCJPProber::Reset(), and nsBig5Prober::Reset().
00081 {mCurrentState = eStart;};
PRUint32 nsCodingStateMachine::mCurrentBytePos [protected] |
Definition at line 87 of file nsCodingStateMachine.h.
Referenced by NextState().
PRUint32 nsCodingStateMachine::mCurrentCharLen [protected] |
Definition at line 86 of file nsCodingStateMachine.h.
Referenced by GetCurrentCharLen(), and NextState().
nsSMState nsCodingStateMachine::mCurrentState [protected] |
Definition at line 82 of file nsCodingStateMachine.h.
Referenced by NextState(), nsCodingStateMachine(), and Reset().
SMModel* nsCodingStateMachine::mModel [protected] |
Definition at line 89 of file nsCodingStateMachine.h.
Referenced by NextState(), and nsCodingStateMachine().