redefined Object_String for simpler string handling and made other related changes
This commit is contained in:
@ -3,49 +3,39 @@ with Ada.Wide_Text_IO;
|
||||
|
||||
package Stream is
|
||||
|
||||
--package S renames H2.Scheme;
|
||||
package S is new H2.Scheme (Standard.Wide_Character, Standard.Wide_String);
|
||||
package S is new H2.Scheme (Standard.Wide_Character);
|
||||
|
||||
------------------------------------------------------------
|
||||
--type Object_String_Pointer is access all S.Object_String;
|
||||
type Object_String_Pointer is access constant S.Object_String;
|
||||
type String_Input_Stream_Record(Str: Object_String_Pointer) is new S.Stream_Record with record
|
||||
Pos: Standard.Natural := 0;
|
||||
Pos: S.Object_String_Size := 0;
|
||||
end record;
|
||||
|
||||
--type String_Input_Stream_Record(Len: Standard.Natural) is new S.Stream_Record with record
|
||||
-- Pos: Standard.Natural := 0;
|
||||
-- Str: S.Object_String (1 .. Len) := (others => ' ');
|
||||
--end record;
|
||||
|
||||
procedure Open (Stream: in out String_Input_Stream_Record);
|
||||
procedure Close (Stream: in out String_Input_Stream_Record);
|
||||
procedure Read (Stream: in out String_Input_Stream_Record;
|
||||
Data: out S.Object_String;
|
||||
Last: out Standard.Natural);
|
||||
Last: out S.Object_String_Size);
|
||||
procedure Write (Stream: in out String_Input_Stream_Record;
|
||||
Data: out S.Object_String;
|
||||
Last: out Standard.Natural);
|
||||
Last: out S.Object_String_Size);
|
||||
|
||||
------------------------------------------------------------
|
||||
--type File_Stream_Record(Name: Object_String_Pointer) is new S.Stream_Record with record
|
||||
-- Handle: H2.Text_IO.File_Type;
|
||||
--end record;
|
||||
|
||||
type File_Stream_Record is new S.Stream_Record with record
|
||||
Name: S.Constant_Object_String_Pointer;
|
||||
Handle: Ada.Wide_Text_IO.File_Type;
|
||||
end record;
|
||||
|
||||
|
||||
procedure Open (Stream: in out File_Stream_Record);
|
||||
procedure Close (Stream: in out File_Stream_Record);
|
||||
procedure Read (Stream: in out File_Stream_Record;
|
||||
Data: out S.Object_String;
|
||||
Last: out Standard.Natural);
|
||||
Last: out S.Object_String_Size);
|
||||
procedure Write (Stream: in out File_Stream_Record;
|
||||
Data: out S.Object_String;
|
||||
Last: out Standard.Natural);
|
||||
Last: out S.Object_String_Size);
|
||||
|
||||
------------------------------------------------------------
|
||||
procedure Allocate_Stream (Interp: in out S.Interpreter_Record;
|
||||
|
Reference in New Issue
Block a user