Commit | Line | Data |
---|---|---|
d44e3c4f | 1 | /****************************************************************************** |
2 | * Copyright (c) 2000-2016 Ericsson Telecom AB | |
3 | * All rights reserved. This program and the accompanying materials | |
4 | * are made available under the terms of the Eclipse Public License v1.0 | |
5 | * which accompanies this distribution, and is available at | |
6 | * http://www.eclipse.org/legal/epl-v10.html | |
7 | * | |
8 | * Contributors: | |
9 | * Baji, Laszlo | |
10 | * Balasko, Jeno | |
11 | * Baranyi, Botond | |
12 | * Delic, Adam | |
13 | * Forstner, Matyas | |
14 | * Kovacs, Ferenc | |
15 | * Raduly, Csaba | |
16 | * Szabo, Janos Zoltan – initial implementation | |
17 | * Zalanyi, Balazs Andor | |
18 | * | |
19 | ******************************************************************************/ | |
970ed795 EL |
20 | #ifndef ADDFUNC_HH |
21 | #define ADDFUNC_HH | |
22 | ||
23 | #include "Types.h" | |
24 | ||
25 | class INTEGER; | |
26 | class FLOAT; | |
27 | class BITSTRING; | |
28 | class BITSTRING_ELEMENT; | |
29 | class HEXSTRING; | |
30 | class HEXSTRING_ELEMENT; | |
31 | class OCTETSTRING; | |
32 | class OCTETSTRING_ELEMENT; | |
33 | class CHARSTRING; | |
34 | class CHARSTRING_ELEMENT; | |
35 | class UNIVERSAL_CHARSTRING; | |
36 | class UNIVERSAL_CHARSTRING_ELEMENT; | |
37 | class BITSTRING_template; | |
38 | class HEXSTRING_template; | |
39 | class OCTETSTRING_template; | |
40 | class CHARSTRING_template; | |
41 | class UNIVERSAL_CHARSTRING_template; | |
42 | ||
43 | extern char hexdigit_to_char(unsigned char hexdigit); | |
44 | ||
45 | // Additional predefined functions defined in Annex C of ES 101 873-1 | |
46 | ||
47 | // C.1 - int2char | |
48 | extern CHARSTRING int2char(int value); | |
49 | extern CHARSTRING int2char(const INTEGER& value); | |
50 | ||
51 | // C.2 - int2unichar | |
52 | extern UNIVERSAL_CHARSTRING int2unichar(int value); | |
53 | extern UNIVERSAL_CHARSTRING int2unichar(const INTEGER& value); | |
54 | ||
55 | // C.3 - int2bit | |
56 | extern BITSTRING int2bit(int value, int length); | |
57 | extern BITSTRING int2bit(int value, const INTEGER& length); | |
58 | extern BITSTRING int2bit(const INTEGER& value, int length); | |
59 | extern BITSTRING int2bit(const INTEGER& value, const INTEGER& length); | |
60 | ||
61 | // C.4 - int2hex | |
62 | extern HEXSTRING int2hex(int value, int length); | |
63 | extern HEXSTRING int2hex(int value, const INTEGER& length); | |
64 | extern HEXSTRING int2hex(const INTEGER& value, int length); | |
65 | extern HEXSTRING int2hex(const INTEGER& value, const INTEGER& length); | |
66 | ||
67 | // C.5 - int2oct | |
68 | extern OCTETSTRING int2oct(int value, int length); | |
69 | extern OCTETSTRING int2oct(int value, const INTEGER& length); | |
70 | extern OCTETSTRING int2oct(const INTEGER& value, int length); | |
71 | extern OCTETSTRING int2oct(const INTEGER& value, const INTEGER& length); | |
72 | ||
73 | // C.6 - int2str | |
74 | extern CHARSTRING int2str(int value); | |
75 | extern CHARSTRING int2str(const INTEGER& value); | |
76 | ||
77 | // C.7 - int2float | |
78 | extern double int2float(int value); | |
79 | extern double int2float(const INTEGER& value); | |
80 | ||
81 | // C.8 - float2int | |
82 | extern INTEGER float2int(double value); | |
83 | extern INTEGER float2int(const FLOAT& value); | |
84 | ||
85 | // C.9 - char2int | |
86 | extern int char2int(char value); | |
87 | extern int char2int(const char *value); | |
88 | extern int char2int(const CHARSTRING& value); | |
89 | extern int char2int(const CHARSTRING_ELEMENT& value); | |
90 | ||
91 | // C.10 - char2oct | |
92 | extern OCTETSTRING char2oct(const char *value); | |
93 | extern OCTETSTRING char2oct(const CHARSTRING& value); | |
94 | extern OCTETSTRING char2oct(const CHARSTRING_ELEMENT& value); | |
95 | ||
96 | // C.11 - unichar2int | |
97 | extern int unichar2int(const universal_char& value); | |
98 | extern int unichar2int(const UNIVERSAL_CHARSTRING& value); | |
99 | extern int unichar2int(const UNIVERSAL_CHARSTRING_ELEMENT& value); | |
100 | ||
101 | // C.12 - bit2int | |
102 | extern INTEGER bit2int(const BITSTRING& value); | |
103 | extern INTEGER bit2int(const BITSTRING_ELEMENT& value); | |
104 | ||
105 | // C.13 - bit2hex | |
106 | extern HEXSTRING bit2hex(const BITSTRING& value); | |
107 | extern HEXSTRING bit2hex(const BITSTRING_ELEMENT& value); | |
108 | ||
109 | // C.14 - bit2oct | |
110 | extern OCTETSTRING bit2oct(const BITSTRING& value); | |
111 | extern OCTETSTRING bit2oct(const BITSTRING_ELEMENT& value); | |
112 | ||
113 | // C.15 - bit2str | |
114 | extern CHARSTRING bit2str(const BITSTRING& value); | |
115 | extern CHARSTRING bit2str(const BITSTRING_ELEMENT& value); | |
116 | ||
117 | // C.16 - hex2int | |
118 | extern INTEGER hex2int(const HEXSTRING& value); | |
119 | extern INTEGER hex2int(const HEXSTRING_ELEMENT& value); | |
120 | ||
121 | // C.17 - hex2bit | |
122 | extern BITSTRING hex2bit(const HEXSTRING& value); | |
123 | extern BITSTRING hex2bit(const HEXSTRING_ELEMENT& value); | |
124 | ||
125 | // C.18 - hex2oct | |
126 | extern OCTETSTRING hex2oct(const HEXSTRING& value); | |
127 | extern OCTETSTRING hex2oct(const HEXSTRING_ELEMENT& value); | |
128 | ||
129 | // C.19 - hex2str | |
130 | extern CHARSTRING hex2str(const HEXSTRING& value); | |
131 | extern CHARSTRING hex2str(const HEXSTRING_ELEMENT& value); | |
132 | ||
133 | // C.20 - oct2int | |
134 | extern INTEGER oct2int(const OCTETSTRING& value); | |
135 | extern INTEGER oct2int(const OCTETSTRING_ELEMENT& value); | |
136 | ||
137 | // C.21 - oct2bit | |
138 | extern BITSTRING oct2bit(const OCTETSTRING& value); | |
139 | extern BITSTRING oct2bit(const OCTETSTRING_ELEMENT& value); | |
140 | ||
141 | // C.22 - oct2hex | |
142 | extern HEXSTRING oct2hex(const OCTETSTRING& value); | |
143 | extern HEXSTRING oct2hex(const OCTETSTRING_ELEMENT& value); | |
144 | ||
145 | // C.23 - oct2str | |
146 | extern CHARSTRING oct2str(const OCTETSTRING& value); | |
147 | extern CHARSTRING oct2str(const OCTETSTRING_ELEMENT& value); | |
148 | ||
149 | // C.24 - oct2char | |
150 | extern CHARSTRING oct2char(const OCTETSTRING& value); | |
151 | extern CHARSTRING oct2char(const OCTETSTRING_ELEMENT& value); | |
152 | ||
153 | // C.25 - str2int | |
154 | extern INTEGER str2int(const char *value); | |
155 | extern INTEGER str2int(const CHARSTRING& value); | |
156 | extern INTEGER str2int(const CHARSTRING_ELEMENT& value); | |
157 | ||
158 | // C.26 - str2oct | |
159 | extern OCTETSTRING str2oct(const char *value); | |
160 | extern OCTETSTRING str2oct(const CHARSTRING& value); | |
161 | ||
162 | // C.27 - str2float | |
163 | extern double str2float(const char *value); | |
164 | extern double str2float(const CHARSTRING& value); | |
165 | ||
166 | // C.28 - lengthof: built-in | |
167 | ||
168 | // C.29 - sizeof: built-in | |
169 | ||
170 | // C.31 - ispresent: built-in | |
171 | ||
172 | // C.32 - ischosen: built-in | |
173 | ||
174 | // C.33 - regexp | |
175 | extern CHARSTRING regexp(const CHARSTRING& instr, const CHARSTRING& expression, | |
176 | int groupno); | |
177 | extern CHARSTRING regexp(const CHARSTRING& instr, const CHARSTRING& expression, | |
178 | const INTEGER& groupno); | |
179 | extern UNIVERSAL_CHARSTRING regexp(const UNIVERSAL_CHARSTRING& instr, | |
180 | const UNIVERSAL_CHARSTRING* expression_val, | |
181 | const UNIVERSAL_CHARSTRING_template* expression_tmpl, | |
182 | int groupno); | |
183 | extern UNIVERSAL_CHARSTRING regexp(const UNIVERSAL_CHARSTRING& instr, | |
184 | const UNIVERSAL_CHARSTRING& expression, int groupno); | |
185 | extern UNIVERSAL_CHARSTRING regexp(const UNIVERSAL_CHARSTRING& instr, | |
186 | const UNIVERSAL_CHARSTRING& expression, const INTEGER& groupno); | |
187 | // regexp on templates | |
188 | extern CHARSTRING regexp(const CHARSTRING_template& instr, | |
189 | const CHARSTRING_template& expression, int groupno); | |
190 | extern CHARSTRING regexp(const CHARSTRING_template& instr, | |
191 | const CHARSTRING_template& expression, const INTEGER& groupno); | |
192 | extern UNIVERSAL_CHARSTRING regexp(const UNIVERSAL_CHARSTRING_template& instr, | |
193 | const UNIVERSAL_CHARSTRING_template& expression, int groupno); | |
194 | extern UNIVERSAL_CHARSTRING regexp(const UNIVERSAL_CHARSTRING_template& instr, | |
195 | const UNIVERSAL_CHARSTRING_template& expression, const INTEGER& groupno); | |
196 | ||
197 | // C.34 - substr | |
198 | extern void check_substr_arguments(int value_length, int index, | |
199 | int returncount, const char *string_type, const char *element_name); | |
200 | extern BITSTRING substr(const BITSTRING& value, int index, int returncount); | |
201 | extern BITSTRING substr(const BITSTRING& value, int index, | |
202 | const INTEGER& returncount); | |
203 | extern BITSTRING substr(const BITSTRING& value, const INTEGER& index, | |
204 | int returncount); | |
205 | extern BITSTRING substr(const BITSTRING& value, const INTEGER& index, | |
206 | const INTEGER& returncount); | |
207 | extern BITSTRING substr(const BITSTRING_ELEMENT& value, int index, | |
208 | int returncount); | |
209 | extern BITSTRING substr(const BITSTRING_ELEMENT& value, int index, | |
210 | const INTEGER& returncount); | |
211 | extern BITSTRING substr(const BITSTRING_ELEMENT& value, const INTEGER& index, | |
212 | int returncount); | |
213 | extern BITSTRING substr(const BITSTRING_ELEMENT& value, const INTEGER& index, | |
214 | const INTEGER& returncount); | |
215 | ||
216 | extern HEXSTRING substr(const HEXSTRING& value, int index, int returncount); | |
217 | extern HEXSTRING substr(const HEXSTRING& value, int index, | |
218 | const INTEGER& returncount); | |
219 | extern HEXSTRING substr(const HEXSTRING& value, const INTEGER& index, | |
220 | int returncount); | |
221 | extern HEXSTRING substr(const HEXSTRING& value, const INTEGER& index, | |
222 | const INTEGER& returncount); | |
223 | extern HEXSTRING substr(const HEXSTRING_ELEMENT& value, int index, | |
224 | int returncount); | |
225 | extern HEXSTRING substr(const HEXSTRING_ELEMENT& value, int index, | |
226 | const INTEGER& returncount); | |
227 | extern HEXSTRING substr(const HEXSTRING_ELEMENT& value, const INTEGER& index, | |
228 | int returncount); | |
229 | extern HEXSTRING substr(const HEXSTRING_ELEMENT& value, const INTEGER& index, | |
230 | const INTEGER& returncount); | |
231 | ||
232 | extern OCTETSTRING substr(const OCTETSTRING& value, int index, | |
233 | int returncount); | |
234 | extern OCTETSTRING substr(const OCTETSTRING& value, int index, | |
235 | const INTEGER& returncount); | |
236 | extern OCTETSTRING substr(const OCTETSTRING& value, const INTEGER& index, | |
237 | int returncount); | |
238 | extern OCTETSTRING substr(const OCTETSTRING& value, const INTEGER& index, | |
239 | const INTEGER& returncount); | |
240 | extern OCTETSTRING substr(const OCTETSTRING_ELEMENT& value, int index, | |
241 | int returncount); | |
242 | extern OCTETSTRING substr(const OCTETSTRING_ELEMENT& value, int index, | |
243 | const INTEGER& returncount); | |
244 | extern OCTETSTRING substr(const OCTETSTRING_ELEMENT& value, | |
245 | const INTEGER& index, int returncount); | |
246 | extern OCTETSTRING substr(const OCTETSTRING_ELEMENT& value, | |
247 | const INTEGER& index, const INTEGER& returncount); | |
248 | ||
249 | extern CHARSTRING substr(const CHARSTRING& value, int index, | |
250 | int returncount); | |
251 | extern CHARSTRING substr(const CHARSTRING& value, int index, | |
252 | const INTEGER& returncount); | |
253 | extern CHARSTRING substr(const CHARSTRING& value, const INTEGER& index, | |
254 | int returncount); | |
255 | extern CHARSTRING substr(const CHARSTRING& value, const INTEGER& index, | |
256 | const INTEGER& returncount); | |
257 | extern CHARSTRING substr(const CHARSTRING_ELEMENT& value, int index, | |
258 | int returncount); | |
259 | extern CHARSTRING substr(const CHARSTRING_ELEMENT& value, int index, | |
260 | const INTEGER& returncount); | |
261 | extern CHARSTRING substr(const CHARSTRING_ELEMENT& value, | |
262 | const INTEGER& index, int returncount); | |
263 | extern CHARSTRING substr(const CHARSTRING_ELEMENT& value, | |
264 | const INTEGER& index, const INTEGER& returncount); | |
265 | ||
266 | extern UNIVERSAL_CHARSTRING substr(const UNIVERSAL_CHARSTRING& value, | |
267 | int index, int returncount); | |
268 | extern UNIVERSAL_CHARSTRING substr(const UNIVERSAL_CHARSTRING& value, | |
269 | int index, const INTEGER& returncount); | |
270 | extern UNIVERSAL_CHARSTRING substr(const UNIVERSAL_CHARSTRING& value, | |
271 | const INTEGER& index, int returncount); | |
272 | extern UNIVERSAL_CHARSTRING substr(const UNIVERSAL_CHARSTRING& value, | |
273 | const INTEGER& index, const INTEGER& returncount); | |
274 | extern UNIVERSAL_CHARSTRING substr(const UNIVERSAL_CHARSTRING_ELEMENT& value, | |
275 | int index, int returncount); | |
276 | extern UNIVERSAL_CHARSTRING substr(const UNIVERSAL_CHARSTRING_ELEMENT& value, | |
277 | int index, const INTEGER& returncount); | |
278 | extern UNIVERSAL_CHARSTRING substr(const UNIVERSAL_CHARSTRING_ELEMENT& value, | |
279 | const INTEGER& index, int returncount); | |
280 | extern UNIVERSAL_CHARSTRING substr(const UNIVERSAL_CHARSTRING_ELEMENT& value, | |
281 | const INTEGER& index, const INTEGER& returncount); | |
282 | ||
283 | // substr for templates | |
284 | extern BITSTRING substr(const BITSTRING_template& value, int index, | |
285 | int returncount); | |
286 | extern BITSTRING substr(const BITSTRING_template& value, int index, | |
287 | const INTEGER& returncount); | |
288 | extern BITSTRING substr(const BITSTRING_template& value, const INTEGER& index, | |
289 | int returncount); | |
290 | extern BITSTRING substr(const BITSTRING_template& value, const INTEGER& index, | |
291 | const INTEGER& returncount); | |
292 | ||
293 | extern HEXSTRING substr(const HEXSTRING_template& value, int index, | |
294 | int returncount); | |
295 | extern HEXSTRING substr(const HEXSTRING_template& value, int index, | |
296 | const INTEGER& returncount); | |
297 | extern HEXSTRING substr(const HEXSTRING_template& value, const INTEGER& index, | |
298 | int returncount); | |
299 | extern HEXSTRING substr(const HEXSTRING_template& value, const INTEGER& index, | |
300 | const INTEGER& returncount); | |
301 | ||
302 | extern OCTETSTRING substr(const OCTETSTRING_template& value, int index, | |
303 | int returncount); | |
304 | extern OCTETSTRING substr(const OCTETSTRING_template& value, int index, | |
305 | const INTEGER& returncount); | |
306 | extern OCTETSTRING substr(const OCTETSTRING_template& value, const INTEGER& index, | |
307 | int returncount); | |
308 | extern OCTETSTRING substr(const OCTETSTRING_template& value, const INTEGER& index, | |
309 | const INTEGER& returncount); | |
310 | ||
311 | extern CHARSTRING substr(const CHARSTRING_template& value, int index, | |
312 | int returncount); | |
313 | extern CHARSTRING substr(const CHARSTRING_template& value, int index, | |
314 | const INTEGER& returncount); | |
315 | extern CHARSTRING substr(const CHARSTRING_template& value, const INTEGER& index, | |
316 | int returncount); | |
317 | extern CHARSTRING substr(const CHARSTRING_template& value, const INTEGER& index, | |
318 | const INTEGER& returncount); | |
319 | ||
320 | extern UNIVERSAL_CHARSTRING substr(const UNIVERSAL_CHARSTRING_template& value, | |
321 | int index, int returncount); | |
322 | extern UNIVERSAL_CHARSTRING substr(const UNIVERSAL_CHARSTRING_template& value, | |
323 | int index, const INTEGER& returncount); | |
324 | extern UNIVERSAL_CHARSTRING substr(const UNIVERSAL_CHARSTRING_template& value, | |
325 | const INTEGER& index, int returncount); | |
326 | extern UNIVERSAL_CHARSTRING substr(const UNIVERSAL_CHARSTRING_template& value, | |
327 | const INTEGER& index, const INTEGER& returncount); | |
328 | ||
329 | // C.35 - replace | |
330 | extern void check_replace_arguments(int value_length, int index, int len, | |
331 | const char *string_type, const char *element_name); | |
332 | extern BITSTRING replace(const BITSTRING& value, int index, int len, | |
333 | const BITSTRING& repl); | |
334 | extern BITSTRING replace(const BITSTRING& value, int index, | |
335 | const INTEGER& len, const BITSTRING& repl); | |
336 | extern BITSTRING replace(const BITSTRING& value, const INTEGER& index, | |
337 | int len, const BITSTRING& repl); | |
338 | extern BITSTRING replace(const BITSTRING& value, const INTEGER& index, | |
339 | const INTEGER& len, const BITSTRING& repl); | |
340 | ||
341 | extern HEXSTRING replace(const HEXSTRING& value, int index, int len, | |
342 | const HEXSTRING& repl); | |
343 | extern HEXSTRING replace(const HEXSTRING& value, int index, | |
344 | const INTEGER& len, const HEXSTRING& repl); | |
345 | extern HEXSTRING replace(const HEXSTRING& value, const INTEGER& index, | |
346 | int len, const HEXSTRING& repl); | |
347 | extern HEXSTRING replace(const HEXSTRING& value, const INTEGER& index, | |
348 | const INTEGER& len, const HEXSTRING& repl); | |
349 | ||
350 | extern OCTETSTRING replace(const OCTETSTRING& value, int index, int len, | |
351 | const OCTETSTRING& repl); | |
352 | extern OCTETSTRING replace(const OCTETSTRING& value, int index, | |
353 | const INTEGER& len, const OCTETSTRING& repl); | |
354 | extern OCTETSTRING replace(const OCTETSTRING& value, const INTEGER& index, | |
355 | int len, const OCTETSTRING& repl); | |
356 | extern OCTETSTRING replace(const OCTETSTRING& value, const INTEGER& index, | |
357 | const INTEGER& len, const OCTETSTRING& repl); | |
358 | ||
359 | extern CHARSTRING replace(const CHARSTRING& value, int index, int len, | |
360 | const CHARSTRING& repl); | |
361 | extern CHARSTRING replace(const CHARSTRING& value, int index, | |
362 | const INTEGER& len, const CHARSTRING& repl); | |
363 | extern CHARSTRING replace(const CHARSTRING& value, const INTEGER& index, | |
364 | int len, const CHARSTRING& repl); | |
365 | extern CHARSTRING replace(const CHARSTRING& value, const INTEGER& index, | |
366 | const INTEGER& len, const CHARSTRING& repl); | |
367 | ||
368 | extern UNIVERSAL_CHARSTRING replace(const UNIVERSAL_CHARSTRING& value, | |
369 | int index, int len, const UNIVERSAL_CHARSTRING& repl); | |
370 | extern UNIVERSAL_CHARSTRING replace(const UNIVERSAL_CHARSTRING& value, | |
371 | int index, const INTEGER& len, const UNIVERSAL_CHARSTRING& repl); | |
372 | extern UNIVERSAL_CHARSTRING replace(const UNIVERSAL_CHARSTRING& value, | |
373 | const INTEGER& index, int len, const UNIVERSAL_CHARSTRING& repl); | |
374 | extern UNIVERSAL_CHARSTRING replace(const UNIVERSAL_CHARSTRING& value, | |
375 | const INTEGER& index, const INTEGER& len, | |
376 | const UNIVERSAL_CHARSTRING& repl); | |
377 | // replace - template parameters | |
378 | extern BITSTRING replace(const BITSTRING_template& value, int index, int len, | |
379 | const BITSTRING_template& repl); | |
380 | extern BITSTRING replace(const BITSTRING_template& value, int index, | |
381 | const INTEGER& len, const BITSTRING_template& repl); | |
382 | extern BITSTRING replace(const BITSTRING_template& value, const INTEGER& index, | |
383 | int len, const BITSTRING_template& repl); | |
384 | extern BITSTRING replace(const BITSTRING_template& value, const INTEGER& index, | |
385 | const INTEGER& len, const BITSTRING_template& repl); | |
386 | ||
387 | extern HEXSTRING replace(const HEXSTRING_template& value, int index, int len, | |
388 | const HEXSTRING_template& repl); | |
389 | extern HEXSTRING replace(const HEXSTRING_template& value, int index, | |
390 | const INTEGER& len, const HEXSTRING_template& repl); | |
391 | extern HEXSTRING replace(const HEXSTRING_template& value, const INTEGER& index, | |
392 | int len, const HEXSTRING_template& repl); | |
393 | extern HEXSTRING replace(const HEXSTRING_template& value, const INTEGER& index, | |
394 | const INTEGER& len, const HEXSTRING_template& repl); | |
395 | ||
396 | extern OCTETSTRING replace(const OCTETSTRING_template& value, int index, int len, | |
397 | const OCTETSTRING& repl); | |
398 | extern OCTETSTRING replace(const OCTETSTRING_template& value, int index, | |
399 | const INTEGER& len, const OCTETSTRING& repl); | |
400 | extern OCTETSTRING replace(const OCTETSTRING_template& value, const INTEGER& index, | |
401 | int len, const OCTETSTRING_template& repl); | |
402 | extern OCTETSTRING replace(const OCTETSTRING_template& value, const INTEGER& index, | |
403 | const INTEGER& len, const OCTETSTRING_template& repl); | |
404 | ||
405 | extern CHARSTRING replace(const CHARSTRING_template& value, int index, int len, | |
406 | const CHARSTRING_template& repl); | |
407 | extern CHARSTRING replace(const CHARSTRING_template& value, int index, | |
408 | const INTEGER& len, const CHARSTRING_template& repl); | |
409 | extern CHARSTRING replace(const CHARSTRING_template& value, const INTEGER& index, | |
410 | int len, const CHARSTRING_template& repl); | |
411 | extern CHARSTRING replace(const CHARSTRING_template& value, const INTEGER& index, | |
412 | const INTEGER& len, const CHARSTRING_template& repl); | |
413 | ||
414 | extern UNIVERSAL_CHARSTRING replace(const UNIVERSAL_CHARSTRING_template& value, | |
415 | int index, int len, const UNIVERSAL_CHARSTRING_template& repl); | |
416 | extern UNIVERSAL_CHARSTRING replace(const UNIVERSAL_CHARSTRING_template& value, | |
417 | int index, const INTEGER& len, const UNIVERSAL_CHARSTRING_template& repl); | |
418 | extern UNIVERSAL_CHARSTRING replace(const UNIVERSAL_CHARSTRING_template& value, | |
419 | const INTEGER& index, int len, const UNIVERSAL_CHARSTRING_template& repl); | |
420 | extern UNIVERSAL_CHARSTRING replace(const UNIVERSAL_CHARSTRING_template& value, | |
421 | const INTEGER& index, const INTEGER& len, | |
422 | const UNIVERSAL_CHARSTRING_template& repl); | |
423 | ||
424 | ||
425 | // C.36 - rnd | |
426 | extern double rnd(); | |
427 | extern double rnd(double seed); | |
428 | extern double rnd(const FLOAT& seed); | |
429 | ||
430 | ||
431 | // Additional predefined functions defined in Annex B of ES 101 873-7 | |
432 | ||
433 | // B.1 decomp - not implemented yet | |
434 | ||
435 | ||
436 | // Non-standard functions | |
437 | ||
438 | // str2bit | |
439 | extern BITSTRING str2bit(const char *value); | |
440 | extern BITSTRING str2bit(const CHARSTRING& value); | |
441 | extern BITSTRING str2bit(const CHARSTRING_ELEMENT& value); | |
442 | ||
443 | // str2hex | |
444 | extern HEXSTRING str2hex(const char *value); | |
445 | extern HEXSTRING str2hex(const CHARSTRING& value); | |
446 | extern HEXSTRING str2hex(const CHARSTRING_ELEMENT& value); | |
447 | ||
448 | // float2str | |
449 | extern CHARSTRING float2str(double value); | |
450 | extern CHARSTRING float2str(const FLOAT& value); | |
451 | ||
452 | // unichar2char | |
453 | extern CHARSTRING unichar2char(const UNIVERSAL_CHARSTRING& value); | |
454 | extern CHARSTRING unichar2char(const UNIVERSAL_CHARSTRING_ELEMENT& value); | |
455 | ||
456 | // only for internal purposes | |
457 | extern CHARSTRING get_port_name(const char *port_name, int array_index); | |
458 | extern CHARSTRING get_port_name(const char *port_name, | |
459 | const INTEGER& array_index); | |
460 | extern CHARSTRING get_port_name(const CHARSTRING& port_name, int array_index); | |
461 | extern CHARSTRING get_port_name(const CHARSTRING& port_name, | |
462 | const INTEGER& array_index); | |
463 | ||
464 | unsigned char char_to_hexdigit(char c); | |
465 | ||
466 | // unichar2oct | |
467 | extern OCTETSTRING unichar2oct(const UNIVERSAL_CHARSTRING& invalue); // default string_encoding UTF-8 | |
468 | extern OCTETSTRING unichar2oct(const UNIVERSAL_CHARSTRING& invalue, | |
469 | const CHARSTRING& string_encoding); | |
470 | //oct2unichar | |
471 | extern UNIVERSAL_CHARSTRING oct2unichar(const OCTETSTRING& invalue ); // default string_encoding UTF-8 | |
472 | extern UNIVERSAL_CHARSTRING oct2unichar(const OCTETSTRING& invalue, | |
473 | const CHARSTRING& string_encoding); | |
474 | ||
475 | extern CHARSTRING get_stringencoding(const OCTETSTRING& encoded__value); | |
476 | extern OCTETSTRING remove_bom(const OCTETSTRING& encoded__value); | |
477 | extern CHARSTRING encode_base64(const OCTETSTRING& msg, bool use_linebreaks); | |
478 | extern CHARSTRING encode_base64(const OCTETSTRING& msg); | |
479 | extern OCTETSTRING decode_base64(const CHARSTRING& b64); | |
480 | ||
481 | #endif |