SJISContextAnalysis Class Reference

#include <JpCntx.h>

Inheritance diagram for SJISContextAnalysis:
Inheritance graph
[legend]
Collaboration diagram for SJISContextAnalysis:
Collaboration graph
[legend]

Protected Member Functions

PRInt32 GetOrder (const char *str, PRUint32 *charLen)
PRInt32 GetOrder (const char *str)

Detailed Description

Definition at line 105 of file JpCntx.h.


Member Function Documentation

PRInt32 SJISContextAnalysis::GetOrder ( const char *  str  )  [inline, protected, virtual]

Implements JapaneseContextAnalysis.

Definition at line 111 of file JpCntx.h.

00112   {
00113     //We only interested in Hiragana, so first byte is '\202'
00114     if (*str == '\202' && 
00115           (unsigned char)*(str+1) >= (unsigned char)0x9f && 
00116           (unsigned char)*(str+1) <= (unsigned char)0xf1)
00117       return (unsigned char)*(str+1) - (unsigned char)0x9f;
00118     return -1;
00119   };

PRInt32 SJISContextAnalysis::GetOrder ( const char *  str,
PRUint32 charLen 
) [protected, virtual]

Implements JapaneseContextAnalysis.

Definition at line 194 of file JpCntx.cpp.

00195 {
00196   //find out current char's byte length
00197   if (((unsigned char)*str >= (unsigned char)0x81 && (unsigned char)*str <= (unsigned char)0x9f) || 
00198       ((unsigned char)*str >= (unsigned char)0xe0 && (unsigned char)*str <= (unsigned char)0xfc ))
00199       *charLen = 2;
00200   else 
00201       *charLen = 1;
00202 
00203   //return its order if it is hiragana
00204   if (*str == '\202' && 
00205         (unsigned char)*(str+1) >= (unsigned char)0x9f && 
00206         (unsigned char)*(str+1) <= (unsigned char)0xf1)
00207     return (unsigned char)*(str+1) - (unsigned char)0x9f;
00208   return -1;
00209 }


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