EUCJPContextAnalysis Class Reference

#include <JpCntx.h>

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

Protected Member Functions

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

Detailed Description

Definition at line 122 of file JpCntx.h.


Member Function Documentation

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

Implements JapaneseContextAnalysis.

Definition at line 126 of file JpCntx.h.

00128   {
00129     if (*str == '\244' &&
00130           (unsigned char)*(str+1) >= (unsigned char)0xa1 &&
00131           (unsigned char)*(str+1) <= (unsigned char)0xf3)
00132       return (unsigned char)*(str+1) - (unsigned char)0xa1;
00133     return -1;
00134   };

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

Implements JapaneseContextAnalysis.

Definition at line 211 of file JpCntx.cpp.

00212 {
00213   //find out current char's byte length
00214   if (((unsigned char)*str == (unsigned char)0x8e) ||
00215       (((unsigned char)*str >= (unsigned char)0xa1) && 
00216       ((unsigned char)*str <= (unsigned char)0xfe)))
00217       *charLen = 2;
00218   else if ((unsigned char)*str == (unsigned char)0x8f)
00219     *charLen = 3;
00220   else
00221     *charLen = 1;
00222 
00223   //return its order if it is hiragana
00224   if ((unsigned char)*str == (unsigned char)0xa4 &&
00225       (unsigned char)*(str+1) >= (unsigned char)0xa1 && 
00226       (unsigned char)*(str+1) <= (unsigned char)0xf3)
00227      return (unsigned char)*(str+1) - (unsigned char)0xa1;
00228   return -1;
00229 }


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