1---  This file is covered by the Internet Software Consortium (ISC) License
2--  Reference: ../../License.txt
3
4with AdaBase.Results.Generic_Converters;
5
6package AdaBase.Results.Converters is
7
8   package GEN renames AdaBase.Results.Generic_Converters;
9
10   -------------
11   -- NByte 0 --
12   -------------
13   function convert (nv : NByte0) return NByte1;
14   function convert (nv : NByte0) return NByte2;
15   function convert (nv : NByte0) return NByte3;
16   function convert (nv : NByte0) return NByte4;
17   function convert (nv : NByte0) return NByte8;
18   function convert (nv : NByte0) return Byte1;
19   function convert (nv : NByte0) return Byte2;
20   function convert (nv : NByte0) return Byte3;
21   function convert (nv : NByte0) return Byte4;
22   function convert (nv : NByte0) return Byte8;
23   function convert (nv : NByte0) return Real9;
24   function convert (nv : NByte0) return Real18;
25   function convert (nv : NByte0) return String;
26   function convert (nv : NByte0) return Wide_String;
27   function convert (nv : NByte0) return Wide_Wide_String;
28   function convert (nv : NByte0) return Bits;
29   function convert (nv : NByte0) return Chain;
30   function convert (nv : NByte0) return Textual;
31   function cv2utf8 (nv : NByte0) return Text_UTF8;
32
33
34   -------------
35   -- NByte 1 --
36   -------------
37   function convert (nv : NByte1) return NByte0;
38   function convert (nv : NByte1) return NByte2;
39   function convert (nv : NByte1) return NByte3;
40   function convert (nv : NByte1) return NByte4;
41   function convert (nv : NByte1) return NByte8;
42   function convert (nv : NByte1) return Byte1;
43   function convert (nv : NByte1) return Byte2;
44   function convert (nv : NByte1) return Byte3;
45   function convert (nv : NByte1) return Byte4;
46   function convert (nv : NByte1) return Byte8;
47   function convert (nv : NByte1) return Real9;
48   function convert (nv : NByte1) return Real18;
49   function cv2utf8 is new GEN.convert2utf8 (IntType => NByte1);
50   function convert is new GEN.convert2str1 (IntType => NByte1);
51   function convert is new GEN.convert2str2 (IntType => NByte1);
52   function convert is new GEN.convert2str3 (IntType => NByte1);
53   function convert is new GEN.convert2bits (ModType => NByte1, width => 7);
54   function convert is new GEN.convert2chain (ModType => NByte1, width => 1);
55   function convert (nv : NByte1) return Textual;
56
57
58   -------------
59   -- NByte 2 --
60   -------------
61   function convert (nv : NByte2) return NByte0;
62   function convert (nv : NByte2) return NByte1;
63   function convert (nv : NByte2) return NByte3;
64   function convert (nv : NByte2) return NByte4;
65   function convert (nv : NByte2) return NByte8;
66   function convert (nv : NByte2) return Byte1;
67   function convert (nv : NByte2) return Byte2;
68   function convert (nv : NByte2) return Byte3;
69   function convert (nv : NByte2) return Byte4;
70   function convert (nv : NByte2) return Byte8;
71   function convert (nv : NByte2) return Real9;
72   function convert (nv : NByte2) return Real18;
73   function cv2utf8 is new GEN.convert2utf8 (IntType => NByte2);
74   function convert is new GEN.convert2str1 (IntType => NByte2);
75   function convert is new GEN.convert2str2 (IntType => NByte2);
76   function convert is new GEN.convert2str3 (IntType => NByte2);
77   function convert is new GEN.convert2bits (ModType => NByte2, width => 15);
78   function convert is new GEN.convert2chain (ModType => NByte2, width => 2);
79   function convert (nv : NByte2) return Textual;
80
81
82   -------------
83   -- NByte 3 --
84   -------------
85   function convert (nv : NByte3) return NByte0;
86   function convert (nv : NByte3) return NByte1;
87   function convert (nv : NByte3) return NByte2;
88   function convert (nv : NByte3) return NByte4;
89   function convert (nv : NByte3) return NByte8;
90   function convert (nv : NByte3) return Byte1;
91   function convert (nv : NByte3) return Byte2;
92   function convert (nv : NByte3) return Byte3;
93   function convert (nv : NByte3) return Byte4;
94   function convert (nv : NByte3) return Byte8;
95   function convert (nv : NByte3) return Real9;
96   function convert (nv : NByte3) return Real18;
97   function cv2utf8 is new GEN.convert2utf8 (IntType => NByte3);
98   function convert is new GEN.convert2str1 (IntType => NByte3);
99   function convert is new GEN.convert2str2 (IntType => NByte3);
100   function convert is new GEN.convert2str3 (IntType => NByte3);
101   function convert is new GEN.convert2bits (ModType => NByte3, width => 23);
102   function convert is new GEN.convert2chain (ModType => NByte3, width => 3);
103   function convert (nv : NByte3) return Textual;
104
105
106   -------------
107   -- NByte 4 --
108   -------------
109   function convert (nv : NByte4) return NByte0;
110   function convert (nv : NByte4) return NByte1;
111   function convert (nv : NByte4) return NByte2;
112   function convert (nv : NByte4) return NByte3;
113   function convert (nv : NByte4) return NByte8;
114   function convert (nv : NByte4) return Byte1;
115   function convert (nv : NByte4) return Byte2;
116   function convert (nv : NByte4) return Byte3;
117   function convert (nv : NByte4) return Byte4;
118   function convert (nv : NByte4) return Byte8;
119   function convert (nv : NByte4) return Real9;
120   function convert (nv : NByte4) return Real18;
121   function cv2utf8 is new GEN.convert2utf8 (IntType => NByte4);
122   function convert is new GEN.convert2str1 (IntType => NByte4);
123   function convert is new GEN.convert2str2 (IntType => NByte4);
124   function convert is new GEN.convert2str3 (IntType => NByte4);
125   function convert is new GEN.convert2bits (ModType => NByte4, width => 31);
126   function convert is new GEN.convert2chain (ModType => NByte4, width => 4);
127   function convert (nv : NByte4) return Textual;
128
129
130   -------------
131   -- NByte 8 --
132   -------------
133   function convert (nv : NByte8) return NByte0;
134   function convert (nv : NByte8) return NByte1;
135   function convert (nv : NByte8) return NByte2;
136   function convert (nv : NByte8) return NByte3;
137   function convert (nv : NByte8) return NByte4;
138   function convert (nv : NByte8) return Byte1;
139   function convert (nv : NByte8) return Byte2;
140   function convert (nv : NByte8) return Byte3;
141   function convert (nv : NByte8) return Byte4;
142   function convert (nv : NByte8) return Byte8;
143   function convert (nv : NByte8) return Real9;
144   function convert (nv : NByte8) return Real18;
145   function cv2utf8 is new GEN.convert2utf8 (IntType => NByte8);
146   function convert is new GEN.convert2str1 (IntType => NByte8);
147   function convert is new GEN.convert2str2 (IntType => NByte8);
148   function convert is new GEN.convert2str3 (IntType => NByte8);
149   function convert is new GEN.convert2bits (ModType => NByte8, width => 63);
150   function convert is new GEN.convert2chain (ModType => NByte8, width => 8);
151   function convert (nv : NByte8) return Textual;
152
153
154   ------------
155   -- Byte 1 --
156   ------------
157   function convert (nv : Byte1) return NByte0;
158   function convert (nv : Byte1) return NByte1;
159   function convert (nv : Byte1) return NByte2;
160   function convert (nv : Byte1) return NByte3;
161   function convert (nv : Byte1) return NByte4;
162   function convert (nv : Byte1) return NByte8;
163   function convert (nv : Byte1) return Byte2;
164   function convert (nv : Byte1) return Byte3;
165   function convert (nv : Byte1) return Byte4;
166   function convert (nv : Byte1) return Byte8;
167   function convert (nv : Byte1) return Real9;
168   function convert (nv : Byte1) return Real18;
169   function cv2utf8 is new GEN.convert2utf8 (IntType => Byte1);
170   function convert is new GEN.convert2str1 (IntType => Byte1);
171   function convert is new GEN.convert2str2 (IntType => Byte1);
172   function convert is new GEN.convert2str3 (IntType => Byte1);
173   function convert (nv : Byte1) return Textual;
174
175
176   -----------
177   -- Byte2 --
178   -----------
179   function convert (nv : Byte2) return NByte0;
180   function convert (nv : Byte2) return NByte1;
181   function convert (nv : Byte2) return NByte2;
182   function convert (nv : Byte2) return NByte3;
183   function convert (nv : Byte2) return NByte4;
184   function convert (nv : Byte2) return NByte8;
185   function convert (nv : Byte2) return Byte1;
186   function convert (nv : Byte2) return Byte3;
187   function convert (nv : Byte2) return Byte4;
188   function convert (nv : Byte2) return Byte8;
189   function convert (nv : Byte2) return Real9;
190   function convert (nv : Byte2) return Real18;
191   function cv2utf8 is new GEN.convert2utf8 (IntType => Byte2);
192   function convert is new GEN.convert2str1 (IntType => Byte2);
193   function convert is new GEN.convert2str2 (IntType => Byte2);
194   function convert is new GEN.convert2str3 (IntType => Byte2);
195   function convert (nv : Byte2) return Textual;
196
197
198   -----------
199   -- Byte3 --
200   -----------
201   function convert (nv : Byte3) return NByte0;
202   function convert (nv : Byte3) return NByte1;
203   function convert (nv : Byte3) return NByte2;
204   function convert (nv : Byte3) return NByte3;
205   function convert (nv : Byte3) return NByte4;
206   function convert (nv : Byte3) return NByte8;
207   function convert (nv : Byte3) return Byte1;
208   function convert (nv : Byte3) return Byte2;
209   function convert (nv : Byte3) return Byte4;
210   function convert (nv : Byte3) return Byte8;
211   function convert (nv : Byte3) return Real9;
212   function convert (nv : Byte3) return Real18;
213   function cv2utf8 is new GEN.convert2utf8 (IntType => Byte3);
214   function convert is new GEN.convert2str1 (IntType => Byte3);
215   function convert is new GEN.convert2str2 (IntType => Byte3);
216   function convert is new GEN.convert2str3 (IntType => Byte3);
217   function convert (nv : Byte3) return Textual;
218
219
220   -----------
221   -- Byte4 --
222   -----------
223   function convert (nv : Byte4) return NByte0;
224   function convert (nv : Byte4) return NByte1;
225   function convert (nv : Byte4) return NByte2;
226   function convert (nv : Byte4) return NByte3;
227   function convert (nv : Byte4) return NByte4;
228   function convert (nv : Byte4) return NByte8;
229   function convert (nv : Byte4) return Byte1;
230   function convert (nv : Byte4) return Byte2;
231   function convert (nv : Byte4) return Byte3;
232   function convert (nv : Byte4) return Byte8;
233   function convert (nv : Byte4) return Real9;
234   function convert (nv : Byte4) return Real18;
235   function cv2utf8 is new GEN.convert2utf8 (IntType => Byte4);
236   function convert is new GEN.convert2str1 (IntType => Byte4);
237   function convert is new GEN.convert2str2 (IntType => Byte4);
238   function convert is new GEN.convert2str3 (IntType => Byte4);
239   function convert (nv : Byte4) return Textual;
240
241
242   -----------
243   -- Byte8 --
244   -----------
245   function convert (nv : Byte8) return NByte0;
246   function convert (nv : Byte8) return NByte1;
247   function convert (nv : Byte8) return NByte2;
248   function convert (nv : Byte8) return NByte3;
249   function convert (nv : Byte8) return NByte4;
250   function convert (nv : Byte8) return NByte8;
251   function convert (nv : Byte8) return Byte1;
252   function convert (nv : Byte8) return Byte2;
253   function convert (nv : Byte8) return Byte3;
254   function convert (nv : Byte8) return Byte4;
255   function convert (nv : Byte8) return Real9;
256   function convert (nv : Byte8) return Real18;
257   function cv2utf8 is new GEN.convert2utf8 (IntType => Byte8);
258   function convert is new GEN.convert2str1 (IntType => Byte8);
259   function convert is new GEN.convert2str2 (IntType => Byte8);
260   function convert is new GEN.convert2str3 (IntType => Byte8);
261   function convert (nv : Byte8) return Textual;
262
263
264   -----------
265   -- Real9 --
266   -----------
267   function convert (nv : Real9) return Real18;
268   function cv2utf8 is new GEN.convert3utf8 (RealType => Real9);
269   function convert is new GEN.convert3str1 (RealType => Real9);
270   function convert is new GEN.convert3str2 (RealType => Real9);
271   function convert is new GEN.convert3str3 (RealType => Real9);
272   function convert (nv : Real9) return Textual;
273
274
275   ------------
276   -- Real18 --
277   ------------
278   function convert (nv : Real18) return Real9;
279   function cv2utf8 is new GEN.convert3utf8 (RealType => Real18);
280   function convert is new GEN.convert3str1 (RealType => Real18);
281   function convert is new GEN.convert3str2 (RealType => Real18);
282   function convert is new GEN.convert3str3 (RealType => Real18);
283   function convert (nv : Real18) return Textual;
284
285
286   ------------
287   -- String --
288   ------------
289   function convert (nv : Textual) return NByte0;
290   function convert is new GEN.convertstr (IntType => NByte1);
291   function convert is new GEN.convertstr (IntType => NByte2);
292   function convert is new GEN.convertstr (IntType => NByte3);
293   function convert is new GEN.convertstr (IntType => NByte4);
294   function convert is new GEN.convertstr (IntType => NByte8);
295   function convert is new GEN.convertstr (IntType => Byte1);
296   function convert is new GEN.convertstr (IntType => Byte2);
297   function convert is new GEN.convertstr (IntType => Byte3);
298   function convert is new GEN.convertstr (IntType => Byte4);
299   function convert is new GEN.convertstr (IntType => Byte8);
300   function convert is new GEN.convertst2 (RealType => Real9);
301   function convert is new GEN.convertst2 (RealType => Real18);
302   function cv2utf8 (nv : Textual) return Text_UTF8;
303   function convert (nv : Textual) return String;
304   function convert (nv : Textual) return Wide_String;
305   function convert (nv : Textual) return Wide_Wide_String;
306   function convert (nv : Textual) return AC.Time;
307   function convert (nv : Textual) return Chain;
308   function convert (nv : Textual) return Enumtype;
309   function convert (nv : Textual) return Settype;
310   function convert (nv : Textual) return Bits;
311   function convert (nv : String) return AC.Time;
312   function convert (nv : String) return Enumtype;
313   function convert (nv : String; fixed : Natural := 0) return Chain;
314   function convert (nv : String; fixed : Natural := 0) return Settype;
315   function convert (nv : String; fixed : Natural := 0) return Bits;
316   function convert (nv : String) return Wide_String;
317   function convert (nv : String) return Wide_Wide_String;
318   function cv2utf8 (nv : String) return Text_UTF8;
319   function cvu2str (nv : Textual) return Textual;
320   function cvu2str (nv : Text_UTF8) return String;
321   function cvu2str (nv : Text_UTF8) return Wide_String;
322   function cvu2str (nv : Text_UTF8) return Wide_Wide_String;
323
324
325   -----------------
326   -- Wide_String --
327   -----------------
328   function convert (nv : Textwide) return NByte0;
329   function convert is new GEN.convertst3 (IntType => NByte1);
330   function convert is new GEN.convertst3 (IntType => NByte2);
331   function convert is new GEN.convertst3 (IntType => NByte3);
332   function convert is new GEN.convertst3 (IntType => NByte4);
333   function convert is new GEN.convertst3 (IntType => NByte8);
334   function convert is new GEN.convertst3 (IntType => Byte1);
335   function convert is new GEN.convertst3 (IntType => Byte2);
336   function convert is new GEN.convertst3 (IntType => Byte3);
337   function convert is new GEN.convertst3 (IntType => Byte4);
338   function convert is new GEN.convertst3 (IntType => Byte8);
339   function convert is new GEN.convertst4 (RealType => Real9);
340   function convert is new GEN.convertst4 (RealType => Real18);
341   function convert (nv : Textwide) return String;
342   function convert (nv : Textwide) return Wide_String;
343   function convert (nv : Textwide) return Wide_Wide_String;
344   function convert (nv : Textwide) return AC.Time;
345   function convert (nv : Textwide) return Chain;
346   function convert (nv : Textwide) return Enumtype;
347   function convert (nv : Textwide) return Settype;
348   function convert (nv : Textwide) return Textual;
349   function convert (nv : Textwide) return Bits;
350   function cv2utf8 (nv : Textwide) return Text_UTF8;
351
352
353   ----------------------
354   -- Wide_Wide_String --
355   ----------------------
356   function convert (nv : Textsuper) return NByte0;
357   function convert is new GEN.convertst5 (IntType => NByte1);
358   function convert is new GEN.convertst5 (IntType => NByte2);
359   function convert is new GEN.convertst5 (IntType => NByte3);
360   function convert is new GEN.convertst5 (IntType => NByte4);
361   function convert is new GEN.convertst5 (IntType => NByte8);
362   function convert is new GEN.convertst5 (IntType => Byte1);
363   function convert is new GEN.convertst5 (IntType => Byte2);
364   function convert is new GEN.convertst5 (IntType => Byte3);
365   function convert is new GEN.convertst5 (IntType => Byte4);
366   function convert is new GEN.convertst5 (IntType => Byte8);
367   function convert is new GEN.convertst6 (RealType => Real9);
368   function convert is new GEN.convertst6 (RealType => Real18);
369   function convert (nv : Textsuper) return String;
370   function convert (nv : Textsuper) return Wide_String;
371   function convert (nv : Textsuper) return Wide_Wide_String;
372   function convert (nv : Textsuper) return AC.Time;
373   function convert (nv : Textsuper) return Chain;
374   function convert (nv : Textsuper) return Enumtype;
375   function convert (nv : Textsuper) return Settype;
376   function convert (nv : Textsuper) return Textual;
377   function convert (nv : Textsuper) return Bits;
378   function cv2utf8 (nv : Textsuper) return Text_UTF8;
379
380
381   ----------
382   -- TIME --
383   ----------
384   function convert (nv : AC.Time) return String;
385   function convert (nv : AC.Time) return Wide_String;
386   function convert (nv : AC.Time) return Wide_Wide_String;
387   function convert (nv : AC.Time) return Textual;
388   function cv2utf8 (nv : AC.Time) return Text_UTF8;
389
390
391   -----------------
392   -- ENUMERATION --
393   -----------------
394   function convert (nv : Enumtype) return String;
395   function convert (nv : Enumtype) return Wide_String;
396   function convert (nv : Enumtype) return Wide_Wide_String;
397   function convert (nv : Enumtype) return Textual;
398   function cv2utf8 (nv : Enumtype) return Text_UTF8;
399
400
401   ----------------
402   -- BITS TYPE  --
403   ----------------
404   function convert (nv : Bits) return NByte0;
405   function convert is new GEN.convert_bits (ModType => NByte1, MSB => 7);
406   function convert is new GEN.convert_bits (ModType => NByte2, MSB => 15);
407   function convert is new GEN.convert_bits (ModType => NByte3, MSB => 23);
408   function convert is new GEN.convert_bits (ModType => NByte4, MSB => 31);
409   function convert is new GEN.convert_bits (ModType => NByte8, MSB => 63);
410   function convert (nv : Bits) return String;
411   function convert (nv : Bits) return Wide_String;
412   function convert (nv : Bits) return Wide_Wide_String;
413   function convert (nv : Bits) return Textual;
414   function convert (nv : Bits) return Chain;
415
416
417   ------------------------
418   --  CHAIN (OF BYTES)  --
419   ------------------------
420   function convert (nv : Chain) return NByte0;
421   function convert is new GEN.convert_chain (ModType => NByte1, width => 1);
422   function convert is new GEN.convert_chain (ModType => NByte2, width => 2);
423   function convert is new GEN.convert_chain (ModType => NByte3, width => 3);
424   function convert is new GEN.convert_chain (ModType => NByte4, width => 4);
425   function convert is new GEN.convert_chain (ModType => NByte8, width => 8);
426   function convert (nv : Chain) return String;
427   function convert (nv : Chain) return Wide_String;
428   function convert (nv : Chain) return Wide_Wide_String;
429   function convert (nv : Chain) return Textual;
430   function convert (nv : Chain) return Bits;
431
432
433   ---------------
434   -- SET TYPE  --
435   ---------------
436   function convert (nv : Settype) return String;
437   function convert (nv : Settype) return Wide_String;
438   function convert (nv : Settype) return Wide_Wide_String;
439   function convert (nv : Settype) return Textual;
440   function cv2utf8 (nv : Settype) return Text_UTF8;
441
442
443end AdaBase.Results.Converters;
444