nsCodingStateMachine Class Reference

#include <nsCodingStateMachine.h>

Collaboration diagram for nsCodingStateMachine:
Collaboration graph
[legend]

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
SMModelmModel

Detailed Description

Definition at line 60 of file nsCodingStateMachine.h.


Constructor & Destructor Documentation

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         };


Member Function Documentation

const char* nsCodingStateMachine::GetCodingStateMachine (  )  [inline]

Definition at line 82 of file nsCodingStateMachine.h.

Referenced by nsEscCharSetProber::HandleData().

00082 {return mModel->name;};

Here is the caller graph for this function:

PRUint32 nsCodingStateMachine::GetCurrentCharLen ( void   )  [inline]
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   };

Here is the caller graph for this function:

void nsCodingStateMachine::Reset ( void   )  [inline]

Field Documentation

Definition at line 87 of file nsCodingStateMachine.h.

Referenced by NextState().

Definition at line 86 of file nsCodingStateMachine.h.

Referenced by GetCurrentCharLen(), and NextState().

Definition at line 82 of file nsCodingStateMachine.h.

Referenced by NextState(), nsCodingStateMachine(), and Reset().

Definition at line 89 of file nsCodingStateMachine.h.

Referenced by NextState(), and nsCodingStateMachine().


The documentation for this class was generated from the following file:
Generated by  doxygen 1.6.2-20100208