Write string vectors to file
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 --
|
||||
-----------------
|
||||
|
||||
Reference in New Issue
Block a user