CVS difference for ai12s/ai12-0384-1.txt

Differences between 1.3 and version 1.4
Log of other versions for file ai12s/ai12-0384-1.txt

--- ai12s/ai12-0384-1.txt	2020/09/02 04:06:24	1.3
+++ ai12s/ai12-0384-1.txt	2020/09/12 03:12:15	1.4
@@ -788,3 +788,104 @@
 
 ****************************************************************
 
+From: Raphael Amiard
+Sent: Wednesday, September 9, 2020  4:29 AM
+
+In the context of AI12-0384-1/02 (Fixups for Put_Image and Text_Buffers), we 
+discussed a possible compromise with Tucker yesterday, to simplify the public
+interface of the package to the following:
+
+package Ada.Strings.String_Writer with Pure is
+
+   Standard_Indent : constant Positive := 3;
+
+   type Root_Buffer_Type is abstract tagged limited private;
+
+   procedure Put
+     (Buffer : in out Root_Buffer_Type;
+      Item   : String) is abstract;
+
+   procedure Wide_Put
+     (Buffer : in out Root_Buffer_Type;
+      Item   : Wide_String) is abstract;
+
+   procedure Wide_Wide_Put
+     (Buffer : in out Root_Buffer_Type;
+      Item   : Wide_Wide_String) is abstract;
+
+   procedure Put_UTF_8
+     (Buffer : in out Root_Buffer_Type;
+      Item   : in UTF_Encoding.UTF_8_String) is abstract;
+
+   procedure Wide_Put_UTF_16
+     (Buffer : in out Root_Buffer_Type;
+      Item   : in UTF_Encoding.UTF_16_Wide_String) is abstract;
+
+   procedure Increase_Indent
+     (Buffer : in out Root_Buffer_Type;
+      Amount : Positive := Standard_Indent) is abstract;
+
+   procedure Decrease_Indent
+     (Buffer : in out Root_Buffer_Type;
+      Amount : Positive := Standard_Indent) is abstract;
+
+   function Get_Indent
+     (Buffer : Root_Buffer_Type) return Natural is abstract;
+private
+   --  ...  Not defined by the language
+end Ada.Strings.String_Writer;
+
+package Ada.Strings is
+   Newline : constant String; -- impl dependent
+end Ada.Strings;
+
+package Ada.Strings.String_Writer.Unbounded
+   with Preelaborate is
+
+   type Buffer_Type is new Root_Buffer_Type with private;
+
+   Function Get (Buffer : in out Root_Buffer_Type) return String;
+
+   Function Wide_Get () return Wide_String;
+
+   Function Wide_Wide_Get () return Wide_Wide_String;
+
+   Function Get_UTF_8 () return UTF_Encoding.UTF_8_String;
+
+   Function Wide_Get_UTF_16 () return UTF_Encoding.UTF_16_Wide_String;
+
+private
+
+   --  ...
+end Ada.Strings.Text_Buffers.Unbounded;
+
+with Ada.Strings.UTF_Encoding.Wide_Wide_Strings;
+package Ada.Strings.Text_Buffers.Bounded
+   with Pure is
+
+   type Buffer_Type
+     (Max_Characters : Text_Buffer_Count)
+      is new Root_Buffer_Type with private;
+
+   function Character_Count (Buffer : Buffer_Type)
+     return Text_Buffer_Count;
+
+   Procedure Get (Buffer : in out Buffer_Type; Image : out String; Substitute : Character :=  );
+
+   Procedure Wide_Get (Buffer : in out Buffer_Type; Image : out Wide_String;
+     Substitute : Wide_Character :=  );
+
+   Procedure Wide_Wide_Get (Buffer : in out Buffer_Type; Image : out Wide_Wide_String);
+
+   --  Other operations are inherited
+
+private
+
+   --  ...
+
+end Ada.Strings.Text_Buffers.Bounded;
+
+This would seem like a good starting point for the discussion on this AI.
+
+****************************************************************
+

Questions? Ask the ACAA Technical Agent