-- $Date: 2004/03/08 11:10:37 $
-- $Revision: 1.5 $
-- $Author: jcrocholl $

-- with Ada.Text_IO;
with Ada.Unchecked_Deallocation;
with Integer_Strings; use Integer_Strings;
with Interfaces; use Interfaces;

package body Strings is

   String_Count : Integer := 0;
   Byte_Count   : Integer := 0;

   -- Create string access. Free previous value if applicable.
   procedure To_String_Access
     (This   : in String;               -- Convert this string.
      Result : in out String_Access) is -- Return result here.
   begin
      Free(Result);
      Result := new String'(This);
      String_Count := String_Count + 1;
      Byte_Count := Byte_Count + This'Length;
   end To_String_Access;
   pragma Inline(To_String_Access);

   -- Create a new string access.
   function To_String_Access
     (This : in String)   -- Convert this string.
     return String_Access -- Return result here.
   is
      Result : String_Access;
   begin
      To_String_Access(This, Result);
      return Result;
   end To_String_Access;