1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 //------------------------------------------------------------------------ 29 //------------------------------------------------------------------------ 30 31 #ifndef _RTL_STRING_CONST_H_ 32 #define _RTL_STRING_CONST_H_ 33 34 #ifndef _RTL_STRING_UTILS_HXX_ 35 #include <rtl_String_Utils.hxx> 36 #endif 37 38 //------------------------------------------------------------------------ 39 //------------------------------------------------------------------------ 40 41 #include <limits.h> 42 43 //------------------------------------------------------------------------ 44 //------------------------------------------------------------------------ 45 46 #ifndef _SAL_TYPES_H_ 47 #include <sal/types.h> 48 #endif 49 50 #ifndef _RTL_TEXTENC_H 51 #include <rtl/textenc.h> 52 #endif 53 54 #ifndef _RTL_USTRING_H_ 55 #include <rtl/ustring.h> 56 #endif 57 58 //------------------------------------------------------------------------ 59 //------------------------------------------------------------------------ 60 61 #ifdef __cplusplus 62 extern "C" 63 { 64 #endif 65 66 //------------------------------------------------------------------------ 67 //------------------------------------------------------------------------ 68 69 static const rtl_TextEncoding kEncodingRTLTextUSASCII = RTL_TEXTENCODING_ASCII_US; 70 71 //------------------------------------------------------------------------ 72 //------------------------------------------------------------------------ 73 74 static const sal_uInt32 kConvertFlagsOUStringToOString = OUSTRING_TO_OSTRING_CVTFLAGS; 75 static const sal_uInt32 kConvertFlagsOStringToOUString = OSTRING_TO_OUSTRING_CVTFLAGS; 76 77 //------------------------------------------------------------------------ 78 //------------------------------------------------------------------------ 79 80 static const sal_Char *kTestStr1 = "Sun Microsystems"; 81 static const sal_Char *kTestStr2 = "Sun Microsystems Java Technology"; 82 static const sal_Char *kTestStr3 = "Sun microsystems"; 83 static const sal_Char *kTestStr4 = "SUN MICROSYSTEMS"; 84 static const sal_Char *kTestStr5 = "sun microsystems"; 85 static const sal_Char *kTestStr6 = "Java Technology"; 86 static const sal_Char *kTestStr7 = "Sun "; 87 static const sal_Char *kTestStr8 = "Microsystems"; 88 static const sal_Char *kTestStr9 = "sun microsystems java technology"; 89 static const sal_Char *kTestStr10 = " Sun Microsystems"; 90 static const sal_Char *kTestStr11 = "Sun Microsystems "; 91 static const sal_Char *kTestStr12 = " Sun Microsystems "; 92 static const sal_Char *kTestStr13 = "Sun Microsystems "; 93 static const sal_Char *kTestStr14 = " Sun Microsystems"; 94 static const sal_Char *kTestStr15 = " Sun Microsystems "; 95 static const sal_Char *kTestStr16 = " Sun Microsystems "; 96 static const sal_Char *kTestStr17 = " Sun Microsystems "; 97 static const sal_Char *kTestStr18 = "sUN MICROsYsTEMs"; 98 static const sal_Char *kTestStr19 = "---Sun-Microsystems---"; 99 static const sal_Char *kTestStr20 = "sun"; 100 static const sal_Char *kTestStr21 = "SUN"; 101 static const sal_Char *kTestStr22 = "SUN MICROSYSTEMS JAVA TECHNOLOGY"; 102 static const sal_Char *kTestStr23 = " Java Technology"; 103 static const sal_Char *kTestStr24 = "Sun Microsystems Java Technolog"; 104 static const sal_Char *kTestStr25 = ""; 105 static const sal_Char *kTestStr26 = " Mic"; 106 static const sal_Char *kTestStr27 = "s"; 107 static const sal_Char *kTestStr28 = "\50\3\5\7\11\13\15\17sun"; 108 static const sal_Char *kTestStr29 = "\50\3\5\7\11\13\15\17sun\21\23\25\27\31\33\50"; 109 static const sal_Char *kTestStr30 = "sun\21\23\25\27\31\33\50"; 110 static const sal_Char *kTestStr31 = "sun Microsystems"; 111 static const sal_Char *kTestStr32 = "Sun Microsystem "; 112 static const sal_Char *kTestStr33 = " "; 113 static const sal_Char *kTestStr34 = "\50\5\5\7\11\13\15\17sun"; 114 static const sal_Char *kTestStr35 = "\50\373\5\7\11\13\15\17sun"; 115 static const sal_Char *kTestStr36 = "Microsystems Java Technology"; 116 static const sal_Char *kTestStr37 = "Sun Java Technology"; 117 static const sal_Char *kTestStr38 = "\21\23\25\27\31\33\50"; 118 static const sal_Char *kTestStr39 = "\50\3\5\7\11\13\15\17sun Sun Microsystems "; 119 static const sal_Char *kTestStr40 = "\50\3\5\7\11\13\15\17sunsun Microsystems"; 120 static const sal_Char *kTestStr41 = "Sun"; 121 static const sal_Char *kTestStr42 = "\50\3\5\7\11\13\15\17su"; 122 static const sal_Char *kTestStr43 = "\50\3\5\7\11\13\15\17sun\256\345"; 123 static const sal_Char *kTestStr44 = "\256\345"; 124 static const sal_Char *kTestStr45 = "Sun true"; 125 static const sal_Char *kTestStr46 = "Sun false"; 126 static const sal_Char *kTestStr47 = "true"; 127 static const sal_Char *kTestStr48 = "false"; 128 static const sal_Char *kTestStr49 = "\50\3\5\7\11\13\15\17suntrue"; 129 static const sal_Char *kTestStr50 = "\50\3\5\7\11\13\15\17sunfalse"; 130 static const sal_Char *kTestStr51 = "Sun M"; 131 //static const sal_Char *kTestStr52 = "Sun \077777"; 132 //static const sal_Char *kTestStr53 = "Sun \100000"; 133 //static const sal_Char *kTestStr54 = "\77777"; 134 //static const sal_Char *kTestStr55 = "\100000"; 135 static const sal_Char *kTestStr56 = "\50\3\5\7\11\13\15\17suns"; 136 //static const sal_Char *kTestStr57 = "\50\3\5\7\11\13\15\17sun\77777"; 137 //static const sal_Char *kTestStr58 = "\50\3\5\7\11\13\15\17sun\10000"; 138 static const sal_Char *kTestStr1PlusStr6 = "Sun Microsystems" "Java Technology"; 139 //------------------------------------------------------------------------ 140 //------------------------------------------------------------------------ 141 142 static const sal_Int32 kTestStr1Len = 16; 143 static const sal_Int32 kTestStr2Len = 32; 144 static const sal_Int32 kTestStr3Len = 16; 145 static const sal_Int32 kTestStr4Len = 16; 146 static const sal_Int32 kTestStr5Len = 16; 147 static const sal_Int32 kTestStr6Len = 15; 148 static const sal_Int32 kTestStr7Len = 4; 149 static const sal_Int32 kTestStr8Len = 12; 150 static const sal_Int32 kTestStr9Len = 32; 151 static const sal_Int32 kTestStr10Len = 17; 152 static const sal_Int32 kTestStr11Len = 17; 153 static const sal_Int32 kTestStr12Len = 18; 154 static const sal_Int32 kTestStr13Len = 19; 155 static const sal_Int32 kTestStr14Len = 19; 156 static const sal_Int32 kTestStr15Len = 20; 157 static const sal_Int32 kTestStr16Len = 20; 158 static const sal_Int32 kTestStr17Len = 22; 159 static const sal_Int32 kTestStr18Len = 16; 160 static const sal_Int32 kTestStr19Len = 22; 161 static const sal_Int32 kTestStr20Len = 3; 162 static const sal_Int32 kTestStr21Len = 3; 163 static const sal_Int32 kTestStr22Len = 32; 164 static const sal_Int32 kTestStr23Len = 16; 165 static const sal_Int32 kTestStr24Len = 31; 166 static const sal_Int32 kTestStr25Len = 0; 167 static const sal_Int32 kTestStr26Len = 4; 168 static const sal_Int32 kTestStr27Len = 1; 169 static const sal_Int32 kTestStr28Len = 11; 170 static const sal_Int32 kTestStr29Len = 18; 171 static const sal_Int32 kTestStr30Len = 10; 172 static const sal_Int32 kTestStr31Len = 16; 173 static const sal_Int32 kTestStr32Len = 16; 174 static const sal_Int32 kTestStr33Len = 1; 175 static const sal_Int32 kTestStr34Len = 11; 176 static const sal_Int32 kTestStr35Len = 11; 177 static const sal_Int32 kTestStr36Len = 28; 178 static const sal_Int32 kTestStr37Len = 20; 179 static const sal_Int32 kTestStr38Len = 7; 180 static const sal_Int32 kTestStr39Len = 33; 181 static const sal_Int32 kTestStr40Len = 27; 182 static const sal_Int32 kTestStr41Len = 3; 183 static const sal_Int32 kTestStr42Len = 10; 184 static const sal_Int32 kTestStr43Len = 13; 185 static const sal_Int32 kTestStr44Len = 2; 186 static const sal_Int32 kTestStr45Len = 8; 187 static const sal_Int32 kTestStr46Len = 9; 188 static const sal_Int32 kTestStr47Len = 4; 189 static const sal_Int32 kTestStr48Len = 5; 190 static const sal_Int32 kTestStr49Len = 15; 191 static const sal_Int32 kTestStr50Len = 16; 192 static const sal_Int32 kTestStr51Len = 5; 193 static const sal_Int32 kTestStr52Len = 5; 194 static const sal_Int32 kTestStr53Len = 5; 195 static const sal_Int32 kTestStr54Len = 1; 196 static const sal_Int32 kTestStr55Len = 1; 197 static const sal_Int32 kTestStr56Len = 12; 198 static const sal_Int32 kTestStr57Len = 12; 199 static const sal_Int32 kTestStr58Len = 12; 200 static const sal_Int32 kTestStr1PlusStr6Len = kTestStr1Len + kTestStr6Len; 201 202 //------------------------------------------------------------------------ 203 //------------------------------------------------------------------------ 204 static sal_Unicode aUStr1[kTestStr1Len+1]; 205 static sal_Unicode aUStr2[kTestStr2Len+1]; 206 static sal_Unicode aUStr3[kTestStr3Len+1]; 207 static sal_Unicode aUStr4[kTestStr4Len+1]; 208 static sal_Unicode aUStr5[kTestStr5Len+1]; 209 static sal_Unicode aUStr6[kTestStr6Len+1]; 210 static sal_Unicode aUStr7[kTestStr7Len+1]; 211 static sal_Unicode aUStr8[kTestStr8Len+1]; 212 static sal_Unicode aUStr9[kTestStr9Len+1]; 213 static sal_Unicode aUStr10[kTestStr10Len+1]; 214 static sal_Unicode aUStr11[kTestStr11Len+1]; 215 static sal_Unicode aUStr12[kTestStr12Len+1]; 216 static sal_Unicode aUStr13[kTestStr13Len+1]; 217 static sal_Unicode aUStr14[kTestStr14Len+1]; 218 static sal_Unicode aUStr15[kTestStr15Len+1]; 219 static sal_Unicode aUStr16[kTestStr16Len+1]; 220 static sal_Unicode aUStr17[kTestStr17Len+1]; 221 static sal_Unicode aUStr18[kTestStr18Len+1]; 222 static sal_Unicode aUStr19[kTestStr19Len+1]; 223 static sal_Unicode aUStr20[kTestStr20Len+1]; 224 static sal_Unicode aUStr21[kTestStr21Len+1]; 225 static sal_Unicode aUStr22[kTestStr22Len+1]; 226 static sal_Unicode aUStr23[kTestStr23Len+1]; 227 static sal_Unicode aUStr24[kTestStr24Len+1]; 228 static sal_Unicode aUStr25[kTestStr25Len+1]; 229 static sal_Unicode aUStr26[kTestStr26Len+1]; 230 static sal_Unicode aUStr27[kTestStr27Len+1]; 231 static sal_Unicode aUStr28[kTestStr28Len+1]; 232 static sal_Unicode aUStr29[kTestStr29Len+1]; 233 static sal_Unicode aUStr30[kTestStr30Len+1]; 234 static sal_Unicode aUStr31[kTestStr31Len+1]; 235 static sal_Unicode aUStr32[kTestStr32Len+1]; 236 static sal_Unicode aUStr33[kTestStr33Len+1]; 237 static sal_Unicode aUStr34[kTestStr34Len+1]; 238 static sal_Unicode aUStr35[kTestStr35Len+1]; 239 static sal_Unicode aUStr36[kTestStr36Len+1]; 240 static sal_Unicode aUStr37[kTestStr37Len+1]; 241 static sal_Unicode aUStr38[kTestStr38Len+1]; 242 static sal_Unicode aUStr39[kTestStr39Len+1]; 243 static sal_Unicode aUStr40[kTestStr40Len+1]; 244 static sal_Unicode aUStr41[kTestStr41Len+1]; 245 static sal_Unicode aUStr42[kTestStr42Len+1]; 246 static sal_Unicode aUStr43[kTestStr43Len+1]; 247 static sal_Unicode aUStr44[kTestStr44Len+1]; 248 static sal_Unicode aUStr45[kTestStr45Len+1]; 249 static sal_Unicode aUStr46[kTestStr46Len+1]; 250 static sal_Unicode aUStr47[kTestStr47Len+1]; 251 static sal_Unicode aUStr48[kTestStr48Len+1]; 252 static sal_Unicode aUStr49[kTestStr49Len+1]; 253 static sal_Unicode aUStr50[kTestStr50Len+1]; 254 static sal_Unicode aUStr51[kTestStr51Len+1]; 255 // static sal_Unicode aUStr52[kTestStr52Len+1]={83,117,110,32,32767}; 256 // static sal_Unicode aUStr53[kTestStr53Len+1]={83,117,110,32,SAL_MIN_INT16 /*-32768*/}; 257 // static sal_Unicode aUStr54[kTestStr54Len+1]={32767}; 258 // static sal_Unicode aUStr55[kTestStr55Len+1]={SAL_MIN_INT16 /*-32768*/}; 259 static sal_Unicode aUStr56[kTestStr56Len+1]; 260 // static sal_Unicode aUStr57[kTestStr57Len+1]={40,3,5,7,9,11,13,15,115,117,110,32767}; 261 // static sal_Unicode aUStr58[kTestStr58Len+1]={40,3,5,7,9,11,13,15,115,117,110,SAL_MIN_INT16 /*-32768*/}; 262 static sal_Unicode aUStr1PlusUStr6[kTestStr1Len + kTestStr6Len + 1]; 263 264 // we are already in "C" 265 266 static sal_Bool SAL_CALL test_ini_uString() 267 { 268 269 sal_Bool iniResult= sal_True; 270 271 iniResult &=AStringToUStringNCopy( aUStr1, kTestStr1, kTestStr1Len ); 272 273 iniResult &=AStringToUStringNCopy( aUStr2, kTestStr2, kTestStr2Len ); 274 275 iniResult &=AStringToUStringNCopy( aUStr3, kTestStr3, kTestStr3Len ); 276 277 iniResult &=AStringToUStringNCopy( aUStr4, kTestStr4, kTestStr4Len ); 278 279 iniResult &=AStringToUStringNCopy( aUStr5, kTestStr5, kTestStr5Len ); 280 281 iniResult &=AStringToUStringNCopy( aUStr6, kTestStr6, kTestStr6Len ); 282 283 iniResult &=AStringToUStringNCopy( aUStr7, kTestStr7, kTestStr7Len ); 284 285 iniResult &=AStringToUStringNCopy( aUStr8, kTestStr8, kTestStr8Len ); 286 287 iniResult &=AStringToUStringNCopy( aUStr9, kTestStr9, kTestStr9Len ); 288 289 iniResult &=AStringToUStringNCopy( aUStr10, kTestStr10, kTestStr10Len ); 290 291 iniResult &=AStringToUStringNCopy( aUStr11, kTestStr11, kTestStr11Len ); 292 293 iniResult &=AStringToUStringNCopy( aUStr12, kTestStr12, kTestStr12Len ); 294 295 iniResult &=AStringToUStringNCopy( aUStr13, kTestStr13, kTestStr13Len ); 296 297 iniResult &=AStringToUStringNCopy( aUStr14, kTestStr14, kTestStr14Len ); 298 299 iniResult &=AStringToUStringNCopy( aUStr15, kTestStr15, kTestStr15Len ); 300 301 iniResult &=AStringToUStringNCopy( aUStr16, kTestStr16, kTestStr16Len ); 302 303 iniResult &=AStringToUStringNCopy( aUStr17, kTestStr17, kTestStr17Len ); 304 305 iniResult &=AStringToUStringNCopy( aUStr18, kTestStr18, kTestStr18Len ); 306 307 iniResult &=AStringToUStringNCopy( aUStr19, kTestStr19, kTestStr19Len ); 308 309 iniResult &=AStringToUStringNCopy( aUStr20, kTestStr20, kTestStr20Len ); 310 311 iniResult &=AStringToUStringNCopy( aUStr21, kTestStr21, kTestStr21Len ); 312 313 iniResult &=AStringToUStringNCopy( aUStr22, kTestStr22, kTestStr22Len ); 314 315 iniResult &=AStringToUStringNCopy( aUStr23, kTestStr23, kTestStr23Len ); 316 317 iniResult &=AStringToUStringNCopy( aUStr1PlusUStr6, kTestStr1PlusStr6, kTestStr1PlusStr6Len ); 318 319 iniResult &=AStringToUStringNCopy( aUStr24, kTestStr24, kTestStr24Len ); 320 321 iniResult &=AStringToUStringNCopy( aUStr25, kTestStr25, kTestStr25Len ); 322 323 iniResult &=AStringToUStringNCopy( aUStr26, kTestStr26, kTestStr26Len ); 324 325 iniResult &=AStringToUStringNCopy( aUStr27, kTestStr27, kTestStr27Len ); 326 327 iniResult &=AStringToUStringNCopy( aUStr28, kTestStr28, kTestStr28Len ); 328 329 iniResult &=AStringToUStringNCopy( aUStr29, kTestStr29, kTestStr29Len ); 330 331 iniResult &=AStringToUStringNCopy( aUStr30, kTestStr30, kTestStr30Len ); 332 333 iniResult &=AStringToUStringNCopy( aUStr31, kTestStr31, kTestStr31Len ); 334 335 iniResult &=AStringToUStringNCopy( aUStr32, kTestStr32, kTestStr32Len ); 336 337 iniResult &=AStringToUStringNCopy( aUStr33, kTestStr33, kTestStr33Len ); 338 339 iniResult &=AStringToUStringNCopy( aUStr34, kTestStr34, kTestStr34Len ); 340 341 iniResult &=AStringToUStringNCopy( aUStr35, kTestStr35, kTestStr35Len ); 342 343 iniResult &=AStringToUStringNCopy( aUStr36, kTestStr36, kTestStr36Len ); 344 345 iniResult &=AStringToUStringNCopy( aUStr37, kTestStr37, kTestStr37Len ); 346 347 iniResult &=AStringToUStringNCopy( aUStr38, kTestStr38, kTestStr38Len ); 348 349 iniResult &=AStringToUStringNCopy( aUStr39, kTestStr39, kTestStr39Len ); 350 351 iniResult &=AStringToUStringNCopy( aUStr40, kTestStr40, kTestStr40Len ); 352 353 iniResult &=AStringToUStringNCopy( aUStr41, kTestStr41, kTestStr41Len ); 354 355 iniResult &=AStringToUStringNCopy( aUStr42, kTestStr42, kTestStr42Len ); 356 357 iniResult &=AStringToUStringNCopy( aUStr43, kTestStr43, kTestStr43Len ); 358 359 iniResult &=AStringToUStringNCopy( aUStr44, kTestStr44, kTestStr44Len ); 360 361 iniResult &=AStringToUStringNCopy( aUStr45, kTestStr45, kTestStr45Len ); 362 363 iniResult &=AStringToUStringNCopy( aUStr46, kTestStr46, kTestStr46Len ); 364 365 iniResult &=AStringToUStringNCopy( aUStr47, kTestStr47, kTestStr47Len ); 366 367 iniResult &=AStringToUStringNCopy( aUStr48, kTestStr48, kTestStr48Len ); 368 369 iniResult &=AStringToUStringNCopy( aUStr49, kTestStr49, kTestStr49Len ); 370 371 iniResult &=AStringToUStringNCopy( aUStr50, kTestStr50, kTestStr50Len ); 372 373 iniResult &=AStringToUStringNCopy( aUStr51, kTestStr51, kTestStr51Len ); 374 375 //iniResult &=AStringToUStringNCopy( aUStr52, kTestStr52, kTestStr52Len ); 376 377 // iniResult &=AStringToUStringNCopy( aUStr53, kTestStr53, kTestStr53Len ); 378 379 //iniResult &=AStringToUStringNCopy( aUStr54, kTestStr54, kTestStr54Len ); 380 381 //iniResult &=AStringToUStringNCopy( aUStr55, kTestStr55, kTestStr55Len ); 382 383 iniResult &=AStringToUStringNCopy( aUStr56, kTestStr56, kTestStr56Len ); 384 385 // iniResult &=AStringToUStringNCopy( aUStr57, kTestStr57, kTestStr57Len ); 386 387 //iniResult &=AStringToUStringNCopy( aUStr58, kTestStr58, kTestStr58Len ); 388 return iniResult; 389 390 } 391 392 393 394 395 static const sal_Int32 uTestStr1Len = 16; 396 static const sal_Int32 uTestStr2Len = 32; 397 static const sal_Int32 uTestStr3Len = 16; 398 static const sal_Int32 uTestStr4Len = 16; 399 static const sal_Int32 uTestStr5Len = 16; 400 static const sal_Int32 uTestStr9Len = 32; 401 static const sal_Int32 uTestStr22Len = 32; 402 403 404 405 //------------------------------------------------------------------------ 406 //------------------------------------------------------------------------ 407 const sal_Unicode uTestStr31[]= {0x400,0x410,0x4DF}; 408 const sal_Unicode uTestStr32[]= {0x9F9F,0xA000,0x8F80,0x9AD9}; 409 410 411 412 //------------------------------------------------------------------------ 413 //------------------------------------------------------------------------ 414 415 static const sal_Int32 uTestStr31Len = 3; 416 static const sal_Int32 uTestStr32Len = 4; 417 418 //------------------------------------------------------------------------ 419 //------------------------------------------------------------------------ 420 421 static const sal_Int16 kRadixBinary = 2; 422 static const sal_Int16 kRadixOctol = 8; 423 static const sal_Int16 kRadixDecimal = 10; 424 static const sal_Int16 kRadixHexdecimal = 16; 425 static const sal_Int16 kRadixBase36 = 36; 426 427 //------------------------------------------------------------------------ 428 //------------------------------------------------------------------------ 429 430 static const sal_Int8 kSInt8Max = SCHAR_MAX; 431 static const sal_Int16 kUInt8Max = UCHAR_MAX; 432 static const sal_Int16 kSInt16Max = SHRT_MAX; 433 static const sal_Int32 kUInt16Max = USHRT_MAX; 434 static const sal_Int32 kSInt32Max = INT_MAX; 435 static const sal_Int64 kUInt32Max = UINT_MAX; 436 #if (defined UNX) || (defined OS2) 437 static const sal_Int64 kSInt64Max = 9223372036854775807LL; 438 #else 439 static const sal_Int64 kSInt64Max = 9223372036854775807; 440 #endif 441 //------------------------------------------------------------------------ 442 443 static const sal_Int32 kInt32MaxNumsCount = 5; 444 445 static const sal_Int32 kInt32MaxNums[kInt32MaxNumsCount] = 446 { 447 kSInt8Max, kUInt8Max, 448 kSInt16Max, kUInt16Max, 449 kSInt32Max 450 }; 451 452 static const sal_Int32 kInt64MaxNumsCount = 7; 453 454 static const sal_Int64 kInt64MaxNums[kInt64MaxNumsCount] = 455 { 456 kSInt8Max, kUInt8Max, 457 kSInt16Max, kUInt16Max, 458 kSInt32Max, kUInt32Max, 459 kSInt64Max 460 }; 461 462 //------------------------------------------------------------------------ 463 //------------------------------------------------------------------------ 464 465 static const sal_Char *kSInt8MaxBinaryStr = "1111111"; 466 static const sal_Char *kUInt8MaxBinaryStr = "11111111"; 467 static const sal_Char *kSInt16MaxBinaryStr = "111111111111111"; 468 static const sal_Char *kUInt16MaxBinaryStr = "1111111111111111"; 469 static const sal_Char *kSInt32MaxBinaryStr = 470 "1111111111111111111111111111111"; 471 static const sal_Char *kUInt32MaxBinaryStr = 472 "11111111111111111111111111111111"; 473 static const sal_Char *kSInt64MaxBinaryStr = 474 "111111111111111111111111111111111111111111111111111111111111111"; 475 476 //------------------------------------------------------------------------ 477 478 static const sal_Char *kSInt8MaxOctolStr = "177"; 479 static const sal_Char *kUInt8MaxOctolStr = "377"; 480 static const sal_Char *kSInt16MaxOctolStr = "77777"; 481 static const sal_Char *kUInt16MaxOctolStr = "177777"; 482 static const sal_Char *kSInt32MaxOctolStr = "17777777777"; 483 static const sal_Char *kUInt32MaxOctolStr = "37777777777"; 484 static const sal_Char *kSInt64MaxOctolStr = "777777777777777777777"; 485 486 //------------------------------------------------------------------------ 487 488 static const sal_Char *kSInt8MaxDecimalStr = "127"; 489 static const sal_Char *kUInt8MaxDecimalStr = "255"; 490 static const sal_Char *kSInt16MaxDecimalStr = "32767"; 491 static const sal_Char *kUInt16MaxDecimalStr = "65535"; 492 static const sal_Char *kSInt32MaxDecimalStr = "2147483647"; 493 static const sal_Char *kUInt32MaxDecimalStr = "4294967295"; 494 static const sal_Char *kSInt64MaxDecimalStr = "9223372036854775807"; 495 496 //------------------------------------------------------------------------ 497 498 static const sal_Char *kSInt8MaxHexDecimalStr = "7f"; 499 static const sal_Char *kUInt8MaxHexDecimalStr = "ff"; 500 static const sal_Char *kSInt16MaxHexDecimalStr = "7fff"; 501 static const sal_Char *kUInt16MaxHexDecimalStr = "ffff"; 502 static const sal_Char *kSInt32MaxHexDecimalStr = "7fffffff"; 503 static const sal_Char *kUInt32MaxHexDecimalStr = "ffffffff"; 504 static const sal_Char *kSInt64MaxHexDecimalStr = "7fffffffffffffff"; 505 506 //------------------------------------------------------------------------ 507 508 static const sal_Char *kSInt8MaxBase36Str = "3j"; 509 static const sal_Char *kUInt8MaxBase36Str = "73"; 510 static const sal_Char *kSInt16MaxBase36Str = "pa7"; 511 static const sal_Char *kUInt16MaxBase36Str = "1ekf"; 512 static const sal_Char *kSInt32MaxBase36Str = "zik0zj"; 513 static const sal_Char *kUInt32MaxBase36Str = "1z141z3"; 514 static const sal_Char *kSInt64MaxBase36Str = "1y2p0ij32e8e7"; 515 516 //------------------------------------------------------------------------ 517 //------------------------------------------------------------------------ 518 519 static const sal_Int32 kBinaryNumsCount = 16; 520 521 static const sal_Char *kBinaryNumsStr[kBinaryNumsCount] = 522 { 523 "0", "1", "10", "11", 524 "100", "101", "110", "111", 525 "1000", "1001", "1010", "1011", 526 "1100", "1101", "1110", "1111" 527 }; 528 529 static const sal_Int32 kBinaryMaxNumsCount = 7; 530 531 static const sal_Char *kBinaryMaxNumsStr[kBinaryMaxNumsCount] = 532 { 533 kSInt8MaxBinaryStr, 534 kUInt8MaxBinaryStr, 535 kSInt16MaxBinaryStr, 536 kUInt16MaxBinaryStr, 537 kSInt32MaxBinaryStr, 538 kUInt32MaxBinaryStr, 539 kSInt64MaxBinaryStr 540 }; 541 542 //------------------------------------------------------------------------ 543 544 static const sal_Int32 kOctolNumsCount = 16; 545 546 static const sal_Char *kOctolNumsStr[kOctolNumsCount] = 547 { 548 "0", "1", "2", "3", 549 "4", "5", "6", "7", 550 "10", "11", "12", "13", 551 "14", "15", "16", "17" 552 }; 553 554 static const sal_Int32 kOctolMaxNumsCount = 7; 555 556 static const sal_Char *kOctolMaxNumsStr[kOctolMaxNumsCount] = 557 { 558 kSInt8MaxOctolStr, 559 kUInt8MaxOctolStr, 560 kSInt16MaxOctolStr, 561 kUInt16MaxOctolStr, 562 kSInt32MaxOctolStr, 563 kUInt32MaxOctolStr, 564 kSInt64MaxOctolStr 565 }; 566 567 //------------------------------------------------------------------------ 568 569 static const sal_Int32 kDecimalNumsCount = 16; 570 571 static const sal_Char *kDecimalNumsStr[kDecimalNumsCount] = 572 { 573 "0", "1", "2", "3", 574 "4", "5", "6", "7", 575 "8", "9", "10", "11", 576 "12", "13", "14", "15" 577 }; 578 579 static const sal_Int32 kDecimalMaxNumsCount = 7; 580 581 static const sal_Char *kDecimalMaxNumsStr[kDecimalMaxNumsCount] = 582 { 583 kSInt8MaxDecimalStr, 584 kUInt8MaxDecimalStr, 585 kSInt16MaxDecimalStr, 586 kUInt16MaxDecimalStr, 587 kSInt32MaxDecimalStr, 588 kUInt32MaxDecimalStr, 589 kSInt64MaxDecimalStr 590 }; 591 592 //------------------------------------------------------------------------ 593 594 static const sal_Int32 kHexDecimalNumsCount = 16; 595 596 static const sal_Char *kHexDecimalNumsStr[kHexDecimalNumsCount] = 597 { 598 "0", "1", "2", "3", 599 "4", "5", "6", "7", 600 "8", "9", "a", "b", 601 "c", "d", "e", "f" 602 }; 603 604 static const sal_Int32 kHexDecimalMaxNumsCount = 7; 605 606 static const sal_Char *kHexDecimalMaxNumsStr[kHexDecimalMaxNumsCount] = 607 { 608 kSInt8MaxHexDecimalStr, 609 kUInt8MaxHexDecimalStr, 610 kSInt16MaxHexDecimalStr, 611 kUInt16MaxHexDecimalStr, 612 kSInt32MaxHexDecimalStr, 613 kUInt32MaxHexDecimalStr, 614 kSInt64MaxHexDecimalStr 615 }; 616 617 //------------------------------------------------------------------------ 618 619 static const sal_Int32 kBase36NumsCount = 36; 620 621 static const sal_Char *kBase36NumsStr[kBase36NumsCount] = 622 { 623 "0", "1", "2", "3", 624 "4", "5", "6", "7", 625 "8", "9", "a", "b", 626 "c", "d", "e", "f", 627 "g", "h", "i", "j", 628 "k", "l", "m", "n", 629 "o", "p", "q", "r", 630 "s", "t", "u", "v", 631 "w", "x", "y", "z" 632 }; 633 634 static const sal_Int32 kBase36MaxNumsCount = 7; 635 636 static const sal_Char *kBase36MaxNumsStr[kBase36MaxNumsCount] = 637 { 638 kSInt8MaxBase36Str, 639 kUInt8MaxBase36Str, 640 kSInt16MaxBase36Str, 641 kUInt16MaxBase36Str, 642 kSInt32MaxBase36Str, 643 kUInt32MaxBase36Str, 644 kSInt64MaxBase36Str 645 }; 646 647 //------------------------------------------------------------------------ 648 //------------------------------------------------------------------------ 649 static const sal_Int32 nDoubleCount=24; 650 // static const sal_Char *inputDouble[nDoubleCount] = 651 // { 652 // "3","3.1","3.1415","3.1415926535","3.141592653589793", 653 // "3.1415926535897932","3.14159265358979323","+3.1", 654 // "3.141592653589793238462643","9.1096e-31","2.997925e8","6.241e18","5.381e+18", 655 // "1.7e-309","6.5822e-16","1.7e+307","2.2e30","03.1"," 3.1","-3.1", 656 // "-0.0","0.0","","1.00e308" 657 // }; 658 static const double expValDouble[nDoubleCount]= 659 { 660 3.0,3.1,3.1415,3.1415926535,3.141592653589793, 661 3.1415926535897932,3.14159265358979323,3.1, 662 3.141592653589793238462643,9.1096e-31,2.997925e8,6.241e18,5.381e18, 663 1.7e-309,6.5822e-16,1.7e+307,2.2e30,3.1,3.1,-3.1, 664 0.0,0.0,0.0,1.00e+308 665 }; 666 //------------------------------------------------------------------------ 667 static const sal_Int32 nFloatCount=22; 668 // static const sal_Char *inputFloat[nFloatCount] = 669 // { 670 // "3", 671 // "3.1", 672 // "3.1415", 673 // "3.14159", 674 // "3.141592", 675 // "3.1415926", 676 // "3.14159265", 677 // "3.141592653589793238462643", 678 // "6.5822e-16", 679 // "9.1096e-31", 680 // "2.997925e8", 681 // "6.241e18", 682 // "1.00e38", 683 // "6.241e-37", 684 // "6.241e37", 685 // "03.1", 686 // " 3.1", 687 // "-3.1", 688 // "+3.1", 689 // "-0.0", 690 // "0.0", 691 // "" 692 // }; 693 static const float expValFloat[nFloatCount] = 694 { 695 3.0f, 696 3.1f, 697 3.1415f, 698 3.14159f, 699 3.141592f, 700 3.1415926f, 701 3.14159265f, 702 3.141592653589793238462643f, 703 6.5822e-16f, 704 9.1096e-31f, 705 2.997925e8f, 706 6.241e18f, 707 1.00e38f, 708 6.241e-37f, 709 6.241e37f, 710 3.1f, 711 3.1f, 712 -3.1f, 713 3.1f, 714 0.0f, 715 0.0f, 716 0.0f 717 }; 718 static const float fPrecision[nFloatCount] = 719 { 720 3e-7f, 721 3e-7f, 722 3e-7f, 723 3e-7f, 724 3e-7f, 725 3e-7f, 726 3e-7f, 727 3e-7f, 728 6e-16f * 1e-7f, 729 9e-31f * 1e-7f, 730 3e8f * 1e-7f, 731 6e18f * 1e-7f, 732 1e38f * 1e-7f, 733 6e-37f * 1e-7f, 734 6e37f * 1e-7f, 735 3e-7f, 736 3e-7f, 737 3e-7f, 738 3e-7f, 739 1e-7f, 740 1e-7f, 741 1e-7f 742 }; 743 //------------------------------------------------------------------------ 744 static const sal_Int32 nCharCount=15; 745 static const sal_Char *inputChar[nCharCount] = 746 { 747 "A","a","0","-","_", 748 "\25","\33","\35", 749 "@","\n","\'","\"", 750 "\0","","Sun Microsystems" 751 }; 752 static const sal_Unicode expValChar[nCharCount] = 753 { 754 65,97,48,45,95, 755 21,27,29, 756 64,10,39,34, 757 0,0,83 758 }; 759 //------------------------------------------------------------------------ 760 static const sal_Int32 nDefaultCount=6; 761 static const sal_Unicode input1Default[nDefaultCount] = 762 { 763 77,115,85,119,32,0 764 }; 765 static const sal_Int32 input2Default[nDefaultCount] = 766 { 767 0,0,0,0,0,0 768 }; 769 static const sal_Int32 expValDefault[nDefaultCount] = 770 { 771 4,9,-1,-1,3,-1 772 }; 773 //------------------------------------------------------------------------ 774 static const sal_Int32 nNormalCount=10; 775 static const sal_Unicode input1Normal[nNormalCount] = 776 { 777 77,77,77,115,115,115,119,119,0,0 778 }; 779 static const sal_Int32 input2Normal[nNormalCount] = 780 { 781 0,32,80,0,13,20,0,80,0,32 782 }; 783 static const sal_Int32 expValNormal[nNormalCount] = 784 { 785 4,-1,-1,9,15,-1,-1,-1,-1,-1 786 }; 787 //------------------------------------------------------------------------ 788 static const sal_Int32 nlastDefaultCount=5; 789 static const sal_Unicode input1lastDefault[nlastDefaultCount] = 790 { 791 77,115,119,32,0 792 }; 793 static const sal_Int32 input2lastDefault[nlastDefaultCount] = 794 { 795 31,31,31,31,31 796 }; 797 static const sal_Int32 expVallastDefault[nlastDefaultCount] = 798 { 799 4,15,-1,21,-1 800 }; 801 //------------------------------------------------------------------------ 802 static const sal_Int32 nlastNormalCount=8; 803 static const sal_Unicode input1lastNormal[nlastNormalCount] = 804 { 805 77,77,77,115,115,119,119,0 806 }; 807 static const sal_Int32 input2lastNormal[nlastNormalCount] = 808 { 809 29,0,80,31,3,31,80,31 810 }; 811 static const sal_Int32 expVallastNormal[nlastNormalCount] = 812 { 813 4,-1,4,15,-1,-1,-1,-1 814 }; 815 //------------------------------------------------------------------------ 816 static const sal_Int32 nStrDefaultCount=6; 817 static const sal_Unicode *input1StrDefault[nStrDefaultCount] = 818 { 819 aUStr7,aUStr8,aUStr21, 820 aUStr30,aUStr25,aUStr26 821 }; 822 static const sal_Int32 input2StrDefault[nStrDefaultCount] = 823 { 824 0,0,0,0,0,0 825 }; 826 static const sal_Int32 expValStrDefault[nStrDefaultCount] = 827 { 828 0,4,-1,-1,-1,3 829 }; 830 //------------------------------------------------------------------------ 831 static const sal_Int32 nStrNormalCount=9; 832 static const sal_Unicode *input1StrNormal[nStrNormalCount] = 833 { 834 aUStr7,aUStr7,aUStr8,aUStr8,aUStr21,aUStr30,aUStr25,aUStr25,aUStr26 835 }; 836 static const sal_Int32 input2StrNormal[nStrNormalCount] = 837 { 838 0,32,0,30,0,0,0,32,0 839 }; 840 static const sal_Int32 expValStrNormal[nStrNormalCount] = 841 { 842 0,-1,4,-1,-1,-1,-1,-1,3 843 }; 844 //------------------------------------------------------------------------ 845 static const sal_Int32 nStrLastDefaultCount=6; 846 static const sal_Unicode *input1StrLastDefault[nStrLastDefaultCount] = 847 { 848 aUStr7,aUStr8,aUStr21,aUStr30,aUStr25,aUStr26 849 }; 850 static const sal_Int32 input2StrLastDefault[nStrLastDefaultCount] = 851 { 852 31,31,31,31,31,31 853 }; 854 static const sal_Int32 expValStrLastDefault[nStrLastDefaultCount] = 855 { 856 0,4,-1,-1,-1,3 857 }; 858 //------------------------------------------------------------------------ 859 static const sal_Int32 nStrLastNormalCount=12; 860 static const sal_Unicode *input1StrLastNormal[nStrLastNormalCount] = 861 { 862 aUStr7,aUStr7,aUStr7,aUStr8,aUStr8,aUStr21,aUStr30, 863 aUStr25,aUStr25,aUStr26,aUStr27,aUStr27 864 }; 865 static const sal_Int32 input2StrLastNormal[nStrLastNormalCount] = 866 { 867 31,0,80,31,2,31,31,31,0,31,31,14 868 }; 869 static const sal_Int32 expValStrLastNormal[nStrLastNormalCount] = 870 { 871 0,-1,0,4,-1,-1,-1,-1,-1,3,15,11 872 }; 873 //------------------------------------------------------------------------ 874 static const sal_Int32 kNonSInt32Max = INT_MIN; 875 static const sal_Int32 kNonSInt16Max = SHRT_MIN; 876 //------------------------------------------------------------------------ 877 #ifdef __cplusplus 878 } 879 #endif 880 881 //------------------------------------------------------------------------ 882 //------------------------------------------------------------------------ 883 884 #endif /* _RTL_STRING_CONST_H_ */ 885 886