1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: rtl_String_Const.h,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 //------------------------------------------------------------------------
32 //------------------------------------------------------------------------
34 #ifndef _RTL_STRING_CONST_H_
35 #define _RTL_STRING_CONST_H_
37 #ifndef _RTL_STRING_UTILS_HXX_
38 #include <rtl_String_Utils.hxx>
41 //------------------------------------------------------------------------
42 //------------------------------------------------------------------------
46 //------------------------------------------------------------------------
47 //------------------------------------------------------------------------
50 #include <sal/types.h>
53 #ifndef _RTL_TEXTENC_H
54 #include <rtl/textenc.h>
57 #ifndef _RTL_USTRING_H_
58 #include <rtl/ustring.h>
61 //------------------------------------------------------------------------
62 //------------------------------------------------------------------------
69 //------------------------------------------------------------------------
70 //------------------------------------------------------------------------
72 static const rtl_TextEncoding kEncodingRTLTextUSASCII
= RTL_TEXTENCODING_ASCII_US
;
74 //------------------------------------------------------------------------
75 //------------------------------------------------------------------------
77 static const sal_uInt32 kConvertFlagsOUStringToOString
= OUSTRING_TO_OSTRING_CVTFLAGS
;
78 static const sal_uInt32 kConvertFlagsOStringToOUString
= OSTRING_TO_OUSTRING_CVTFLAGS
;
80 //------------------------------------------------------------------------
81 //------------------------------------------------------------------------
83 static const sal_Char
*kTestStr1
= "Sun Microsystems";
84 static const sal_Char
*kTestStr2
= "Sun Microsystems Java Technology";
85 static const sal_Char
*kTestStr3
= "Sun microsystems";
86 static const sal_Char
*kTestStr4
= "SUN MICROSYSTEMS";
87 static const sal_Char
*kTestStr5
= "sun microsystems";
88 static const sal_Char
*kTestStr6
= "Java Technology";
89 static const sal_Char
*kTestStr7
= "Sun ";
90 static const sal_Char
*kTestStr8
= "Microsystems";
91 static const sal_Char
*kTestStr9
= "sun microsystems java technology";
92 static const sal_Char
*kTestStr10
= " Sun Microsystems";
93 static const sal_Char
*kTestStr11
= "Sun Microsystems ";
94 static const sal_Char
*kTestStr12
= " Sun Microsystems ";
95 static const sal_Char
*kTestStr13
= "Sun Microsystems ";
96 static const sal_Char
*kTestStr14
= " Sun Microsystems";
97 static const sal_Char
*kTestStr15
= " Sun Microsystems ";
98 static const sal_Char
*kTestStr16
= " Sun Microsystems ";
99 static const sal_Char
*kTestStr17
= " Sun Microsystems ";
100 static const sal_Char
*kTestStr18
= "sUN MICROsYsTEMs";
101 static const sal_Char
*kTestStr19
= "---Sun-Microsystems---";
102 static const sal_Char
*kTestStr20
= "sun";
103 static const sal_Char
*kTestStr21
= "SUN";
104 static const sal_Char
*kTestStr22
= "SUN MICROSYSTEMS JAVA TECHNOLOGY";
105 static const sal_Char
*kTestStr23
= " Java Technology";
106 static const sal_Char
*kTestStr24
= "Sun Microsystems Java Technolog";
107 static const sal_Char
*kTestStr25
= "";
108 static const sal_Char
*kTestStr26
= " Mic";
109 static const sal_Char
*kTestStr27
= "s";
110 static const sal_Char
*kTestStr28
= "\50\3\5\7\11\13\15\17sun";
111 static const sal_Char
*kTestStr29
= "\50\3\5\7\11\13\15\17sun\21\23\25\27\31\33\50";
112 static const sal_Char
*kTestStr30
= "sun\21\23\25\27\31\33\50";
113 static const sal_Char
*kTestStr31
= "sun Microsystems";
114 static const sal_Char
*kTestStr32
= "Sun Microsystem ";
115 static const sal_Char
*kTestStr33
= " ";
116 static const sal_Char
*kTestStr34
= "\50\5\5\7\11\13\15\17sun";
117 static const sal_Char
*kTestStr35
= "\50\373\5\7\11\13\15\17sun";
118 static const sal_Char
*kTestStr36
= "Microsystems Java Technology";
119 static const sal_Char
*kTestStr37
= "Sun Java Technology";
120 static const sal_Char
*kTestStr38
= "\21\23\25\27\31\33\50";
121 static const sal_Char
*kTestStr39
= "\50\3\5\7\11\13\15\17sun Sun Microsystems ";
122 static const sal_Char
*kTestStr40
= "\50\3\5\7\11\13\15\17sunsun Microsystems";
123 static const sal_Char
*kTestStr41
= "Sun";
124 static const sal_Char
*kTestStr42
= "\50\3\5\7\11\13\15\17su";
125 static const sal_Char
*kTestStr43
= "\50\3\5\7\11\13\15\17sun\256\345";
126 static const sal_Char
*kTestStr44
= "\256\345";
127 static const sal_Char
*kTestStr45
= "Sun true";
128 static const sal_Char
*kTestStr46
= "Sun false";
129 static const sal_Char
*kTestStr47
= "true";
130 static const sal_Char
*kTestStr48
= "false";
131 static const sal_Char
*kTestStr49
= "\50\3\5\7\11\13\15\17suntrue";
132 static const sal_Char
*kTestStr50
= "\50\3\5\7\11\13\15\17sunfalse";
133 static const sal_Char
*kTestStr51
= "Sun M";
134 //static const sal_Char *kTestStr52 = "Sun \077777";
135 //static const sal_Char *kTestStr53 = "Sun \100000";
136 //static const sal_Char *kTestStr54 = "\77777";
137 //static const sal_Char *kTestStr55 = "\100000";
138 static const sal_Char
*kTestStr56
= "\50\3\5\7\11\13\15\17suns";
139 //static const sal_Char *kTestStr57 = "\50\3\5\7\11\13\15\17sun\77777";
140 //static const sal_Char *kTestStr58 = "\50\3\5\7\11\13\15\17sun\10000";
141 static const sal_Char
*kTestStr1PlusStr6
= "Sun Microsystems" "Java Technology";
142 //------------------------------------------------------------------------
143 //------------------------------------------------------------------------
145 static const sal_Int32 kTestStr1Len
= 16;
146 static const sal_Int32 kTestStr2Len
= 32;
147 static const sal_Int32 kTestStr3Len
= 16;
148 static const sal_Int32 kTestStr4Len
= 16;
149 static const sal_Int32 kTestStr5Len
= 16;
150 static const sal_Int32 kTestStr6Len
= 15;
151 static const sal_Int32 kTestStr7Len
= 4;
152 static const sal_Int32 kTestStr8Len
= 12;
153 static const sal_Int32 kTestStr9Len
= 32;
154 static const sal_Int32 kTestStr10Len
= 17;
155 static const sal_Int32 kTestStr11Len
= 17;
156 static const sal_Int32 kTestStr12Len
= 18;
157 static const sal_Int32 kTestStr13Len
= 19;
158 static const sal_Int32 kTestStr14Len
= 19;
159 static const sal_Int32 kTestStr15Len
= 20;
160 static const sal_Int32 kTestStr16Len
= 20;
161 static const sal_Int32 kTestStr17Len
= 22;
162 static const sal_Int32 kTestStr18Len
= 16;
163 static const sal_Int32 kTestStr19Len
= 22;
164 static const sal_Int32 kTestStr20Len
= 3;
165 static const sal_Int32 kTestStr21Len
= 3;
166 static const sal_Int32 kTestStr22Len
= 32;
167 static const sal_Int32 kTestStr23Len
= 16;
168 static const sal_Int32 kTestStr24Len
= 31;
169 static const sal_Int32 kTestStr25Len
= 0;
170 static const sal_Int32 kTestStr26Len
= 4;
171 static const sal_Int32 kTestStr27Len
= 1;
172 static const sal_Int32 kTestStr28Len
= 11;
173 static const sal_Int32 kTestStr29Len
= 18;
174 static const sal_Int32 kTestStr30Len
= 10;
175 static const sal_Int32 kTestStr31Len
= 16;
176 static const sal_Int32 kTestStr32Len
= 16;
177 static const sal_Int32 kTestStr33Len
= 1;
178 static const sal_Int32 kTestStr34Len
= 11;
179 static const sal_Int32 kTestStr35Len
= 11;
180 static const sal_Int32 kTestStr36Len
= 28;
181 static const sal_Int32 kTestStr37Len
= 20;
182 static const sal_Int32 kTestStr38Len
= 7;
183 static const sal_Int32 kTestStr39Len
= 33;
184 static const sal_Int32 kTestStr40Len
= 27;
185 static const sal_Int32 kTestStr41Len
= 3;
186 static const sal_Int32 kTestStr42Len
= 10;
187 static const sal_Int32 kTestStr43Len
= 13;
188 static const sal_Int32 kTestStr44Len
= 2;
189 static const sal_Int32 kTestStr45Len
= 8;
190 static const sal_Int32 kTestStr46Len
= 9;
191 static const sal_Int32 kTestStr47Len
= 4;
192 static const sal_Int32 kTestStr48Len
= 5;
193 static const sal_Int32 kTestStr49Len
= 15;
194 static const sal_Int32 kTestStr50Len
= 16;
195 static const sal_Int32 kTestStr51Len
= 5;
196 static const sal_Int32 kTestStr52Len
= 5;
197 static const sal_Int32 kTestStr53Len
= 5;
198 static const sal_Int32 kTestStr54Len
= 1;
199 static const sal_Int32 kTestStr55Len
= 1;
200 static const sal_Int32 kTestStr56Len
= 12;
201 static const sal_Int32 kTestStr57Len
= 12;
202 static const sal_Int32 kTestStr58Len
= 12;
203 static const sal_Int32 kTestStr1PlusStr6Len
= kTestStr1Len
+ kTestStr6Len
;
205 //------------------------------------------------------------------------
206 //------------------------------------------------------------------------
207 static sal_Unicode aUStr1
[kTestStr1Len
+1];
208 static sal_Unicode aUStr2
[kTestStr2Len
+1];
209 static sal_Unicode aUStr3
[kTestStr3Len
+1];
210 static sal_Unicode aUStr4
[kTestStr4Len
+1];
211 static sal_Unicode aUStr5
[kTestStr5Len
+1];
212 static sal_Unicode aUStr6
[kTestStr6Len
+1];
213 static sal_Unicode aUStr7
[kTestStr7Len
+1];
214 static sal_Unicode aUStr8
[kTestStr8Len
+1];
215 static sal_Unicode aUStr9
[kTestStr9Len
+1];
216 static sal_Unicode aUStr10
[kTestStr10Len
+1];
217 static sal_Unicode aUStr11
[kTestStr11Len
+1];
218 static sal_Unicode aUStr12
[kTestStr12Len
+1];
219 static sal_Unicode aUStr13
[kTestStr13Len
+1];
220 static sal_Unicode aUStr14
[kTestStr14Len
+1];
221 static sal_Unicode aUStr15
[kTestStr15Len
+1];
222 static sal_Unicode aUStr16
[kTestStr16Len
+1];
223 static sal_Unicode aUStr17
[kTestStr17Len
+1];
224 static sal_Unicode aUStr18
[kTestStr18Len
+1];
225 static sal_Unicode aUStr19
[kTestStr19Len
+1];
226 static sal_Unicode aUStr20
[kTestStr20Len
+1];
227 static sal_Unicode aUStr21
[kTestStr21Len
+1];
228 static sal_Unicode aUStr22
[kTestStr22Len
+1];
229 static sal_Unicode aUStr23
[kTestStr23Len
+1];
230 static sal_Unicode aUStr24
[kTestStr24Len
+1];
231 static sal_Unicode aUStr25
[kTestStr25Len
+1];
232 static sal_Unicode aUStr26
[kTestStr26Len
+1];
233 static sal_Unicode aUStr27
[kTestStr27Len
+1];
234 static sal_Unicode aUStr28
[kTestStr28Len
+1];
235 static sal_Unicode aUStr29
[kTestStr29Len
+1];
236 static sal_Unicode aUStr30
[kTestStr30Len
+1];
237 static sal_Unicode aUStr31
[kTestStr31Len
+1];
238 static sal_Unicode aUStr32
[kTestStr32Len
+1];
239 static sal_Unicode aUStr33
[kTestStr33Len
+1];
240 static sal_Unicode aUStr34
[kTestStr34Len
+1];
241 static sal_Unicode aUStr35
[kTestStr35Len
+1];
242 static sal_Unicode aUStr36
[kTestStr36Len
+1];
243 static sal_Unicode aUStr37
[kTestStr37Len
+1];
244 static sal_Unicode aUStr38
[kTestStr38Len
+1];
245 static sal_Unicode aUStr39
[kTestStr39Len
+1];
246 static sal_Unicode aUStr40
[kTestStr40Len
+1];
247 static sal_Unicode aUStr41
[kTestStr41Len
+1];
248 static sal_Unicode aUStr42
[kTestStr42Len
+1];
249 static sal_Unicode aUStr43
[kTestStr43Len
+1];
250 static sal_Unicode aUStr44
[kTestStr44Len
+1];
251 static sal_Unicode aUStr45
[kTestStr45Len
+1];
252 static sal_Unicode aUStr46
[kTestStr46Len
+1];
253 static sal_Unicode aUStr47
[kTestStr47Len
+1];
254 static sal_Unicode aUStr48
[kTestStr48Len
+1];
255 static sal_Unicode aUStr49
[kTestStr49Len
+1];
256 static sal_Unicode aUStr50
[kTestStr50Len
+1];
257 static sal_Unicode aUStr51
[kTestStr51Len
+1];
258 // static sal_Unicode aUStr52[kTestStr52Len+1]={83,117,110,32,32767};
259 // static sal_Unicode aUStr53[kTestStr53Len+1]={83,117,110,32,SAL_MIN_INT16 /*-32768*/};
260 // static sal_Unicode aUStr54[kTestStr54Len+1]={32767};
261 // static sal_Unicode aUStr55[kTestStr55Len+1]={SAL_MIN_INT16 /*-32768*/};
262 static sal_Unicode aUStr56
[kTestStr56Len
+1];
263 // static sal_Unicode aUStr57[kTestStr57Len+1]={40,3,5,7,9,11,13,15,115,117,110,32767};
264 // static sal_Unicode aUStr58[kTestStr58Len+1]={40,3,5,7,9,11,13,15,115,117,110,SAL_MIN_INT16 /*-32768*/};
265 static sal_Unicode aUStr1PlusUStr6
[kTestStr1Len
+ kTestStr6Len
+ 1];
267 // we are already in "C"
269 static sal_Bool SAL_CALL
test_ini_uString()
272 sal_Bool iniResult
= sal_True
;
274 iniResult
&=AStringToUStringNCopy( aUStr1
, kTestStr1
, kTestStr1Len
);
276 iniResult
&=AStringToUStringNCopy( aUStr2
, kTestStr2
, kTestStr2Len
);
278 iniResult
&=AStringToUStringNCopy( aUStr3
, kTestStr3
, kTestStr3Len
);
280 iniResult
&=AStringToUStringNCopy( aUStr4
, kTestStr4
, kTestStr4Len
);
282 iniResult
&=AStringToUStringNCopy( aUStr5
, kTestStr5
, kTestStr5Len
);
284 iniResult
&=AStringToUStringNCopy( aUStr6
, kTestStr6
, kTestStr6Len
);
286 iniResult
&=AStringToUStringNCopy( aUStr7
, kTestStr7
, kTestStr7Len
);
288 iniResult
&=AStringToUStringNCopy( aUStr8
, kTestStr8
, kTestStr8Len
);
290 iniResult
&=AStringToUStringNCopy( aUStr9
, kTestStr9
, kTestStr9Len
);
292 iniResult
&=AStringToUStringNCopy( aUStr10
, kTestStr10
, kTestStr10Len
);
294 iniResult
&=AStringToUStringNCopy( aUStr11
, kTestStr11
, kTestStr11Len
);
296 iniResult
&=AStringToUStringNCopy( aUStr12
, kTestStr12
, kTestStr12Len
);
298 iniResult
&=AStringToUStringNCopy( aUStr13
, kTestStr13
, kTestStr13Len
);
300 iniResult
&=AStringToUStringNCopy( aUStr14
, kTestStr14
, kTestStr14Len
);
302 iniResult
&=AStringToUStringNCopy( aUStr15
, kTestStr15
, kTestStr15Len
);
304 iniResult
&=AStringToUStringNCopy( aUStr16
, kTestStr16
, kTestStr16Len
);
306 iniResult
&=AStringToUStringNCopy( aUStr17
, kTestStr17
, kTestStr17Len
);
308 iniResult
&=AStringToUStringNCopy( aUStr18
, kTestStr18
, kTestStr18Len
);
310 iniResult
&=AStringToUStringNCopy( aUStr19
, kTestStr19
, kTestStr19Len
);
312 iniResult
&=AStringToUStringNCopy( aUStr20
, kTestStr20
, kTestStr20Len
);
314 iniResult
&=AStringToUStringNCopy( aUStr21
, kTestStr21
, kTestStr21Len
);
316 iniResult
&=AStringToUStringNCopy( aUStr22
, kTestStr22
, kTestStr22Len
);
318 iniResult
&=AStringToUStringNCopy( aUStr23
, kTestStr23
, kTestStr23Len
);
320 iniResult
&=AStringToUStringNCopy( aUStr1PlusUStr6
, kTestStr1PlusStr6
, kTestStr1PlusStr6Len
);
322 iniResult
&=AStringToUStringNCopy( aUStr24
, kTestStr24
, kTestStr24Len
);
324 iniResult
&=AStringToUStringNCopy( aUStr25
, kTestStr25
, kTestStr25Len
);
326 iniResult
&=AStringToUStringNCopy( aUStr26
, kTestStr26
, kTestStr26Len
);
328 iniResult
&=AStringToUStringNCopy( aUStr27
, kTestStr27
, kTestStr27Len
);
330 iniResult
&=AStringToUStringNCopy( aUStr28
, kTestStr28
, kTestStr28Len
);
332 iniResult
&=AStringToUStringNCopy( aUStr29
, kTestStr29
, kTestStr29Len
);
334 iniResult
&=AStringToUStringNCopy( aUStr30
, kTestStr30
, kTestStr30Len
);
336 iniResult
&=AStringToUStringNCopy( aUStr31
, kTestStr31
, kTestStr31Len
);
338 iniResult
&=AStringToUStringNCopy( aUStr32
, kTestStr32
, kTestStr32Len
);
340 iniResult
&=AStringToUStringNCopy( aUStr33
, kTestStr33
, kTestStr33Len
);
342 iniResult
&=AStringToUStringNCopy( aUStr34
, kTestStr34
, kTestStr34Len
);
344 iniResult
&=AStringToUStringNCopy( aUStr35
, kTestStr35
, kTestStr35Len
);
346 iniResult
&=AStringToUStringNCopy( aUStr36
, kTestStr36
, kTestStr36Len
);
348 iniResult
&=AStringToUStringNCopy( aUStr37
, kTestStr37
, kTestStr37Len
);
350 iniResult
&=AStringToUStringNCopy( aUStr38
, kTestStr38
, kTestStr38Len
);
352 iniResult
&=AStringToUStringNCopy( aUStr39
, kTestStr39
, kTestStr39Len
);
354 iniResult
&=AStringToUStringNCopy( aUStr40
, kTestStr40
, kTestStr40Len
);
356 iniResult
&=AStringToUStringNCopy( aUStr41
, kTestStr41
, kTestStr41Len
);
358 iniResult
&=AStringToUStringNCopy( aUStr42
, kTestStr42
, kTestStr42Len
);
360 iniResult
&=AStringToUStringNCopy( aUStr43
, kTestStr43
, kTestStr43Len
);
362 iniResult
&=AStringToUStringNCopy( aUStr44
, kTestStr44
, kTestStr44Len
);
364 iniResult
&=AStringToUStringNCopy( aUStr45
, kTestStr45
, kTestStr45Len
);
366 iniResult
&=AStringToUStringNCopy( aUStr46
, kTestStr46
, kTestStr46Len
);
368 iniResult
&=AStringToUStringNCopy( aUStr47
, kTestStr47
, kTestStr47Len
);
370 iniResult
&=AStringToUStringNCopy( aUStr48
, kTestStr48
, kTestStr48Len
);
372 iniResult
&=AStringToUStringNCopy( aUStr49
, kTestStr49
, kTestStr49Len
);
374 iniResult
&=AStringToUStringNCopy( aUStr50
, kTestStr50
, kTestStr50Len
);
376 iniResult
&=AStringToUStringNCopy( aUStr51
, kTestStr51
, kTestStr51Len
);
378 //iniResult &=AStringToUStringNCopy( aUStr52, kTestStr52, kTestStr52Len );
380 // iniResult &=AStringToUStringNCopy( aUStr53, kTestStr53, kTestStr53Len );
382 //iniResult &=AStringToUStringNCopy( aUStr54, kTestStr54, kTestStr54Len );
384 //iniResult &=AStringToUStringNCopy( aUStr55, kTestStr55, kTestStr55Len );
386 iniResult
&=AStringToUStringNCopy( aUStr56
, kTestStr56
, kTestStr56Len
);
388 // iniResult &=AStringToUStringNCopy( aUStr57, kTestStr57, kTestStr57Len );
390 //iniResult &=AStringToUStringNCopy( aUStr58, kTestStr58, kTestStr58Len );
398 static const sal_Int32 uTestStr1Len
= 16;
399 static const sal_Int32 uTestStr2Len
= 32;
400 static const sal_Int32 uTestStr3Len
= 16;
401 static const sal_Int32 uTestStr4Len
= 16;
402 static const sal_Int32 uTestStr5Len
= 16;
403 static const sal_Int32 uTestStr9Len
= 32;
404 static const sal_Int32 uTestStr22Len
= 32;
408 //------------------------------------------------------------------------
409 //------------------------------------------------------------------------
410 const sal_Unicode uTestStr31
[]= {0x400,0x410,0x4DF};
411 const sal_Unicode uTestStr32
[]= {0x9F9F,0xA000,0x8F80,0x9AD9};
415 //------------------------------------------------------------------------
416 //------------------------------------------------------------------------
418 static const sal_Int32 uTestStr31Len
= 3;
419 static const sal_Int32 uTestStr32Len
= 4;
421 //------------------------------------------------------------------------
422 //------------------------------------------------------------------------
424 static const sal_Int16 kRadixBinary
= 2;
425 static const sal_Int16 kRadixOctol
= 8;
426 static const sal_Int16 kRadixDecimal
= 10;
427 static const sal_Int16 kRadixHexdecimal
= 16;
428 static const sal_Int16 kRadixBase36
= 36;
430 //------------------------------------------------------------------------
431 //------------------------------------------------------------------------
433 static const sal_Int8 kSInt8Max
= SCHAR_MAX
;
434 static const sal_Int16 kUInt8Max
= UCHAR_MAX
;
435 static const sal_Int16 kSInt16Max
= SHRT_MAX
;
436 static const sal_Int32 kUInt16Max
= USHRT_MAX
;
437 static const sal_Int32 kSInt32Max
= INT_MAX
;
438 static const sal_Int64 kUInt32Max
= UINT_MAX
;
439 #if (defined UNX) || (defined OS2)
440 static const sal_Int64 kSInt64Max
= 9223372036854775807LL;
442 static const sal_Int64 kSInt64Max
= 9223372036854775807;
444 //------------------------------------------------------------------------
446 static const sal_Int32 kInt32MaxNumsCount
= 5;
448 static const sal_Int32 kInt32MaxNums
[kInt32MaxNumsCount
] =
450 kSInt8Max
, kUInt8Max
,
451 kSInt16Max
, kUInt16Max
,
455 static const sal_Int32 kInt64MaxNumsCount
= 7;
457 static const sal_Int64 kInt64MaxNums
[kInt64MaxNumsCount
] =
459 kSInt8Max
, kUInt8Max
,
460 kSInt16Max
, kUInt16Max
,
461 kSInt32Max
, kUInt32Max
,
465 //------------------------------------------------------------------------
466 //------------------------------------------------------------------------
468 static const sal_Char
*kSInt8MaxBinaryStr
= "1111111";
469 static const sal_Char
*kUInt8MaxBinaryStr
= "11111111";
470 static const sal_Char
*kSInt16MaxBinaryStr
= "111111111111111";
471 static const sal_Char
*kUInt16MaxBinaryStr
= "1111111111111111";
472 static const sal_Char
*kSInt32MaxBinaryStr
=
473 "1111111111111111111111111111111";
474 static const sal_Char
*kUInt32MaxBinaryStr
=
475 "11111111111111111111111111111111";
476 static const sal_Char
*kSInt64MaxBinaryStr
=
477 "111111111111111111111111111111111111111111111111111111111111111";
479 //------------------------------------------------------------------------
481 static const sal_Char
*kSInt8MaxOctolStr
= "177";
482 static const sal_Char
*kUInt8MaxOctolStr
= "377";
483 static const sal_Char
*kSInt16MaxOctolStr
= "77777";
484 static const sal_Char
*kUInt16MaxOctolStr
= "177777";
485 static const sal_Char
*kSInt32MaxOctolStr
= "17777777777";
486 static const sal_Char
*kUInt32MaxOctolStr
= "37777777777";
487 static const sal_Char
*kSInt64MaxOctolStr
= "777777777777777777777";
489 //------------------------------------------------------------------------
491 static const sal_Char
*kSInt8MaxDecimalStr
= "127";
492 static const sal_Char
*kUInt8MaxDecimalStr
= "255";
493 static const sal_Char
*kSInt16MaxDecimalStr
= "32767";
494 static const sal_Char
*kUInt16MaxDecimalStr
= "65535";
495 static const sal_Char
*kSInt32MaxDecimalStr
= "2147483647";
496 static const sal_Char
*kUInt32MaxDecimalStr
= "4294967295";
497 static const sal_Char
*kSInt64MaxDecimalStr
= "9223372036854775807";
499 //------------------------------------------------------------------------
501 static const sal_Char
*kSInt8MaxHexDecimalStr
= "7f";
502 static const sal_Char
*kUInt8MaxHexDecimalStr
= "ff";
503 static const sal_Char
*kSInt16MaxHexDecimalStr
= "7fff";
504 static const sal_Char
*kUInt16MaxHexDecimalStr
= "ffff";
505 static const sal_Char
*kSInt32MaxHexDecimalStr
= "7fffffff";
506 static const sal_Char
*kUInt32MaxHexDecimalStr
= "ffffffff";
507 static const sal_Char
*kSInt64MaxHexDecimalStr
= "7fffffffffffffff";
509 //------------------------------------------------------------------------
511 static const sal_Char
*kSInt8MaxBase36Str
= "3j";
512 static const sal_Char
*kUInt8MaxBase36Str
= "73";
513 static const sal_Char
*kSInt16MaxBase36Str
= "pa7";
514 static const sal_Char
*kUInt16MaxBase36Str
= "1ekf";
515 static const sal_Char
*kSInt32MaxBase36Str
= "zik0zj";
516 static const sal_Char
*kUInt32MaxBase36Str
= "1z141z3";
517 static const sal_Char
*kSInt64MaxBase36Str
= "1y2p0ij32e8e7";
519 //------------------------------------------------------------------------
520 //------------------------------------------------------------------------
522 static const sal_Int32 kBinaryNumsCount
= 16;
524 static const sal_Char
*kBinaryNumsStr
[kBinaryNumsCount
] =
526 "0", "1", "10", "11",
527 "100", "101", "110", "111",
528 "1000", "1001", "1010", "1011",
529 "1100", "1101", "1110", "1111"
532 static const sal_Int32 kBinaryMaxNumsCount
= 7;
534 static const sal_Char
*kBinaryMaxNumsStr
[kBinaryMaxNumsCount
] =
545 //------------------------------------------------------------------------
547 static const sal_Int32 kOctolNumsCount
= 16;
549 static const sal_Char
*kOctolNumsStr
[kOctolNumsCount
] =
553 "10", "11", "12", "13",
554 "14", "15", "16", "17"
557 static const sal_Int32 kOctolMaxNumsCount
= 7;
559 static const sal_Char
*kOctolMaxNumsStr
[kOctolMaxNumsCount
] =
570 //------------------------------------------------------------------------
572 static const sal_Int32 kDecimalNumsCount
= 16;
574 static const sal_Char
*kDecimalNumsStr
[kDecimalNumsCount
] =
578 "8", "9", "10", "11",
579 "12", "13", "14", "15"
582 static const sal_Int32 kDecimalMaxNumsCount
= 7;
584 static const sal_Char
*kDecimalMaxNumsStr
[kDecimalMaxNumsCount
] =
588 kSInt16MaxDecimalStr
,
589 kUInt16MaxDecimalStr
,
590 kSInt32MaxDecimalStr
,
591 kUInt32MaxDecimalStr
,
595 //------------------------------------------------------------------------
597 static const sal_Int32 kHexDecimalNumsCount
= 16;
599 static const sal_Char
*kHexDecimalNumsStr
[kHexDecimalNumsCount
] =
607 static const sal_Int32 kHexDecimalMaxNumsCount
= 7;
609 static const sal_Char
*kHexDecimalMaxNumsStr
[kHexDecimalMaxNumsCount
] =
611 kSInt8MaxHexDecimalStr
,
612 kUInt8MaxHexDecimalStr
,
613 kSInt16MaxHexDecimalStr
,
614 kUInt16MaxHexDecimalStr
,
615 kSInt32MaxHexDecimalStr
,
616 kUInt32MaxHexDecimalStr
,
617 kSInt64MaxHexDecimalStr
620 //------------------------------------------------------------------------
622 static const sal_Int32 kBase36NumsCount
= 36;
624 static const sal_Char
*kBase36NumsStr
[kBase36NumsCount
] =
637 static const sal_Int32 kBase36MaxNumsCount
= 7;
639 static const sal_Char
*kBase36MaxNumsStr
[kBase36MaxNumsCount
] =
650 //------------------------------------------------------------------------
651 //------------------------------------------------------------------------
652 static const sal_Int32 nDoubleCount
=24;
653 // static const sal_Char *inputDouble[nDoubleCount] =
655 // "3","3.1","3.1415","3.1415926535","3.141592653589793",
656 // "3.1415926535897932","3.14159265358979323","+3.1",
657 // "3.141592653589793238462643","9.1096e-31","2.997925e8","6.241e18","5.381e+18",
658 // "1.7e-309","6.5822e-16","1.7e+307","2.2e30","03.1"," 3.1","-3.1",
659 // "-0.0","0.0","","1.00e308"
661 static const double expValDouble
[nDoubleCount
]=
663 3.0,3.1,3.1415,3.1415926535,3.141592653589793,
664 3.1415926535897932,3.14159265358979323,3.1,
665 3.141592653589793238462643,9.1096e-31,2.997925e8
,6.241e18
,5.381e18
,
666 1.7e-309,6.5822e-16,1.7e+307,2.2e30
,3.1,3.1,-3.1,
667 0.0,0.0,0.0,1.00e+308
669 //------------------------------------------------------------------------
670 static const sal_Int32 nFloatCount
=22;
671 // static const sal_Char *inputFloat[nFloatCount] =
680 // "3.141592653589793238462643",
696 static const float expValFloat
[nFloatCount
] =
705 3.141592653589793238462643f
,
721 static const float fPrecision
[nFloatCount
] =
746 //------------------------------------------------------------------------
747 static const sal_Int32 nCharCount
=15;
748 static const sal_Char
*inputChar
[nCharCount
] =
753 "\0","","Sun Microsystems"
755 static const sal_Unicode expValChar
[nCharCount
] =
762 //------------------------------------------------------------------------
763 static const sal_Int32 nDefaultCount
=6;
764 static const sal_Unicode input1Default
[nDefaultCount
] =
768 static const sal_Int32 input2Default
[nDefaultCount
] =
772 static const sal_Int32 expValDefault
[nDefaultCount
] =
776 //------------------------------------------------------------------------
777 static const sal_Int32 nNormalCount
=10;
778 static const sal_Unicode input1Normal
[nNormalCount
] =
780 77,77,77,115,115,115,119,119,0,0
782 static const sal_Int32 input2Normal
[nNormalCount
] =
784 0,32,80,0,13,20,0,80,0,32
786 static const sal_Int32 expValNormal
[nNormalCount
] =
788 4,-1,-1,9,15,-1,-1,-1,-1,-1
790 //------------------------------------------------------------------------
791 static const sal_Int32 nlastDefaultCount
=5;
792 static const sal_Unicode input1lastDefault
[nlastDefaultCount
] =
796 static const sal_Int32 input2lastDefault
[nlastDefaultCount
] =
800 static const sal_Int32 expVallastDefault
[nlastDefaultCount
] =
804 //------------------------------------------------------------------------
805 static const sal_Int32 nlastNormalCount
=8;
806 static const sal_Unicode input1lastNormal
[nlastNormalCount
] =
808 77,77,77,115,115,119,119,0
810 static const sal_Int32 input2lastNormal
[nlastNormalCount
] =
812 29,0,80,31,3,31,80,31
814 static const sal_Int32 expVallastNormal
[nlastNormalCount
] =
816 4,-1,4,15,-1,-1,-1,-1
818 //------------------------------------------------------------------------
819 static const sal_Int32 nStrDefaultCount
=6;
820 static const sal_Unicode
*input1StrDefault
[nStrDefaultCount
] =
822 aUStr7
,aUStr8
,aUStr21
,
823 aUStr30
,aUStr25
,aUStr26
825 static const sal_Int32 input2StrDefault
[nStrDefaultCount
] =
829 static const sal_Int32 expValStrDefault
[nStrDefaultCount
] =
833 //------------------------------------------------------------------------
834 static const sal_Int32 nStrNormalCount
=9;
835 static const sal_Unicode
*input1StrNormal
[nStrNormalCount
] =
837 aUStr7
,aUStr7
,aUStr8
,aUStr8
,aUStr21
,aUStr30
,aUStr25
,aUStr25
,aUStr26
839 static const sal_Int32 input2StrNormal
[nStrNormalCount
] =
843 static const sal_Int32 expValStrNormal
[nStrNormalCount
] =
845 0,-1,4,-1,-1,-1,-1,-1,3
847 //------------------------------------------------------------------------
848 static const sal_Int32 nStrLastDefaultCount
=6;
849 static const sal_Unicode
*input1StrLastDefault
[nStrLastDefaultCount
] =
851 aUStr7
,aUStr8
,aUStr21
,aUStr30
,aUStr25
,aUStr26
853 static const sal_Int32 input2StrLastDefault
[nStrLastDefaultCount
] =
857 static const sal_Int32 expValStrLastDefault
[nStrLastDefaultCount
] =
861 //------------------------------------------------------------------------
862 static const sal_Int32 nStrLastNormalCount
=12;
863 static const sal_Unicode
*input1StrLastNormal
[nStrLastNormalCount
] =
865 aUStr7
,aUStr7
,aUStr7
,aUStr8
,aUStr8
,aUStr21
,aUStr30
,
866 aUStr25
,aUStr25
,aUStr26
,aUStr27
,aUStr27
868 static const sal_Int32 input2StrLastNormal
[nStrLastNormalCount
] =
870 31,0,80,31,2,31,31,31,0,31,31,14
872 static const sal_Int32 expValStrLastNormal
[nStrLastNormalCount
] =
874 0,-1,0,4,-1,-1,-1,-1,-1,3,15,11
876 //------------------------------------------------------------------------
877 static const sal_Int32 kNonSInt32Max
= INT_MIN
;
878 static const sal_Int32 kNonSInt16Max
= SHRT_MIN
;
879 //------------------------------------------------------------------------
884 //------------------------------------------------------------------------
885 //------------------------------------------------------------------------
887 #endif /* _RTL_STRING_CONST_H_ */