1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef _RTL_STRING_CONST_H_
30 #define _RTL_STRING_CONST_H_
32 #ifndef _RTL_STRING_UTILS_HXX_
33 #include <rtl_String_Utils.hxx>
39 #include <sal/types.h>
42 #ifndef _RTL_TEXTENC_H
43 #include <rtl/textenc.h>
46 #ifndef _RTL_USTRING_H_
47 #include <rtl/ustring.h>
55 static const rtl_TextEncoding kEncodingRTLTextUSASCII
= RTL_TEXTENCODING_ASCII_US
;
57 static const sal_uInt32 kConvertFlagsOUStringToOString
= OUSTRING_TO_OSTRING_CVTFLAGS
;
58 static const sal_uInt32 kConvertFlagsOStringToOUString
= OSTRING_TO_OUSTRING_CVTFLAGS
;
60 static const sal_Char
*kTestStr1
= "Sun Microsystems";
61 static const sal_Char
*kTestStr2
= "Sun Microsystems Java Technology";
62 static const sal_Char
*kTestStr7
= "Sun ";
63 static const sal_Char
*kTestStr8
= "Microsystems";
64 static const sal_Char
*kTestStr14
= " Sun Microsystems";
65 static const sal_Char
*kTestStr17
= " Sun Microsystems ";
66 static const sal_Char
*kTestStr23
= " Java Technology";
67 static const sal_Char
*kTestStr25
= "";
68 static const sal_Char
*kTestStr27
= "s";
69 static const sal_Char
*kTestStr28
= "\50\3\5\7\11\13\15\17sun";
70 static const sal_Char
*kTestStr29
= "\50\3\5\7\11\13\15\17sun\21\23\25\27\31\33\50";
71 static const sal_Char
*kTestStr31
= "sun Microsystems";
72 static const sal_Char
*kTestStr36
= "Microsystems Java Technology";
73 static const sal_Char
*kTestStr37
= "Sun Java Technology";
74 static const sal_Char
*kTestStr38
= "\21\23\25\27\31\33\50";
75 static const sal_Char
*kTestStr39
= "\50\3\5\7\11\13\15\17sun Sun Microsystems ";
76 static const sal_Char
*kTestStr40
= "\50\3\5\7\11\13\15\17sunsun Microsystems";
77 static const sal_Char
*kTestStr45
= "Sun true";
78 static const sal_Char
*kTestStr46
= "Sun false";
79 static const sal_Char
*kTestStr47
= "true";
80 static const sal_Char
*kTestStr48
= "false";
81 static const sal_Char
*kTestStr49
= "\50\3\5\7\11\13\15\17suntrue";
82 static const sal_Char
*kTestStr50
= "\50\3\5\7\11\13\15\17sunfalse";
83 static const sal_Char
*kTestStr51
= "Sun M";
84 //static const sal_Char *kTestStr52 = "Sun \077777";
85 //static const sal_Char *kTestStr53 = "Sun \100000";
86 //static const sal_Char *kTestStr54 = "\77777";
87 //static const sal_Char *kTestStr55 = "\100000";
88 static const sal_Char
*kTestStr56
= "\50\3\5\7\11\13\15\17suns";
89 //static const sal_Char *kTestStr57 = "\50\3\5\7\11\13\15\17sun\77777";
90 //static const sal_Char *kTestStr58 = "\50\3\5\7\11\13\15\17sun\10000";
91 static const sal_Char
*kTestStr59
= "Sun 11";
92 static const sal_Char
*kTestStr60
= "11";
93 static const sal_Char
*kTestStr61
= "\50\3\5\7\11\13\15\17sun11";
94 static const sal_Char
*kTestStr62
= "Sun 0";
95 static const sal_Char
*kTestStr63
= "Sun -11";
96 static const sal_Char
*kTestStr64
= "Sun 2147483647";
97 static const sal_Char
*kTestStr65
= "Sun -2147483648";
98 static const sal_Char
*kTestStr66
= "0";
99 static const sal_Char
*kTestStr67
= "-11";
100 static const sal_Char
*kTestStr68
= "2147483647";
101 static const sal_Char
*kTestStr69
= "-2147483648";
102 static const sal_Char
*kTestStr70
= "\50\3\5\7\11\13\15\17sun0";
103 static const sal_Char
*kTestStr71
= "\50\3\5\7\11\13\15\17sun-11";
104 static const sal_Char
*kTestStr72
= "\50\3\5\7\11\13\15\17sun2147483647";
105 static const sal_Char
*kTestStr73
= "\50\3\5\7\11\13\15\17sun-2147483648";
106 static const sal_Char
*kTestStr116
= "Sun 9223372036854775807";
107 static const sal_Char
*kTestStr117
= "Sun -9223372036854775808";
108 static const sal_Char
*kTestStr118
= "9223372036854775807";
109 static const sal_Char
*kTestStr119
= "-9223372036854775808";
110 static const sal_Char
*kTestStr120
= "\50\3\5\7\11\13\15\17sun9223372036854775807";
111 static const sal_Char
*kTestStr121
= "\50\3\5\7\11\13\15\17sun-9223372036854775808";
112 static const sal_Char
*kTestStr143
= "Sun \377";
113 static const sal_Char
*kTestStr144
= "\377";
114 static const sal_Char
*kTestStr145
= "\50\3\5\7\11\13\15\17sun\377";
116 static const sal_Int32 kTestStr1Len
= 16;
117 static const sal_Int32 kTestStr2Len
= 32;
118 static const sal_Int32 kTestStr3Len
= 16;
119 static const sal_Int32 kTestStr4Len
= 16;
120 static const sal_Int32 kTestStr5Len
= 16;
121 static const sal_Int32 kTestStr6Len
= 15;
122 static const sal_Int32 kTestStr7Len
= 4;
123 static const sal_Int32 kTestStr8Len
= 12;
124 static const sal_Int32 kTestStr9Len
= 32;
125 static const sal_Int32 kTestStr10Len
= 17;
126 static const sal_Int32 kTestStr11Len
= 17;
127 static const sal_Int32 kTestStr12Len
= 18;
128 static const sal_Int32 kTestStr13Len
= 19;
129 static const sal_Int32 kTestStr14Len
= 19;
130 static const sal_Int32 kTestStr15Len
= 20;
131 static const sal_Int32 kTestStr16Len
= 20;
132 static const sal_Int32 kTestStr17Len
= 22;
133 static const sal_Int32 kTestStr18Len
= 16;
134 static const sal_Int32 kTestStr19Len
= 22;
135 static const sal_Int32 kTestStr20Len
= 3;
136 static const sal_Int32 kTestStr21Len
= 3;
137 static const sal_Int32 kTestStr22Len
= 32;
138 static const sal_Int32 kTestStr23Len
= 16;
139 static const sal_Int32 kTestStr24Len
= 31;
140 static const sal_Int32 kTestStr25Len
= 0;
141 static const sal_Int32 kTestStr26Len
= 4;
142 static const sal_Int32 kTestStr27Len
= 1;
143 static const sal_Int32 kTestStr28Len
= 11;
144 static const sal_Int32 kTestStr29Len
= 18;
145 static const sal_Int32 kTestStr30Len
= 10;
146 static const sal_Int32 kTestStr31Len
= 16;
147 static const sal_Int32 kTestStr32Len
= 16;
148 static const sal_Int32 kTestStr33Len
= 1;
149 static const sal_Int32 kTestStr34Len
= 11;
150 static const sal_Int32 kTestStr35Len
= 11;
151 static const sal_Int32 kTestStr36Len
= 28;
152 static const sal_Int32 kTestStr37Len
= 20;
153 static const sal_Int32 kTestStr38Len
= 7;
154 static const sal_Int32 kTestStr39Len
= 33;
155 static const sal_Int32 kTestStr40Len
= 27;
156 static const sal_Int32 kTestStr41Len
= 3;
157 static const sal_Int32 kTestStr42Len
= 10;
158 static const sal_Int32 kTestStr43Len
= 13;
159 static const sal_Int32 kTestStr44Len
= 2;
160 static const sal_Int32 kTestStr45Len
= 8;
161 static const sal_Int32 kTestStr46Len
= 9;
162 static const sal_Int32 kTestStr47Len
= 4;
163 static const sal_Int32 kTestStr48Len
= 5;
164 static const sal_Int32 kTestStr49Len
= 15;
165 static const sal_Int32 kTestStr50Len
= 16;
166 static const sal_Int32 kTestStr51Len
= 5;
167 static const sal_Int32 kTestStr52Len
= 5;
168 static const sal_Int32 kTestStr53Len
= 5;
169 static const sal_Int32 kTestStr54Len
= 1;
170 static const sal_Int32 kTestStr55Len
= 1;
171 static const sal_Int32 kTestStr56Len
= 12;
172 static const sal_Int32 kTestStr57Len
= 12;
173 static const sal_Int32 kTestStr58Len
= 12;
174 static const sal_Int32 kTestStr59Len
= 6;
175 static const sal_Int32 kTestStr60Len
= 2;
176 static const sal_Int32 kTestStr61Len
= 13;
177 static const sal_Int32 kTestStr62Len
= 5;
178 static const sal_Int32 kTestStr63Len
= 7;
179 static const sal_Int32 kTestStr64Len
= 14;
180 static const sal_Int32 kTestStr65Len
= 15;
181 static const sal_Int32 kTestStr66Len
= 1;
182 static const sal_Int32 kTestStr67Len
= 3;
183 static const sal_Int32 kTestStr68Len
= 10;
184 static const sal_Int32 kTestStr69Len
= 11;
185 static const sal_Int32 kTestStr70Len
= 12;
186 static const sal_Int32 kTestStr71Len
= 14;
187 static const sal_Int32 kTestStr72Len
= 21;
188 static const sal_Int32 kTestStr73Len
= 22;
189 static const sal_Int32 kTestStr74Len
= 7;
190 static const sal_Int32 kTestStr75Len
= 7;
191 static const sal_Int32 kTestStr76Len
= 10;
192 static const sal_Int32 kTestStr77Len
= 12;
193 static const sal_Int32 kTestStr78Len
= 12;
194 static const sal_Int32 kTestStr79Len
= 13;
195 static const sal_Int32 kTestStr80Len
= 13;
196 static const sal_Int32 kTestStr81Len
= 3;
197 static const sal_Int32 kTestStr82Len
= 3;
198 static const sal_Int32 kTestStr83Len
= 6;
199 static const sal_Int32 kTestStr84Len
= 8;
200 static const sal_Int32 kTestStr85Len
= 8;
201 static const sal_Int32 kTestStr86Len
= 9;
202 static const sal_Int32 kTestStr87Len
= 9;
203 static const sal_Int32 kTestStr88Len
= 14;
204 static const sal_Int32 kTestStr89Len
= 14;
205 static const sal_Int32 kTestStr90Len
= 17;
206 static const sal_Int32 kTestStr91Len
= 19;
207 static const sal_Int32 kTestStr92Len
= 19;
208 static const sal_Int32 kTestStr93Len
= 20;
209 static const sal_Int32 kTestStr94Len
= 20;
210 static const sal_Int32 kTestStr95Len
= 8;
211 static const sal_Int32 kTestStr96Len
= 8;
212 static const sal_Int32 kTestStr97Len
= 11;
213 static const sal_Int32 kTestStr98Len
= 13;
214 static const sal_Int32 kTestStr99Len
= 13;
215 static const sal_Int32 kTestStr100Len
= 14;
216 static const sal_Int32 kTestStr101Len
= 14;
217 static const sal_Int32 kTestStr102Len
= 4;
218 static const sal_Int32 kTestStr103Len
= 4;
219 static const sal_Int32 kTestStr104Len
= 7;
220 static const sal_Int32 kTestStr105Len
= 9;
221 static const sal_Int32 kTestStr106Len
= 9;
222 static const sal_Int32 kTestStr107Len
= 10;
223 static const sal_Int32 kTestStr108Len
= 10;
224 static const sal_Int32 kTestStr109Len
= 15;
225 static const sal_Int32 kTestStr110Len
= 15;
226 static const sal_Int32 kTestStr111Len
= 18;
227 static const sal_Int32 kTestStr112Len
= 20;
228 static const sal_Int32 kTestStr113Len
= 20;
229 static const sal_Int32 kTestStr114Len
= 21;
230 static const sal_Int32 kTestStr115Len
= 21;
231 static const sal_Int32 kTestStr116Len
= 23;
232 static const sal_Int32 kTestStr117Len
= 24;
233 static const sal_Int32 kTestStr118Len
= 19;
234 static const sal_Int32 kTestStr119Len
= 20;
235 static const sal_Int32 kTestStr120Len
= 30;
236 static const sal_Int32 kTestStr121Len
= 31;
237 static const sal_Int32 kTestStr122Len
= 16;
238 static const sal_Int32 kTestStr123Len
= 21;
239 static const sal_Int32 kTestStr124Len
= 23;
240 static const sal_Int32 kTestStr125Len
= 30;
241 static const sal_Int32 kTestStr126Len
= 12;
242 static const sal_Int32 kTestStr127Len
= 17;
243 static const sal_Int32 kTestStr128Len
= 19;
244 static const sal_Int32 kTestStr129Len
= 26;
245 static const sal_Int32 kTestStr130Len
= 23;
246 static const sal_Int32 kTestStr131Len
= 28;
247 static const sal_Int32 kTestStr132Len
= 30;
248 static const sal_Int32 kTestStr133Len
= 37;
249 static const sal_Int32 kTestStr134Len
= 22;
250 static const sal_Int32 kTestStr135Len
= 24;
251 static const sal_Int32 kTestStr136Len
= 31;
252 static const sal_Int32 kTestStr137Len
= 18;
253 static const sal_Int32 kTestStr138Len
= 20;
254 static const sal_Int32 kTestStr139Len
= 27;
255 static const sal_Int32 kTestStr140Len
= 29;
256 static const sal_Int32 kTestStr141Len
= 31;
257 static const sal_Int32 kTestStr142Len
= 38;
258 static const sal_Int32 kTestStr143Len
= 5;
259 static const sal_Int32 kTestStr144Len
= 1;
260 static const sal_Int32 kTestStr145Len
= 12;
261 static const sal_Int32 kTestStr146Len
= 19;
262 static const sal_Int32 kTestStr147Len
= 19;
263 static const sal_Int32 kTestStr148Len
= 19;
264 static const sal_Int32 kTestStr149Len
= 32;
265 static const sal_Int32 kTestStr150Len
= 32;
266 static const sal_Int32 kTestStr151Len
= 31;
267 static const sal_Int32 kTestStr152Len
= 31;
268 static const sal_Int32 kTestStr153Len
= 31;
269 static const sal_Int32 kTestStr154Len
= 36;
270 static const sal_Int32 kTestStr155Len
= 36;
271 static const sal_Int32 kTestStr156Len
= 36;
272 static const sal_Int32 kTestStr157Len
= 49;
273 static const sal_Int32 kTestStr158Len
= 49;
274 static const sal_Int32 kTestStr159Len
= 49;
275 static const sal_Int32 kTestStr160Len
= 48;
276 static const sal_Int32 kTestStr161Len
= 48;
277 static const sal_Int32 kTestStr162Len
= 48;
278 static const sal_Int32 kTestStr163Len
= 15;
279 static const sal_Int32 kTestStr164Len
= 15;
280 static const sal_Int32 kTestStr165Len
= 15;
281 static const sal_Int32 kTestStr166Len
= 28;
282 static const sal_Int32 kTestStr167Len
= 28;
283 static const sal_Int32 kTestStr168Len
= 28;
284 static const sal_Int32 kTestStr169Len
= 27;
285 static const sal_Int32 kTestStr170Len
= 27;
286 static const sal_Int32 kTestStr171Len
= 27;
287 static const sal_Int32 kTestStr1PlusStr6Len
= kTestStr1Len
+ kTestStr6Len
;
289 static const sal_Int32 uTestStr1Len
= 16;
290 static const sal_Int32 uTestStr2Len
= 32;
291 static const sal_Int32 uTestStr3Len
= 16;
292 static const sal_Int32 uTestStr4Len
= 16;
293 static const sal_Int32 uTestStr5Len
= 16;
294 static const sal_Int32 uTestStr9Len
= 32;
295 static const sal_Int32 uTestStr22Len
= 32;
297 const sal_Unicode uTestStr31
[]= {0x400,0x410,0x4DF};
298 const sal_Unicode uTestStr32
[]= {0x9F9F,0xA000,0x8F80,0x9AD9};
300 static const sal_Int32 uTestStr31Len
= 3;
301 static const sal_Int32 uTestStr32Len
= 4;
303 static const sal_Int16 kRadixBinary
= 2;
304 static const sal_Int16 kRadixOctol
= 8;
305 static const sal_Int16 kRadixDecimal
= 10;
306 static const sal_Int16 kRadixHexdecimal
= 16;
307 static const sal_Int16 kRadixBase36
= 36;
309 static const sal_Int8 kSInt8Max
= SCHAR_MAX
;
310 static const sal_Int16 kUInt8Max
= UCHAR_MAX
;
311 static const sal_Int16 kSInt16Max
= SHRT_MAX
;
312 static const sal_Int32 kUInt16Max
= USHRT_MAX
;
313 static const sal_Int32 kSInt32Max
= INT_MAX
;
314 static const sal_Int64 kUInt32Max
= UINT_MAX
;
315 static const sal_Int64 kSInt64Max
= SAL_CONST_INT64(9223372036854775807);
317 //------------------------------------------------------------------------
319 static const sal_Int32 kInt32MaxNumsCount
= 5;
321 static const sal_Int32 kInt32MaxNums
[kInt32MaxNumsCount
] =
323 kSInt8Max
, kUInt8Max
,
324 kSInt16Max
, kUInt16Max
,
328 static const sal_Int32 kInt64MaxNumsCount
= 7;
330 static const sal_Int64 kInt64MaxNums
[kInt64MaxNumsCount
] =
332 kSInt8Max
, kUInt8Max
,
333 kSInt16Max
, kUInt16Max
,
334 kSInt32Max
, kUInt32Max
,
338 static const sal_Int32 kBinaryNumsCount
= 16;
340 static const sal_Int32 kBinaryMaxNumsCount
= 7;
342 //------------------------------------------------------------------------
344 static const sal_Int32 kOctolNumsCount
= 16;
346 static const sal_Int32 kOctolMaxNumsCount
= 7;
348 //------------------------------------------------------------------------
350 static const sal_Int32 kDecimalNumsCount
= 16;
352 static const sal_Int32 kDecimalMaxNumsCount
= 7;
354 //------------------------------------------------------------------------
356 static const sal_Int32 kHexDecimalNumsCount
= 16;
358 static const sal_Int32 kHexDecimalMaxNumsCount
= 7;
360 //------------------------------------------------------------------------
362 static const sal_Int32 kBase36NumsCount
= 36;
364 static const sal_Int32 kBase36MaxNumsCount
= 7;
366 static const sal_Int32 nDoubleCount
=24;
367 static const double expValDouble
[nDoubleCount
]=
369 3.0,3.1,3.1415,3.1415926535,3.141592653589793,
370 3.1415926535897932,3.14159265358979323,3.1,
371 3.141592653589793238462643,9.1096e-31,2.997925e8
,6.241e18
,5.381e18
,
372 1.7e-309,6.5822e-16,1.7e+307,2.2e30
,3.1,3.1,-3.1,
373 0.0,0.0,0.0,1.00e+308
375 //------------------------------------------------------------------------
376 static const sal_Int32 nFloatCount
=22;
377 static const float expValFloat
[nFloatCount
] =
379 3.0f
,3.1f
,3.1415f
,3.14159f
,3.141592f
,
380 3.1415926f
,3.14159265f
,3.141592653589793238462643f
,
381 6.5822e-16f
,9.1096e-31f
,2.997925e8f
,6.241e18f
,
382 1.00e38f
,6.241e-37f
,6.241e37f
,3.1f
,3.1f
,-3.1f
,
385 //------------------------------------------------------------------------
386 static const sal_Int32 nCharCount
=15;
387 static const sal_Unicode expValChar
[nCharCount
] =
394 //------------------------------------------------------------------------
395 static const sal_Int32 nDefaultCount
=6;
396 static const sal_Unicode input1Default
[nDefaultCount
] =
400 static const sal_Int32 input2Default
[nDefaultCount
] =
404 static const sal_Int32 expValDefault
[nDefaultCount
] =
408 //------------------------------------------------------------------------
409 static const sal_Int32 nNormalCount
=10;
410 static const sal_Unicode input1Normal
[nNormalCount
] =
412 77,77,77,115,115,115,119,119,0,0
414 static const sal_Int32 input2Normal
[nNormalCount
] =
416 0,32,80,0,13,20,0,80,0,32
418 static const sal_Int32 expValNormal
[nNormalCount
] =
420 4,-1,-1,9,15,-1,-1,-1,-1,-1
422 //------------------------------------------------------------------------
423 static const sal_Int32 nlastDefaultCount
=5;
424 static const sal_Unicode input1lastDefault
[nlastDefaultCount
] =
428 static const sal_Int32 input2lastDefault
[nlastDefaultCount
] =
432 static const sal_Int32 expVallastDefault
[nlastDefaultCount
] =
436 //------------------------------------------------------------------------
437 static const sal_Int32 nlastNormalCount
=8;
438 static const sal_Unicode input1lastNormal
[nlastNormalCount
] =
440 77,77,77,115,115,119,119,0
442 static const sal_Int32 input2lastNormal
[nlastNormalCount
] =
444 29,0,80,31,3,31,80,31
446 static const sal_Int32 expVallastNormal
[nlastNormalCount
] =
448 4,-1,4,15,-1,-1,-1,-1
450 //------------------------------------------------------------------------
451 static const sal_Int32 nStrDefaultCount
=6;
452 static const sal_Int32 input2StrDefault
[nStrDefaultCount
] =
456 static const sal_Int32 expValStrDefault
[nStrDefaultCount
] =
460 //------------------------------------------------------------------------
461 static const sal_Int32 nStrNormalCount
=9;
462 static const sal_Int32 input2StrNormal
[nStrNormalCount
] =
466 static const sal_Int32 expValStrNormal
[nStrNormalCount
] =
468 0,-1,4,-1,-1,-1,-1,-1,3
470 //------------------------------------------------------------------------
471 static const sal_Int32 nStrLastDefaultCount
=6;
472 static const sal_Int32 input2StrLastDefault
[nStrLastDefaultCount
] =
476 static const sal_Int32 expValStrLastDefault
[nStrLastDefaultCount
] =
480 //------------------------------------------------------------------------
481 static const sal_Int32 nStrLastNormalCount
=12;
482 static const sal_Int32 input2StrLastNormal
[nStrLastNormalCount
] =
484 31,0,80,31,2,31,31,31,0,31,31,14
486 static const sal_Int32 expValStrLastNormal
[nStrLastNormalCount
] =
488 0,-1,0,4,-1,-1,-1,-1,-1,3,15,11
490 //------------------------------------------------------------------------
491 static const sal_Int32 kNonSInt32Max
= INT_MIN
;
492 static const sal_Int32 kNonSInt16Max
= SHRT_MIN
;
493 //------------------------------------------------------------------------
498 #endif /* _RTL_STRING_CONST_H_ */
500 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */