Changeset 408
- Timestamp:
- 07/22/08 11:28:32 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/BAL/ChangeLogOWB
r407 r408 1 2008-07-22 Mario Bensi <mbensi@pleyo.com> 2 3 Reviewed by Olivier DOLE. 4 move all method inline 5 6 * OWBAL/Concretizations/Internationalization/Generic/BCUnicodeGeneric.cpp: Removed. 7 * OWBAL/Concretizations/Internationalization/Generic/BCUnicodeGeneric.h: 8 (WTF::Unicode::toLower): 9 (WTF::Unicode::foldCase): 10 (WTF::Unicode::toUpper): 11 (WTF::Unicode::toTitleCase): 12 (WTF::Unicode::isArabicChar): 13 (WTF::Unicode::category): 14 (WTF::Unicode::isFormatChar): 15 (WTF::Unicode::isSeparatorSpace): 16 (WTF::Unicode::isPrintableChar): 17 (WTF::Unicode::isDigit): 18 (WTF::Unicode::isPunct): 19 (WTF::Unicode::mirroredChar): 20 (WTF::Unicode::direction): 21 (WTF::Unicode::isLower): 22 (WTF::Unicode::digitValue): 23 (WTF::Unicode::combiningClass): 24 (WTF::Unicode::decompositionType): 25 (WTF::Unicode::umemcasecmp): 26 1 27 2008-07-21 Olivier DOLE <odole@pleyo.com> 2 28 trunk/BAL/OWBAL/Concretizations/Internationalization/Generic/BCUnicodeGeneric.h
r243 r408 126 126 }; 127 127 128 UChar32 toLower(UChar32 c); 129 int toLower(UChar* result, int resultLength, const UChar* src, int srcLength, bool* error); 130 UChar32 toUpper(UChar32 c); 131 int toUpper(UChar* result, int resultLength, const UChar* src, int srcLength, bool* error); 132 UChar32 foldCase(UChar32 c); 133 int foldCase(UChar* result, int resultLength, const UChar* src, int srcLength, bool* error); 134 UChar32 toTitleCase(UChar32 c); 135 bool isFormatChar(UChar32 c); 136 bool isSeparatorSpace(UChar32 c); 137 bool isPrintableChar(UChar32 c); 138 bool isDigit(UChar32 c); 139 bool isPunct(UChar32 c); 140 UChar32 mirroredChar(UChar32 c); 141 CharCategory category(UChar32 c); 142 Direction direction(UChar32 c); 143 bool isLower(UChar32 c); 144 bool isUpper(UChar32 c); 145 int digitValue(UChar32 c); 146 uint8_t combiningClass(UChar32 c); 147 DecompositionType decompositionType(UChar32 c); 148 int umemcasecmp(const UChar* a, const UChar* b, int len); 149 bool isArabicChar(UChar32 c); 150 /*inline UChar32 toLower(UChar32 c) 128 inline UChar32 toLower(UChar32 c) 151 129 { 152 130 if ((c >= 0x41 && c <= 0x5A) || (c >= 0xC0 && c <= 0xDE)) … … 171 149 for (int i = 0; i < srcLength; ++i) 172 150 result[i] = foldCase(src[i]); 151 173 152 return srcLength; 174 153 } … … 197 176 inline int toUpper(UChar* result, int resultLength, const UChar* src, int srcLength, bool* error) 198 177 { 178 //printf("toUpper\n"); 199 179 *error = false; 200 180 if (resultLength < srcLength) { … … 209 189 inline UChar32 toTitleCase(UChar32 c) 210 190 { 211 return c; 191 //printf("toTitleCase\n"); 192 return toUpper(c); 212 193 } 213 194 214 195 inline bool isArabicChar(UChar32 c) 215 196 { 216 BalNotImplemented(); 197 //printf("isArabicChar\n"); 198 //BalNotImplemented(); 217 199 return false; 218 200 } … … 220 202 inline CharCategory category(UChar32 c) 221 203 { 204 //printf("category\n"); 222 205 if (c == 0x0D) 223 206 return WTF::Unicode::Separator_Line; … … 253 236 inline bool isFormatChar(UChar32 c) 254 237 { 238 //printf("isFormatChar\n"); 255 239 return (c & 0xffff0000) == 0 && category(c) == WTF::Unicode::Other_Format; 256 240 } … … 258 242 inline bool isSeparatorSpace(UChar32 c) 259 243 { 244 //printf("isSeparatorSpace\n"); 260 245 return (c & 0xffff0000) == 0 && category(c) == WTF::Unicode::Separator_Space; 261 246 } … … 263 248 inline bool isPrintableChar(UChar32 c) 264 249 { 265 BalNotImplemented(); 250 //printf("isPrintableChar c=%x\n",c); 251 //BalNotImplemented(); 266 252 return false; 267 253 } … … 269 255 inline bool isDigit(UChar32 c) 270 256 { 257 //printf("isDigit\n"); 271 258 return (c & 0xffff0000) == 0 && category(c) == WTF::Unicode::Number_DecimalDigit; 272 259 } … … 274 261 inline bool isPunct(UChar32 c) 275 262 { 263 //printf("isPunct\n"); 276 264 return (c & 0xffff0000) == 0 && (category(c) == WTF::Unicode::Punctuation_Dash 277 265 || category(c) == WTF::Unicode::Punctuation_Open … … 285 273 inline UChar32 mirroredChar(UChar32 c) 286 274 { 287 BalNotImplemented(); 275 //printf("mirroredChar\n"); 276 //BalNotImplemented(); 288 277 return c; 289 278 } … … 291 280 inline Direction direction(UChar32 c) 292 281 { 293 BalNotImplemented(); 282 //printf("direction\n"); 283 //BalNotImplemented(); 294 284 return WTF::Unicode::LeftToRight; 295 285 } … … 297 287 inline bool isLower(UChar32 c) 298 288 { 289 //printf("isLower\n"); 299 290 return (c & 0xffff0000) == 0 && category(c) == WTF::Unicode::Letter_Lowercase; 300 291 } … … 302 293 inline int digitValue(UChar32 c) 303 294 { 295 //printf("digitValue\n"); 304 296 return c-0x30; 305 297 } … … 307 299 inline unsigned char combiningClass(UChar32 c) 308 300 { 309 BalNotImplemented(); 301 //printf("combiningClass\n"); 302 //BalNotImplemented(); 310 303 return c; 311 304 } … … 313 306 inline DecompositionType decompositionType(UChar32 c) 314 307 { 315 BalNotImplemented(); 308 //printf("decompositionType\n"); 309 //BalNotImplemented(); 316 310 return WTF::Unicode::DecompositionNone; 317 311 } … … 319 313 inline int umemcasecmp(const UChar* a, const UChar* b, int len) 320 314 { 315 //printf("umemcasecmp len =%d\n", len); 321 316 for (int i = 0; i < len; ++i) { 322 317 UChar32 c1 = toLower(a[i]); 323 318 UChar32 c2 = toLower(b[i]); 324 319 if (c1 != c2) 325 return c1 < c2;320 return -1; 326 321 } 327 322 return 0; 328 }*/ 323 } 324 329 325 330 326 }
