diff --git a/src/alire-utils.adb b/src/alire-utils.adb index 7deee4d9..48b60f6e 100644 --- a/src/alire-utils.adb +++ b/src/alire-utils.adb @@ -1,3 +1,4 @@ +with Ada.Streams.Stream_IO; with Ada.Strings.Fixed; with Ada.Strings.Maps; @@ -135,4 +136,25 @@ package body Alire.Utils is end return; end To_Native; + ----------- + -- Write -- + ----------- + + procedure Write (V : String_Vector; + Filename : Platform_Independent_Path; + Separator : String := ASCII.LF & "") + is + use Ada.Streams.Stream_IO; + F : File_Type; + begin + Create (F, Out_File, Filename); + + for Line of V loop + String'Write (Stream (F), Line); + String'Write (Stream (F), Separator); + end loop; + + Close (F); + end Write; + end Alire.Utils; diff --git a/src/alire-utils.ads b/src/alire-utils.ads index 1ce41f28..a82ba4aa 100644 --- a/src/alire-utils.ads +++ b/src/alire-utils.ads @@ -48,6 +48,11 @@ package Alire.Utils with Preelaborate is function Flatten (V : String_Vector; Separator : String := " ") return String; -- Concatenate all elements + procedure Write (V : String_Vector; + Filename : Platform_Independent_Path; + Separator : String := ASCII.LF & ""); + -- Dump contents to a given file + ----------------- -- XXX_XXX_XXX -- -----------------