UP.Last := UP.Reference'Length;
end Set_Wide_String;
+ procedure Set_Wide_String
+ (U : out Unbounded_Wide_String;
+ Length : Positive;
+ Set : not null access procedure (S : out Wide_String))
+ is
+ Old : Wide_String_Access := U.Reference;
+ begin
+ U.Last := Length;
+ U.Reference := new Wide_String (1 .. Length);
+ Set (U.Reference.all);
+ Free (Old);
+ end Set_Wide_String;
+
end Ada.Strings.Wide_Unbounded.Aux;
-- than string. The lower bound of the string value is required to be one,
-- and this requirement is not checked.
+ procedure Set_Wide_String
+ (U : out Unbounded_Wide_String;
+ Length : Positive;
+ Set : not null access procedure (S : out Wide_String));
+ pragma Inline (Set_Wide_String);
+ -- Create an unbounded string U with the given Length, using Set to fill
+ -- the contents of U.
+
end Ada.Strings.Wide_Unbounded.Aux;
Free (X);
end Set_Wide_String;
+ procedure Set_Wide_String
+ (U : out Unbounded_Wide_String;
+ Length : Positive;
+ Set : not null access procedure (S : out Wide_String))
+ is
+ TR : constant Shared_Wide_String_Access := U.Reference;
+ DR : Shared_Wide_String_Access;
+ begin
+ -- Try to reuse existing shared string
+
+ if Can_Be_Reused (TR, Length) then
+ Reference (TR);
+ DR := TR;
+
+ -- Otherwise allocate new shared string
+
+ else
+ DR := Allocate (Length);
+ U.Reference := DR;
+ end if;
+
+ Set (DR.Data (1 .. Length));
+ DR.Last := Length;
+ Unreference (TR);
+ end Set_Wide_String;
+
end Ada.Strings.Wide_Unbounded.Aux;
UP.Last := UP.Reference'Length;
end Set_Wide_Wide_String;
+ procedure Set_Wide_Wide_String
+ (U : out Unbounded_Wide_Wide_String;
+ Length : Positive;
+ Set : not null access procedure (S : out Wide_Wide_String))
+ is
+ Old : Wide_Wide_String_Access := U.Reference;
+ begin
+ U.Last := Length;
+ U.Reference := new Wide_Wide_String (1 .. Length);
+ Set (U.Reference.all);
+ Free (Old);
+ end Set_Wide_Wide_String;
+
end Ada.Strings.Wide_Wide_Unbounded.Aux;
-- than string. The lower bound of the string value is required to be one,
-- and this requirement is not checked.
+ procedure Set_Wide_Wide_String
+ (U : out Unbounded_Wide_Wide_String;
+ Length : Positive;
+ Set : not null access procedure (S : out Wide_Wide_String));
+ pragma Inline (Set_Wide_Wide_String);
+ -- Create an unbounded string U with the given Length, using Set to fill
+ -- the contents of U.
+
end Ada.Strings.Wide_Wide_Unbounded.Aux;
Free (X);
end Set_Wide_Wide_String;
+ procedure Set_Wide_Wide_String
+ (U : out Unbounded_Wide_Wide_String;
+ Length : Positive;
+ Set : not null access procedure (S : out Wide_Wide_String))
+ is
+ TR : constant Shared_Wide_Wide_String_Access := U.Reference;
+ DR : Shared_Wide_Wide_String_Access;
+ begin
+ -- Try to reuse existing shared string
+
+ if Can_Be_Reused (TR, Length) then
+ Reference (TR);
+ DR := TR;
+
+ -- Otherwise allocate new shared string
+
+ else
+ DR := Allocate (Length);
+ U.Reference := DR;
+ end if;
+
+ Set (DR.Data (1 .. Length));
+ DR.Last := Length;
+ Unreference (TR);
+ end Set_Wide_Wide_String;
+
end Ada.Strings.Wide_Wide_Unbounded.Aux;