#include <JpCntx.h>
Protected Member Functions | |
PRInt32 | GetOrder (const char *str, PRUint32 *charLen) |
PRInt32 | GetOrder (const char *str) |
Definition at line 122 of file JpCntx.h.
PRInt32 EUCJPContextAnalysis::GetOrder | ( | const char * | str | ) | [inline, protected, virtual] |
Implements JapaneseContextAnalysis.
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 }