Daily bump.
[official-gcc.git] / gcc / ada / libgnat / s-ststop.adb
blob11c60fa4853e07433340efb34760342dd0b8cd6f
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
4 -- --
5 -- S Y S T E M . S T R I N G S . S T R E A M _ O P S --
6 -- --
7 -- B o d y --
8 -- --
9 -- Copyright (C) 2008-2024, Free Software Foundation, Inc. --
10 -- --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. --
17 -- --
18 -- As a special exception under Section 7 of GPL version 3, you are granted --
19 -- additional permissions described in the GCC Runtime Library Exception, --
20 -- version 3.1, as published by the Free Software Foundation. --
21 -- --
22 -- You should have received a copy of the GNU General Public License and --
23 -- a copy of the GCC Runtime Library Exception along with this program; --
24 -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
25 -- <http://www.gnu.org/licenses/>. --
26 -- --
27 -- GNAT was originally developed by the GNAT team at New York University. --
28 -- Extensive contributions were provided by Ada Core Technologies Inc. --
29 -- --
30 ------------------------------------------------------------------------------
32 with Ada.IO_Exceptions; use Ada.IO_Exceptions;
33 with Ada.Streams; use Ada.Streams;
34 with Ada.Unchecked_Conversion;
36 with System.Storage_Elements; use System.Storage_Elements;
37 with System.Stream_Attributes;
39 package body System.Strings.Stream_Ops is
41 -- The following type describes the low-level IO mechanism used in package
42 -- Stream_Ops_Internal.
44 type IO_Kind is (Byte_IO, Block_IO);
46 -- The following package provides an IO framework for strings. Depending
47 -- on the version of System.Stream_Attributes as well as the size of
48 -- formal parameter Element_Type, the package will either utilize block
49 -- IO or element-by-element IO.
51 generic
52 type Element_Type is private;
53 type Index_Type is range <>;
54 type Array_Type is array (Index_Type range <>) of Element_Type;
56 package Stream_Ops_Internal is
57 function Input
58 (Strm : access Root_Stream_Type'Class;
59 IO : IO_Kind;
60 Max_Length : Long_Integer := Long_Integer'Last) return Array_Type;
61 -- Raises an exception if you try to read a String that is longer than
62 -- Max_Length. See expansion of Attribute_Input in Exp_Attr for details.
64 procedure Output
65 (Strm : access Root_Stream_Type'Class;
66 Item : Array_Type;
67 IO : IO_Kind);
69 procedure Read
70 (Strm : access Root_Stream_Type'Class;
71 Item : out Array_Type;
72 IO : IO_Kind);
74 procedure Write
75 (Strm : access Root_Stream_Type'Class;
76 Item : Array_Type;
77 IO : IO_Kind);
78 end Stream_Ops_Internal;
80 -------------------------
81 -- Stream_Ops_Internal --
82 -------------------------
84 package body Stream_Ops_Internal is
86 -- The following value represents the number of BITS allocated for the
87 -- default block used in string IO. The sizes of all other types are
88 -- calculated relative to this value.
90 Default_Block_Size : constant := 512 * 8;
92 -- Shorthand notation for stream element and element type sizes
94 ET_Size : constant Integer := Element_Type'Size;
95 SE_Size : constant Integer := Stream_Element'Size;
97 -- The following constants describe the number of array elements or
98 -- stream elements that can fit into a default block.
100 AE_In_Default_Block : constant Index_Type :=
101 Index_Type (Default_Block_Size / ET_Size);
102 -- Number of array elements in a default block
104 SE_In_Default_Block : constant Integer := Default_Block_Size / SE_Size;
105 -- Number of storage elements in a default block
107 -- Buffer types
109 subtype Default_Block is Stream_Element_Array
110 (1 .. Stream_Element_Offset (SE_In_Default_Block));
112 subtype Array_Block is
113 Array_Type (Index_Type range 1 .. AE_In_Default_Block);
115 -- Conversions to and from Default_Block
117 function To_Default_Block is
118 new Ada.Unchecked_Conversion (Array_Block, Default_Block);
120 function To_Array_Block is
121 new Ada.Unchecked_Conversion (Default_Block, Array_Block);
123 -----------
124 -- Input --
125 -----------
127 function Input
128 (Strm : access Root_Stream_Type'Class;
129 IO : IO_Kind;
130 Max_Length : Long_Integer := Long_Integer'Last) return Array_Type
132 pragma Unsuppress (All_Checks);
133 -- The above makes T'Class'Input robust in the case of bad data. The
134 -- declaration of Item below could raise Storage_Error if the length
135 -- is too big.
137 begin
138 if Strm = null then
139 raise Constraint_Error;
140 end if;
142 declare
143 Low, High : Index_Type'Base;
144 begin
145 -- Read the bounds of the string. Note that they could be out of
146 -- range of Index_Type in the case of empty arrays.
148 Index_Type'Read (Strm, Low);
149 Index_Type'Read (Strm, High);
151 if Long_Integer (High) - Long_Integer (Low) > Max_Length then
152 raise Constraint_Error;
153 end if;
155 -- Read the character content of the string
157 declare
158 Item : Array_Type (Low .. High);
159 begin
160 Read (Strm, Item, IO);
161 return Item;
162 end;
163 end;
164 end Input;
166 ------------
167 -- Output --
168 ------------
170 procedure Output
171 (Strm : access Root_Stream_Type'Class;
172 Item : Array_Type;
173 IO : IO_Kind)
175 begin
176 if Strm = null then
177 raise Constraint_Error;
178 end if;
180 -- Write the bounds of the string
182 Index_Type'Write (Strm, Item'First);
183 Index_Type'Write (Strm, Item'Last);
185 -- Write the character content of the string
187 Write (Strm, Item, IO);
188 end Output;
190 ----------
191 -- Read --
192 ----------
194 procedure Read
195 (Strm : access Root_Stream_Type'Class;
196 Item : out Array_Type;
197 IO : IO_Kind)
199 begin
200 if Strm = null then
201 raise Constraint_Error;
202 end if;
204 -- Nothing to do if the desired string is empty
206 if Item'Length = 0 then
207 return;
208 end if;
210 -- Block IO
212 if IO = Block_IO and then Stream_Attributes.Block_IO_OK then
213 declare
214 -- Determine the size in BITS of the block necessary to contain
215 -- the whole string.
216 -- Since we are dealing with strings indexed by natural, there
217 -- is no risk of overflow when using a Long_Long_Integer.
219 Block_Size : constant Long_Long_Integer :=
220 Item'Length * Long_Long_Integer (ET_Size);
222 -- Item can be larger than what the default block can store,
223 -- determine the number of whole writes necessary to output the
224 -- string.
226 Blocks : constant Natural :=
227 Natural (Block_Size / Long_Long_Integer (Default_Block_Size));
229 -- The size of Item may not be a multiple of the default block
230 -- size, determine the size of the remaining chunk.
232 Rem_Size : constant Natural :=
233 Natural
234 (Block_Size mod Long_Long_Integer (Default_Block_Size));
236 -- String indexes
238 Low : Index_Type := Item'First;
239 High : Index_Type := Low + AE_In_Default_Block - 1;
241 -- End of stream error detection
243 Last : Stream_Element_Offset := 0;
244 Sum : Stream_Element_Offset := 0;
246 begin
247 -- Step 1: If the string is too large, read in individual
248 -- chunks the size of the default block.
250 if Blocks > 0 then
251 declare
252 Block : Default_Block;
254 begin
255 for Counter in 1 .. Blocks loop
256 Read (Strm.all, Block, Last);
257 Item (Low .. High) := To_Array_Block (Block);
259 Low := High + 1;
260 High := Low + AE_In_Default_Block - 1;
261 Sum := Sum + Last;
262 Last := 0;
263 end loop;
264 end;
265 end if;
267 -- Step 2: Read in any remaining elements
269 if Rem_Size > 0 then
270 declare
271 subtype Rem_Block is Stream_Element_Array
272 (1 .. Stream_Element_Offset (Rem_Size / SE_Size));
274 subtype Rem_Array_Block is
275 Array_Type (Index_Type range
276 1 .. Index_Type (Rem_Size / ET_Size));
278 function To_Rem_Array_Block is new
279 Ada.Unchecked_Conversion (Rem_Block, Rem_Array_Block);
281 Block : Rem_Block;
283 begin
284 Read (Strm.all, Block, Last);
285 Item (Low .. Item'Last) := To_Rem_Array_Block (Block);
287 Sum := Sum + Last;
288 end;
289 end if;
291 -- Step 3: Potential error detection. The sum of all the
292 -- chunks is less than we initially wanted to read. In other
293 -- words, the stream does not contain enough elements to fully
294 -- populate Item.
296 if (Integer (Sum) * SE_Size) / ET_Size < Item'Length then
297 raise End_Error;
298 end if;
299 end;
301 -- Byte IO
303 else
304 declare
305 E : Element_Type;
306 begin
307 for Index in Item'First .. Item'Last loop
308 Element_Type'Read (Strm, E);
309 Item (Index) := E;
310 end loop;
311 end;
312 end if;
313 end Read;
315 -----------
316 -- Write --
317 -----------
319 procedure Write
320 (Strm : access Root_Stream_Type'Class;
321 Item : Array_Type;
322 IO : IO_Kind)
324 begin
325 if Strm = null then
326 raise Constraint_Error;
327 end if;
329 -- Nothing to do if the input string is empty
331 if Item'Length = 0 then
332 return;
333 end if;
335 -- Block IO
337 if IO = Block_IO and then Stream_Attributes.Block_IO_OK then
338 declare
339 -- Determine the size in BITS of the block necessary to contain
340 -- the whole string.
341 -- Since we are dealing with strings indexed by natural, there
342 -- is no risk of overflow when using a Long_Long_Integer.
344 Block_Size : constant Long_Long_Integer :=
345 Item'Length * Long_Long_Integer (ET_Size);
347 -- Item can be larger than what the default block can store,
348 -- determine the number of whole writes necessary to output the
349 -- string.
351 Blocks : constant Natural :=
352 Natural (Block_Size / Long_Long_Integer (Default_Block_Size));
354 -- The size of Item may not be a multiple of the default block
355 -- size, determine the size of the remaining chunk.
357 Rem_Size : constant Natural :=
358 Natural
359 (Block_Size mod Long_Long_Integer (Default_Block_Size));
361 -- String indexes
363 Low : Index_Type := Item'First;
364 High : Index_Type := Low + AE_In_Default_Block - 1;
366 begin
367 -- Step 1: If the string is too large, write out individual
368 -- chunks the size of the default block.
370 for Counter in 1 .. Blocks loop
371 Write (Strm.all, To_Default_Block (Item (Low .. High)));
372 Low := High + 1;
373 High := Low + AE_In_Default_Block - 1;
374 end loop;
376 -- Step 2: Write out any remaining elements
378 if Rem_Size > 0 then
379 declare
380 subtype Rem_Block is Stream_Element_Array
381 (1 .. Stream_Element_Offset (Rem_Size / SE_Size));
383 subtype Rem_Array_Block is
384 Array_Type (Index_Type range
385 1 .. Index_Type (Rem_Size / ET_Size));
387 function To_Rem_Block is new
388 Ada.Unchecked_Conversion (Rem_Array_Block, Rem_Block);
390 begin
391 Write (Strm.all, To_Rem_Block (Item (Low .. Item'Last)));
392 end;
393 end if;
394 end;
396 -- Byte IO
398 else
399 for Index in Item'First .. Item'Last loop
400 Element_Type'Write (Strm, Item (Index));
401 end loop;
402 end if;
403 end Write;
404 end Stream_Ops_Internal;
406 -- Specific instantiations for all Ada array types handled
408 package Storage_Array_Ops is
409 new Stream_Ops_Internal
410 (Element_Type => Storage_Element,
411 Index_Type => Storage_Offset,
412 Array_Type => Storage_Array);
414 package Stream_Element_Array_Ops is
415 new Stream_Ops_Internal
416 (Element_Type => Stream_Element,
417 Index_Type => Stream_Element_Offset,
418 Array_Type => Stream_Element_Array);
420 package String_Ops is
421 new Stream_Ops_Internal
422 (Element_Type => Character,
423 Index_Type => Positive,
424 Array_Type => String);
426 package Wide_String_Ops is
427 new Stream_Ops_Internal
428 (Element_Type => Wide_Character,
429 Index_Type => Positive,
430 Array_Type => Wide_String);
432 package Wide_Wide_String_Ops is
433 new Stream_Ops_Internal
434 (Element_Type => Wide_Wide_Character,
435 Index_Type => Positive,
436 Array_Type => Wide_Wide_String);
438 -------------------------
439 -- Storage_Array_Input --
440 -------------------------
442 function Storage_Array_Input
443 (Strm : access Ada.Streams.Root_Stream_Type'Class) return Storage_Array
445 begin
446 return Storage_Array_Ops.Input (Strm, Byte_IO);
447 end Storage_Array_Input;
449 --------------------------------
450 -- Storage_Array_Input_Blk_IO --
451 --------------------------------
453 function Storage_Array_Input_Blk_IO
454 (Strm : access Ada.Streams.Root_Stream_Type'Class) return Storage_Array
456 begin
457 return Storage_Array_Ops.Input (Strm, Block_IO);
458 end Storage_Array_Input_Blk_IO;
460 --------------------------
461 -- Storage_Array_Output --
462 --------------------------
464 procedure Storage_Array_Output
465 (Strm : access Ada.Streams.Root_Stream_Type'Class;
466 Item : Storage_Array)
468 begin
469 Storage_Array_Ops.Output (Strm, Item, Byte_IO);
470 end Storage_Array_Output;
472 ---------------------------------
473 -- Storage_Array_Output_Blk_IO --
474 ---------------------------------
476 procedure Storage_Array_Output_Blk_IO
477 (Strm : access Ada.Streams.Root_Stream_Type'Class;
478 Item : Storage_Array)
480 begin
481 Storage_Array_Ops.Output (Strm, Item, Block_IO);
482 end Storage_Array_Output_Blk_IO;
484 ------------------------
485 -- Storage_Array_Read --
486 ------------------------
488 procedure Storage_Array_Read
489 (Strm : access Ada.Streams.Root_Stream_Type'Class;
490 Item : out Storage_Array)
492 begin
493 Storage_Array_Ops.Read (Strm, Item, Byte_IO);
494 end Storage_Array_Read;
496 -------------------------------
497 -- Storage_Array_Read_Blk_IO --
498 -------------------------------
500 procedure Storage_Array_Read_Blk_IO
501 (Strm : access Ada.Streams.Root_Stream_Type'Class;
502 Item : out Storage_Array)
504 begin
505 Storage_Array_Ops.Read (Strm, Item, Block_IO);
506 end Storage_Array_Read_Blk_IO;
508 -------------------------
509 -- Storage_Array_Write --
510 -------------------------
512 procedure Storage_Array_Write
513 (Strm : access Ada.Streams.Root_Stream_Type'Class;
514 Item : Storage_Array)
516 begin
517 Storage_Array_Ops.Write (Strm, Item, Byte_IO);
518 end Storage_Array_Write;
520 --------------------------------
521 -- Storage_Array_Write_Blk_IO --
522 --------------------------------
524 procedure Storage_Array_Write_Blk_IO
525 (Strm : access Ada.Streams.Root_Stream_Type'Class;
526 Item : Storage_Array)
528 begin
529 Storage_Array_Ops.Write (Strm, Item, Block_IO);
530 end Storage_Array_Write_Blk_IO;
532 --------------------------------
533 -- Stream_Element_Array_Input --
534 --------------------------------
536 function Stream_Element_Array_Input
537 (Strm : access Ada.Streams.Root_Stream_Type'Class)
538 return Stream_Element_Array
540 begin
541 return Stream_Element_Array_Ops.Input (Strm, Byte_IO);
542 end Stream_Element_Array_Input;
544 ---------------------------------------
545 -- Stream_Element_Array_Input_Blk_IO --
546 ---------------------------------------
548 function Stream_Element_Array_Input_Blk_IO
549 (Strm : access Ada.Streams.Root_Stream_Type'Class)
550 return Stream_Element_Array
552 begin
553 return Stream_Element_Array_Ops.Input (Strm, Block_IO);
554 end Stream_Element_Array_Input_Blk_IO;
556 ---------------------------------
557 -- Stream_Element_Array_Output --
558 ---------------------------------
560 procedure Stream_Element_Array_Output
561 (Strm : access Ada.Streams.Root_Stream_Type'Class;
562 Item : Stream_Element_Array)
564 begin
565 Stream_Element_Array_Ops.Output (Strm, Item, Byte_IO);
566 end Stream_Element_Array_Output;
568 ----------------------------------------
569 -- Stream_Element_Array_Output_Blk_IO --
570 ----------------------------------------
572 procedure Stream_Element_Array_Output_Blk_IO
573 (Strm : access Ada.Streams.Root_Stream_Type'Class;
574 Item : Stream_Element_Array)
576 begin
577 Stream_Element_Array_Ops.Output (Strm, Item, Block_IO);
578 end Stream_Element_Array_Output_Blk_IO;
580 -------------------------------
581 -- Stream_Element_Array_Read --
582 -------------------------------
584 procedure Stream_Element_Array_Read
585 (Strm : access Ada.Streams.Root_Stream_Type'Class;
586 Item : out Stream_Element_Array)
588 begin
589 Stream_Element_Array_Ops.Read (Strm, Item, Byte_IO);
590 end Stream_Element_Array_Read;
592 --------------------------------------
593 -- Stream_Element_Array_Read_Blk_IO --
594 --------------------------------------
596 procedure Stream_Element_Array_Read_Blk_IO
597 (Strm : access Ada.Streams.Root_Stream_Type'Class;
598 Item : out Stream_Element_Array)
600 begin
601 Stream_Element_Array_Ops.Read (Strm, Item, Block_IO);
602 end Stream_Element_Array_Read_Blk_IO;
604 --------------------------------
605 -- Stream_Element_Array_Write --
606 --------------------------------
608 procedure Stream_Element_Array_Write
609 (Strm : access Ada.Streams.Root_Stream_Type'Class;
610 Item : Stream_Element_Array)
612 begin
613 Stream_Element_Array_Ops.Write (Strm, Item, Byte_IO);
614 end Stream_Element_Array_Write;
616 ---------------------------------------
617 -- Stream_Element_Array_Write_Blk_IO --
618 ---------------------------------------
620 procedure Stream_Element_Array_Write_Blk_IO
621 (Strm : access Ada.Streams.Root_Stream_Type'Class;
622 Item : Stream_Element_Array)
624 begin
625 Stream_Element_Array_Ops.Write (Strm, Item, Block_IO);
626 end Stream_Element_Array_Write_Blk_IO;
628 ------------------
629 -- String_Input --
630 ------------------
632 function String_Input
633 (Strm : access Ada.Streams.Root_Stream_Type'Class) return String
635 begin
636 return String_Ops.Input (Strm, Byte_IO);
637 end String_Input;
639 -------------------------
640 -- String_Input_Blk_IO --
641 -------------------------
643 function String_Input_Blk_IO
644 (Strm : access Ada.Streams.Root_Stream_Type'Class) return String
646 begin
647 return String_Ops.Input (Strm, Block_IO);
648 end String_Input_Blk_IO;
650 -------------------------
651 -- String_Input_Tag --
652 -------------------------
654 function String_Input_Tag
655 (Strm : access Ada.Streams.Root_Stream_Type'Class) return String
657 begin
658 return String_Ops.Input (Strm, Block_IO, Max_Length => 10_000);
659 end String_Input_Tag;
661 -------------------
662 -- String_Output --
663 -------------------
665 procedure String_Output
666 (Strm : access Ada.Streams.Root_Stream_Type'Class;
667 Item : String)
669 begin
670 String_Ops.Output (Strm, Item, Byte_IO);
671 end String_Output;
673 --------------------------
674 -- String_Output_Blk_IO --
675 --------------------------
677 procedure String_Output_Blk_IO
678 (Strm : access Ada.Streams.Root_Stream_Type'Class;
679 Item : String)
681 begin
682 String_Ops.Output (Strm, Item, Block_IO);
683 end String_Output_Blk_IO;
685 -----------------
686 -- String_Read --
687 -----------------
689 procedure String_Read
690 (Strm : access Ada.Streams.Root_Stream_Type'Class;
691 Item : out String)
693 begin
694 String_Ops.Read (Strm, Item, Byte_IO);
695 end String_Read;
697 ------------------------
698 -- String_Read_Blk_IO --
699 ------------------------
701 procedure String_Read_Blk_IO
702 (Strm : access Ada.Streams.Root_Stream_Type'Class;
703 Item : out String)
705 begin
706 String_Ops.Read (Strm, Item, Block_IO);
707 end String_Read_Blk_IO;
709 ------------------
710 -- String_Write --
711 ------------------
713 procedure String_Write
714 (Strm : access Ada.Streams.Root_Stream_Type'Class;
715 Item : String)
717 begin
718 String_Ops.Write (Strm, Item, Byte_IO);
719 end String_Write;
721 -------------------------
722 -- String_Write_Blk_IO --
723 -------------------------
725 procedure String_Write_Blk_IO
726 (Strm : access Ada.Streams.Root_Stream_Type'Class;
727 Item : String)
729 begin
730 String_Ops.Write (Strm, Item, Block_IO);
731 end String_Write_Blk_IO;
733 -----------------------
734 -- Wide_String_Input --
735 -----------------------
737 function Wide_String_Input
738 (Strm : access Ada.Streams.Root_Stream_Type'Class) return Wide_String
740 begin
741 return Wide_String_Ops.Input (Strm, Byte_IO);
742 end Wide_String_Input;
744 ------------------------------
745 -- Wide_String_Input_Blk_IO --
746 ------------------------------
748 function Wide_String_Input_Blk_IO
749 (Strm : access Ada.Streams.Root_Stream_Type'Class) return Wide_String
751 begin
752 return Wide_String_Ops.Input (Strm, Block_IO);
753 end Wide_String_Input_Blk_IO;
755 ------------------------
756 -- Wide_String_Output --
757 ------------------------
759 procedure Wide_String_Output
760 (Strm : access Ada.Streams.Root_Stream_Type'Class;
761 Item : Wide_String)
763 begin
764 Wide_String_Ops.Output (Strm, Item, Byte_IO);
765 end Wide_String_Output;
767 -------------------------------
768 -- Wide_String_Output_Blk_IO --
769 -------------------------------
771 procedure Wide_String_Output_Blk_IO
772 (Strm : access Ada.Streams.Root_Stream_Type'Class;
773 Item : Wide_String)
775 begin
776 Wide_String_Ops.Output (Strm, Item, Block_IO);
777 end Wide_String_Output_Blk_IO;
779 ----------------------
780 -- Wide_String_Read --
781 ----------------------
783 procedure Wide_String_Read
784 (Strm : access Ada.Streams.Root_Stream_Type'Class;
785 Item : out Wide_String)
787 begin
788 Wide_String_Ops.Read (Strm, Item, Byte_IO);
789 end Wide_String_Read;
791 -----------------------------
792 -- Wide_String_Read_Blk_IO --
793 -----------------------------
795 procedure Wide_String_Read_Blk_IO
796 (Strm : access Ada.Streams.Root_Stream_Type'Class;
797 Item : out Wide_String)
799 begin
800 Wide_String_Ops.Read (Strm, Item, Block_IO);
801 end Wide_String_Read_Blk_IO;
803 -----------------------
804 -- Wide_String_Write --
805 -----------------------
807 procedure Wide_String_Write
808 (Strm : access Ada.Streams.Root_Stream_Type'Class;
809 Item : Wide_String)
811 begin
812 Wide_String_Ops.Write (Strm, Item, Byte_IO);
813 end Wide_String_Write;
815 ------------------------------
816 -- Wide_String_Write_Blk_IO --
817 ------------------------------
819 procedure Wide_String_Write_Blk_IO
820 (Strm : access Ada.Streams.Root_Stream_Type'Class;
821 Item : Wide_String)
823 begin
824 Wide_String_Ops.Write (Strm, Item, Block_IO);
825 end Wide_String_Write_Blk_IO;
827 ----------------------------
828 -- Wide_Wide_String_Input --
829 ----------------------------
831 function Wide_Wide_String_Input
832 (Strm : access Ada.Streams.Root_Stream_Type'Class) return Wide_Wide_String
834 begin
835 return Wide_Wide_String_Ops.Input (Strm, Byte_IO);
836 end Wide_Wide_String_Input;
838 -----------------------------------
839 -- Wide_Wide_String_Input_Blk_IO --
840 -----------------------------------
842 function Wide_Wide_String_Input_Blk_IO
843 (Strm : access Ada.Streams.Root_Stream_Type'Class) return Wide_Wide_String
845 begin
846 return Wide_Wide_String_Ops.Input (Strm, Block_IO);
847 end Wide_Wide_String_Input_Blk_IO;
849 -----------------------------
850 -- Wide_Wide_String_Output --
851 -----------------------------
853 procedure Wide_Wide_String_Output
854 (Strm : access Ada.Streams.Root_Stream_Type'Class;
855 Item : Wide_Wide_String)
857 begin
858 Wide_Wide_String_Ops.Output (Strm, Item, Byte_IO);
859 end Wide_Wide_String_Output;
861 ------------------------------------
862 -- Wide_Wide_String_Output_Blk_IO --
863 ------------------------------------
865 procedure Wide_Wide_String_Output_Blk_IO
866 (Strm : access Ada.Streams.Root_Stream_Type'Class;
867 Item : Wide_Wide_String)
869 begin
870 Wide_Wide_String_Ops.Output (Strm, Item, Block_IO);
871 end Wide_Wide_String_Output_Blk_IO;
873 ---------------------------
874 -- Wide_Wide_String_Read --
875 ---------------------------
877 procedure Wide_Wide_String_Read
878 (Strm : access Ada.Streams.Root_Stream_Type'Class;
879 Item : out Wide_Wide_String)
881 begin
882 Wide_Wide_String_Ops.Read (Strm, Item, Byte_IO);
883 end Wide_Wide_String_Read;
885 ----------------------------------
886 -- Wide_Wide_String_Read_Blk_IO --
887 ----------------------------------
889 procedure Wide_Wide_String_Read_Blk_IO
890 (Strm : access Ada.Streams.Root_Stream_Type'Class;
891 Item : out Wide_Wide_String)
893 begin
894 Wide_Wide_String_Ops.Read (Strm, Item, Block_IO);
895 end Wide_Wide_String_Read_Blk_IO;
897 ----------------------------
898 -- Wide_Wide_String_Write --
899 ----------------------------
901 procedure Wide_Wide_String_Write
902 (Strm : access Ada.Streams.Root_Stream_Type'Class;
903 Item : Wide_Wide_String)
905 begin
906 Wide_Wide_String_Ops.Write (Strm, Item, Byte_IO);
907 end Wide_Wide_String_Write;
909 -----------------------------------
910 -- Wide_Wide_String_Write_Blk_IO --
911 -----------------------------------
913 procedure Wide_Wide_String_Write_Blk_IO
914 (Strm : access Ada.Streams.Root_Stream_Type'Class;
915 Item : Wide_Wide_String)
917 begin
918 Wide_Wide_String_Ops.Write (Strm, Item, Block_IO);
919 end Wide_Wide_String_Write_Blk_IO;
921 end System.Strings.Stream_Ops;